Allow using the tools repo via DUB

This commit is contained in:
Sebastian Wilzbach 2018-06-12 19:15:07 +02:00
parent 60c0f8921b
commit 40ff32ec60
5 changed files with 93 additions and 1 deletions

2
.gitignore vendored
View file

@ -8,3 +8,5 @@
GNUmakefile
/.dub
/tests_extractor
/dtools_*
/dub.selections.json

74
dub.sdl Normal file
View file

@ -0,0 +1,74 @@
name "dtools"
description "D Tools"
authors "DLang Community"
copyright "Copyright © 1999-2018, The D Language Foundation"
license "BSL-1.0"
targetType "none"
subPackage {
name "tests_extractor"
targetType "executable"
dependency "libdparse" version="~>0.8.0"
sourceFiles "tests_extractor.d"
}
subPackage {
name "dman"
targetType "executable"
sourceFiles "dman.d"
stringImportPaths "."
}
subPackage {
name "dget"
targetType "executable"
sourceFiles "dget.d"
}
subPackage {
name "checkwhitespace"
targetType "executable"
sourceFiles "checkwhitespace.d"
}
subPackage {
name "ddemangle"
targetType "executable"
sourceFiles "ddemangle.d"
}
subPackage {
name "detab"
targetType "executable"
sourceFiles "detab.d"
}
subPackage {
name "tolf"
targetType "executable"
sourceFiles "tolf.d"
}
subPackage {
name "rdmd"
targetType "executable"
sourceFiles "rdmd.d"
}
subPackage {
name "contributors"
targetType "executable"
sourceFiles "contributors.d"
}
subPackage {
name "changed"
targetType "executable"
sourceFiles "changed.d"
}
subPackage {
name "catdoc"
targetType "executable"
sourceFiles "catdoc.d"
}

13
test/test_dub.sh Executable file
View file

@ -0,0 +1,13 @@
#!/bin/bash
# Test building of all DUB packages
set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# dman is excluded in this test because it requires the d-tags.json file for building
for package in tests_extractor dget checkwhitespace ddemangle detab tolf \
rdmd contributors changed catdoc ; do
echo "Testing DUB build of $package"
dub build --root "$DIR/.." ":$package"
done

View file

@ -1,7 +1,7 @@
#!/usr/bin/env dub
/++dub.sdl:
name "tests_extractor"
dependency "libdparse" version="~>0.7.2-alpha.4"
dependency "libdparse" version="~>0.8.0"
+/
/*
* Parses all public unittests that are visible on dlang.org

View file

@ -45,3 +45,6 @@ popd && rm -rf "$dir" && mkdir "$dir" && pushd "$dir"
echo "y" | "$cwd"/setup.sh --tag=2.078.1
echo 'void main(){ import std.stdio; __VERSION__.writeln;}' | "./2.078.1/${dmd}" -run - | grep -q "2078"
popd
# test building the DUB packages
./test/test_dub.sh