Fresh dist worktree
As of Git 2.5, it's no longer necessary to create a fresh clone to test distribution builds.
Instead, you can use the new worktree
command to create a separate working copy that shares the main .git
metadata folder per https://git-scm.com/docs/git-worktree.
From your main clone of the DITA-OT core repository, run the following command to create a new branch named test/dist-build
from the tip of the develop
branch and check that out to a new worktree in a sibling directory named dita-ot.dist.worktree
:
git worktree add -b test/dist-build ../dita-ot.dist.worktree develop
Then initialize submodules, and run both Gradle builds:
cd ../dita-ot.dist.worktree/ &&\
git submodule update --init --recursive &&\
./gradlew &&\
./gradlew dist
When the command sequence above completes, you'll find the results in the
dita-ot.dist.worktree/
folder under build/tmp/dist/
.
The contents of this folder are also compressed to a zip archive
under dita-ot.dist.worktree/build/distributions/
.
When you're done testing:
- Switch back to your main clone
- Remove the worktree, passing the
--force
option (required for submodules) - Delete the extra branch
cd - &&\
git worktree remove ../dita-ot.dist.worktree/ --force &&\
git branch --delete test/dist-build
View the latest DITA Open Toolkit docs at www.dita-ot.org/dev.