Browse Source

Add wproj command

pull/5/head
Ricardo Barbedo 6 years ago
parent
commit
a77eecc2e6
3 changed files with 37 additions and 1 deletions
  1. +2
    -0
      README.md
  2. +4
    -1
      Vivado_init.tcl
  3. +31
    -0
      scripts/alias.tcl

+ 2
- 0
README.md View File

@ -28,6 +28,8 @@ Vivado is a pain in the ass to source control decently, so these scripts provide
- A git wrapper that will recreate the project script and add it before committing.
- A Tcl script (`wproj`) to just create the project generator script without using git.
### Workflow
1. When first starting with a project, create it in a folder called `vivado_proj` (e.g. `PROJECT_NAME/vivado_proj`) . All the untracked files will be under this directory.


+ 4
- 1
Vivado_init.tcl View File

@ -4,4 +4,7 @@ source $init_dir/scripts/write_project_tcl_git.tcl
namespace import ::custom::write_project_tcl_git
source $init_dir/scripts/git_wrapper.tcl
namespace import ::git_wrapper::git
namespace import ::git_wrapper::git
source $init_dir/scripts/alias.tcl
namespace import ::alias::wproj

+ 31
- 0
scripts/alias.tcl View File

@ -0,0 +1,31 @@
# Aliases
# Interface
namespace eval ::alias {
namespace export wproj
namespace import ::custom::write_project_tcl_git
namespace import ::current_project
namespace import ::common::get_property
}
# Define
namespace eval ::alias {
proc wproj {} {
# Change directory project directory if not in it yet
set proj_dir [regsub {\/vivado_proj$} [get_property DIRECTORY [current_project]] {}]
set current_dir [pwd]
if {
[string compare -nocase $proj_dir $current_dir]
} then {
puts "Not in project directory"
puts "Changing directory to: ${proj_dir}"
cd $proj_dir
}
# Generate project
set proj_file [current_project].tcl
puts $proj_file
write_project_tcl_git -no_copy_sources -force $proj_file
}
}

Loading…
Cancel
Save