Browse Source

feat: add platform recreation to checkout hook ; doc: add clone information

master
Dennis Buchhorn 2 years ago
parent
commit
4902241e84
2 changed files with 33 additions and 7 deletions
  1. +6
    -0
      .githooks/post-checkout
  2. +27
    -7
      README.md

+ 6
- 0
.githooks/post-checkout View File

@ -14,3 +14,9 @@ for entryFileToSubstitute in $listFilesToSubstitute; do
fileContent=$(<$fullPath) fileContent=$(<$fullPath)
echo "${fileContent//${staticPathSubstitution}/${repoRoot}}" > "${fullPathSubstitute}" echo "${fileContent//${staticPathSubstitution}/${repoRoot}}" > "${fullPathSubstitute}"
done done
mv hw_platform/platform.tcl TMP
rm -rf hw_platform
mkdir hw_platform
mv TMP hw_platform/platform.tcl
xsct hw_platform/platform.tcl

+ 27
- 7
README.md View File

@ -10,9 +10,9 @@ Trying to make Vitis more git-friendly.
Vitis is a little bit less pain in the ass than Vivado to version control decently, so this repository provide: Vitis is a little bit less pain in the ass than Vivado to version control decently, so this repository provide:
- A good to start with `.gitignore` file
- A good to start with `.gitignore` file.
- Git-hook-scripts to eliminate absolute paths in project files
- Git-hook-scripts to eliminate absolute paths in project files.
### Workflow ### Workflow
@ -24,16 +24,36 @@ Vitis is a little bit less pain in the ass than Vivado to version control decent
3. Create a new platform project called `hw_platform` and choose the copied hardware specification file. 3. Create a new platform project called `hw_platform` and choose the copied hardware specification file.
4. Create a new application project via `File -> New -> Application Project...`, choose the platform created befor and name it as you want.
4. Create a new application project via `File -> New -> Application Project...`, choose the platform created befor and name the application project as you want.
5. Copy the `.gitignore` file and the `.githooks` folder from this repository into the workspace folder. 5. Copy the `.gitignore` file and the `.githooks` folder from this repository into the workspace folder.
6. Execute the following commands in the workspace folder: 6. Execute the following commands in the workspace folder:
- `git init` - Initialize git repository in the workspace folder
- `git init` - initialize git repository in the workspace folder.
- `git config --local core.hooksPath .githooks` - set path to git-hooks for this repository
- `git config --local core.hooksPath .githooks` - set path to git-hooks for this repository.
- `git add .` - add all relevant files to the repository
- `git add .` - add all relevant files to the repository.
- `git commit -m 'initial commit'` - create initial commit
- `git commit -m 'initial commit'` - create initial commit.
#### Clone existing project
1. After cloning the repository execute the following commands in the cloned folder:
- `git config --local core.hooksPath .githooks` - set path to git-hooks for this repository.
- `git checkout BRANCH` - checkout the BRANCH you want to work with (e.g. `master`) which create local project files (because the hook script will be executed now ; this could take a while).
2. Open Vitis and select the cloned folder as workspace.
3. Click on `Inport Project`, choose `Import projects from Git` and click `Next >`.
4. Choose `Existing local repository` and click `Next >`.
5. Choose the cloned / workspace folder (should be the only entry) and click `Next >`.
6. Choose `Import existing Eclipse projects` and click `Next >`.
7. Leave everything unchanged and click `Finish`.

Loading…
Cancel
Save