From 40ff32ec60c81da5ee5799f51e96e96275385853 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Tue, 12 Jun 2018 19:15:07 +0200 Subject: [PATCH] Allow using the tools repo via DUB --- .gitignore | 2 ++ dub.sdl | 74 +++++++++++++++++++++++++++++++++++++++++++++++ test/test_dub.sh | 13 +++++++++ tests_extractor.d | 2 +- travis.sh | 3 ++ 5 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 dub.sdl create mode 100755 test/test_dub.sh diff --git a/.gitignore b/.gitignore index 10b0e81022..78bb16556f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ GNUmakefile /.dub /tests_extractor +/dtools_* +/dub.selections.json diff --git a/dub.sdl b/dub.sdl new file mode 100644 index 0000000000..70b776f768 --- /dev/null +++ b/dub.sdl @@ -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" +} diff --git a/test/test_dub.sh b/test/test_dub.sh new file mode 100755 index 0000000000..b0e4955ba2 --- /dev/null +++ b/test/test_dub.sh @@ -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 diff --git a/tests_extractor.d b/tests_extractor.d index 7d839f6441..eac728f23f 100755 --- a/tests_extractor.d +++ b/tests_extractor.d @@ -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 diff --git a/travis.sh b/travis.sh index df6428def0..cad02a46dd 100755 --- a/travis.sh +++ b/travis.sh @@ -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