File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # /bin/sh
2+
3+ OUTDIR=" $1 "
4+ VERSIONFILE=" $2 "
5+ SYSCONFDIR=" $3 "
6+ VERSION=$( git describe --dirty 2> /dev/null || cat " $VERSIONFILE " ) # prefer git describe
7+
8+ mkdir -p " $OUTDIR "
9+ # only update config files when they actually differ to avoid unnecessary rebuilds
10+ if [ " $VERSION " != " $( cat " $OUTDIR /VERSION" 2> /dev/null) " ]; then
11+ printf " $VERSION " > " $OUTDIR /VERSION"
12+ fi
13+ if [ " $SYSCONFDIR " != " $( cat " $OUTDIR /SYSCONFDIR.imp" 2> /dev/null) " ]; then
14+ printf " $SYSCONFDIR " > " $OUTDIR /SYSCONFDIR.imp"
15+ fi
Original file line number Diff line number Diff line change @@ -29,9 +29,8 @@ subPackage {
2929 "src/ddmd/tokens.d" \
3030 "src/ddmd/utf.d"
3131
32- // stringImportPaths cannot be used because it will make Dub extremely slow
33- // https://github.com/dlang/dub/issues/1199
34- dflags "-J$PACKAGE_DIR"
32+ preGenerateCommands `cd "$${DUB_PACKAGE_DIR}" && ./config.sh generated/dub VERSION /etc`
33+ stringImportPaths "generated/dub"
3534
3635 dependency "dmd:root" version="*"
3736}
Original file line number Diff line number Diff line change @@ -459,17 +459,7 @@ optabgen.out : $G/optabgen
459459
460460# ####### VERSION
461461
462- VERSION := $(shell cat ../VERSION) # default to checked-in VERSION file
463- ifneq (1,$(RELEASE ) ) # unless building a release
464- VERSION := $(shell printf "`$(GIT ) describe --dirty || cat ../VERSION`") # use git describe
465- endif
466-
467- # only update $G/VERSION when it differs to avoid unnecessary rebuilds
468- $(shell test $(VERSION) != "`cat $G/VERSION 2> /dev/null`" \
469- && printf $(VERSION) > $G/VERSION )
470-
471- $(shell test $(SYSCONFDIR) != "`cat $G/SYSCONFDIR.imp 2> /dev/null`" \
472- && printf '$(SYSCONFDIR)' > $G/SYSCONFDIR.imp )
462+ $(shell ../config.sh "$G" ../VERSION $(SYSCONFDIR))
473463
474464# ########
475465# Specific dependencies other than the source file for all objects
You can’t perform that action at this time.
0 commit comments