Fix building the Dub frontend package on Windows

The Dub package was unconditionally running the `config.sh` shell
script to generate the `VERSION` file. A Bash shell script will not
work on Windows. Therefore the `config.sh` script has been ported to
D, which will work on both Windows and Posix.
This commit is contained in:
Jacob Carlborg 2018-10-28 12:26:40 +01:00
parent 927de2e31a
commit 71e2660171
4 changed files with 96 additions and 21 deletions

View file

@ -29,7 +29,8 @@ subPackage {
"src/dmd/tokens.d" \
"src/dmd/utf.d"
preGenerateCommands `cd "$${DUB_PACKAGE_DIR}" && ./config.sh generated/dub VERSION /etc`
preGenerateCommands `"$${DC}" -run "$${DUB_PACKAGE_DIR}/config.d" "$${DUB_PACKAGE_DIR}/generated/dub" "$${DUB_PACKAGE_DIR}/VERSION" /etc` platform="posix"
preGenerateCommands `"%DC%" -run "%DUB_PACKAGE_DIR%/config.d" "%DUB_PACKAGE_DIR%/generated/dub" "%DUB_PACKAGE_DIR%/VERSION"` platform="windows"
stringImportPaths "generated/dub"
dependency "dmd:root" version="*"
@ -53,7 +54,8 @@ subPackage {
subPackage {
name "frontend"
targetType "library"
preGenerateCommands `cd "$${DUB_PACKAGE_DIR}" && ./config.sh generated/dub VERSION /etc`
preGenerateCommands `"$${DC}" -run "$${DUB_PACKAGE_DIR}/config.d" "$${DUB_PACKAGE_DIR}/generated/dub" "$${DUB_PACKAGE_DIR}/VERSION" /etc` platform="posix"
preGenerateCommands `"%DC%" -run "%DUB_PACKAGE_DIR%/config.d" "%DUB_PACKAGE_DIR%/generated/dub" "%DUB_PACKAGE_DIR%/VERSION"` platform="windows"
stringImportPaths "generated/dub"
stringImportPaths "res"
versions "NoBackend"