diff --git a/README.md b/README.md index f2aa9b7..dee9cc5 100644 --- a/README.md +++ b/README.md @@ -55,3 +55,12 @@ ## Using DUB as a library The [DUB package of DUB](http://code.dlang.org/packages/dub) can be used as a library to load or manipulate packages, or to resemble any functionality of the command line tool. The former task can be achieved by using the [Package class](https://github.com/dlang/dub/blob/master/source/dub/package_.d#L40). For examples on how to replicate the command line functionality, see [commandline.d](https://github.com/dlang/dub/blob/master/source/dub/commandline.d). + +## Minimal D compiler required to build DUB + +In general it is always recommended to build DUB with the latest version of your D compiler. +However, currently [2.072](https://dlang.org/changelog/2.072.0.html) is required to build DUB from source. + +# Contributing + +New contributers are always welcome, there's plenty to work on! For an easy start, take a look at issues marked [`bootcamp`](https://github.com/dlang/dub/labels/bootcamp) diff --git a/changelog/betterC_build_option.dd b/changelog/betterC_build_option.dd new file mode 100644 index 0000000..a9628f6 --- /dev/null +++ b/changelog/betterC_build_option.dd @@ -0,0 +1,13 @@ +betterC build option has been added + +This build option can be used to pass `-betterC` argument to DMD or LDC: + +dub.json: +--- +"buildOptions": ["betterC"] +--- + +dub.sdl: +--- +buildOptions "betterC" +--- diff --git a/changelog/env_var_package_version.dd b/changelog/env_var_package_version.dd new file mode 100644 index 0000000..3bc04de --- /dev/null +++ b/changelog/env_var_package_version.dd @@ -0,0 +1,3 @@ +Environment variable DUB_PACKAGE_VERSION added + +DUB now supports the environment variable DUB_PACKAGE_VERSION containing the version of the package \ No newline at end of file diff --git a/changelog/minDubVersion.dd b/changelog/minDubVersion.dd new file mode 100644 index 0000000..79d91f0 --- /dev/null +++ b/changelog/minDubVersion.dd @@ -0,0 +1,17 @@ +Dub now supports a `minDubVersion` field. + +This field will abort the build if the user doesn't have a recent enough version of dub +and miss needed feature to perform the build. + +`minDubVersion` can be added to project's `dub.json`: +------- +{ + ... + "minDubVersion": "1.10" + ... +} +------ +or `dub.sdl`: +------ +minDubVersion "1.10" +------ diff --git a/source/dub/compilers/buildsettings.d b/source/dub/compilers/buildsettings.d index 28b98be..939a1f1 100644 --- a/source/dub/compilers/buildsettings.d +++ b/source/dub/compilers/buildsettings.d @@ -300,9 +300,11 @@ property = 1<<20, /// DEPRECATED: Enforce property syntax (-property) profileGC = 1<<21, /// Profile runtime allocations pic = 1<<22, /// Generate position independent code + betterC = 1<<23, /// Compile in betterC mode (-betterC) + // for internal usage - _docs = 1<<23, // Write ddoc to docs - _ddox = 1<<24 // Compile docs.json + _docs = 1<<24, // Write ddoc to docs + _ddox = 1<<25 // Compile docs.json } struct BuildOptions { diff --git a/source/dub/compilers/dmd.d b/source/dub/compilers/dmd.d index e5864b4..be04a79 100644 --- a/source/dub/compilers/dmd.d +++ b/source/dub/compilers/dmd.d @@ -46,6 +46,7 @@ tuple(BuildOption.deprecationErrors, ["-de"]), tuple(BuildOption.property, ["-property"]), tuple(BuildOption.profileGC, ["-profile=gc"]), + tuple(BuildOption.betterC, ["-betterC"]), tuple(BuildOption._docs, ["-Dddocs"]), tuple(BuildOption._ddox, ["-Xfdocs.json", "-Df__dummy.html"]), @@ -162,6 +163,8 @@ case TargetType.dynamicLibrary: if (platform.platform.canFind("windows")) return settings.targetName ~ ".dll"; + else if (platform.platform.canFind("osx")) + return "lib" ~ settings.targetName ~ ".dylib"; else return "lib" ~ settings.targetName ~ ".so"; case TargetType.object: if (platform.platform.canFind("windows")) diff --git a/source/dub/compilers/gdc.d b/source/dub/compilers/gdc.d index 063c60e..3a79b7e 100644 --- a/source/dub/compilers/gdc.d +++ b/source/dub/compilers/gdc.d @@ -156,6 +156,8 @@ case TargetType.dynamicLibrary: if (platform.platform.canFind("windows")) return settings.targetName ~ ".dll"; + else if (platform.platform.canFind("osx")) + return "lib" ~ settings.targetName ~ ".dylib"; else return "lib" ~ settings.targetName ~ ".so"; case TargetType.object: if (platform.platform.canFind("windows")) diff --git a/source/dub/compilers/ldc.d b/source/dub/compilers/ldc.d index dbc77fd..776bf4b 100644 --- a/source/dub/compilers/ldc.d +++ b/source/dub/compilers/ldc.d @@ -46,6 +46,7 @@ tuple(BuildOption.deprecationErrors, ["-de"]), tuple(BuildOption.property, ["-property"]), //tuple(BuildOption.profileGC, ["-?"]), + tuple(BuildOption.betterC, ["-betterC"]), tuple(BuildOption._docs, ["-Dd=docs"]), tuple(BuildOption._ddox, ["-Xf=docs.json", "-Dd=__dummy_docs"]), @@ -140,18 +141,8 @@ string getTargetFileName(in BuildSettings settings, in BuildPlatform platform) const { - import std.string : splitLines, strip; - import std.uni : toLower; - assert(settings.targetName.length > 0, "No target name set."); - auto result = executeShell(escapeShellCommand([platform.compilerBinary, "-version"])); - enforce (result.status == 0, "Failed to determine linker used by LDC. \"" - ~platform.compilerBinary~" -version\" failed with exit code " - ~result.status.to!string()~"."); - - bool generates_coff = result.output.splitLines.find!(l => l.strip.toLower.startsWith("default target:")).front.canFind("-windows-msvc"); - final switch (settings.targetType) { case TargetType.autodetect: assert(false, "Configurations must have a concrete target type."); case TargetType.none: return null; @@ -162,11 +153,13 @@ else return settings.targetName; case TargetType.library: case TargetType.staticLibrary: - if (generates_coff) return settings.targetName ~ ".lib"; + if (generatesCOFF(platform)) return settings.targetName ~ ".lib"; else return "lib" ~ settings.targetName ~ ".a"; case TargetType.dynamicLibrary: if (platform.platform.canFind("windows")) return settings.targetName ~ ".dll"; + else if (platform.platform.canFind("osx")) + return "lib" ~ settings.targetName ~ ".dylib"; else return "lib" ~ settings.targetName ~ ".so"; case TargetType.object: if (platform.platform.canFind("windows")) @@ -224,4 +217,29 @@ { return args.map!(s => s.canFind(' ') ? "\""~s~"\"" : s); } + + private static bool generatesCOFF(in BuildPlatform platform) + { + import std.string : splitLines, strip; + import std.uni : toLower; + + static bool[string] compiler_coff_map; + + if (auto pret = platform.compilerBinary in compiler_coff_map) + return *pret; + + auto result = executeShell(escapeShellCommand([platform.compilerBinary, "-version"])); + enforce (result.status == 0, "Failed to determine linker used by LDC. \"" + ~platform.compilerBinary~" -version\" failed with exit code " + ~result.status.to!string()~"."); + + bool ret = result.output + .splitLines + .find!(l => l.strip.toLower.startsWith("default target:")) + .front + .canFind("msvc"); + + compiler_coff_map[platform.compilerBinary] = ret; + return ret; + } } diff --git a/source/dub/dub.d b/source/dub/dub.d index 544805f..3c5c11c 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -773,6 +773,13 @@ if (existsFile(path ~ ".dub/build")) rmdirRecurse((path ~ ".dub/build").toNativeString()); if (existsFile(path ~ ".dub/obj")) rmdirRecurse((path ~ ".dub/obj").toNativeString()); + + auto p = Package.load(path); + if (p.getBuildSettings().targetType == TargetType.none) { + foreach (sp; p.subPackages.filter!(sp => !sp.path.empty)) { + cleanPackage(path ~ sp.path); + } + } } /// Fetches the package matching the dependency and places it in the specified location. diff --git a/source/dub/generators/build.d b/source/dub/generators/build.d index 8e0a171..1895e3b 100644 --- a/source/dub/generators/build.d +++ b/source/dub/generators/build.d @@ -47,6 +47,11 @@ { scope (exit) cleanupTemporaries(); + auto root_ti = targets[m_project.rootPackage.name]; + + enforce(!(settings.rdmd && root_ti.buildSettings.targetType == TargetType.none), + "Building package with target type \"none\" with rdmd is not supported yet."); + logInfo("Performing \"%s\" build using %s for %-(%s, %).", settings.buildType, settings.platform.compilerBinary, settings.platform.architecture); @@ -76,13 +81,13 @@ } } NativePath tpath; - if (buildTarget(settings, bs, ti.pack, ti.config, ti.packages, additional_dep_files, tpath)) - any_cached = true; + if (bs.targetType != TargetType.none) + if (buildTarget(settings, bs, ti.pack, ti.config, ti.packages, additional_dep_files, tpath)) + any_cached = true; target_paths[target] = tpath; } // build all targets - auto root_ti = targets[m_project.rootPackage.name]; if (settings.rdmd || root_ti.buildSettings.targetType == TargetType.staticLibrary) { // RDMD always builds everything at once and static libraries don't need their // dependencies to be built diff --git a/source/dub/generators/generator.d b/source/dub/generators/generator.d index ef51351..34352ba 100644 --- a/source/dub/generators/generator.d +++ b/source/dub/generators/generator.d @@ -267,7 +267,7 @@ } auto depti = &targets[depname]; const depbs = &depti.buildSettings; - if (depbs.targetType == TargetType.executable) + if (depbs.targetType == TargetType.executable && ti.buildSettings.targetType != TargetType.none) continue; // add to (link) dependencies @@ -282,6 +282,9 @@ if (depbs.targetType == TargetType.staticLibrary) ti.linkDependencies = ti.linkDependencies.filter!(d => !depti.linkDependencies.canFind(d)).array ~ depti.linkDependencies; } + + enforce(!(ti.buildSettings.targetType == TargetType.none && ti.dependencies.empty), + "Package with target type \"none\" must have dependencies to build."); } collectDependencies(rootPackage, targets[rootPackage.name], targets); @@ -422,9 +425,8 @@ settings.compiler.extractBuildOptions(ti.buildSettings); auto tt = ti.buildSettings.targetType; - bool generatesBinary = tt != TargetType.sourceLibrary && tt != TargetType.none; - enforce (generatesBinary || ti.pack !is m_project.rootPackage || (ti.buildSettings.options & BuildOption.syntaxOnly), - format("Main package must have a binary target type, not %s. Cannot build.", tt)); + enforce (tt != TargetType.sourceLibrary || ti.pack !is m_project.rootPackage || (ti.buildSettings.options & BuildOption.syntaxOnly), + format("Main package must not have target type \"%s\". Cannot build.", tt)); } } } @@ -650,6 +652,7 @@ env["DUB_PACKAGE_DIR"] = pack.path.toNativeString(); env["DUB_ROOT_PACKAGE"] = proj.rootPackage.name; env["DUB_ROOT_PACKAGE_DIR"] = proj.rootPackage.path.toNativeString(); + env["DUB_PACKAGE_VERSION"] = pack.version_.toString(); env["DUB_COMBINED"] = settings.combined? "TRUE" : ""; env["DUB_RUN"] = settings.run? "TRUE" : ""; diff --git a/source/dub/init.d b/source/dub/init.d index 23873bc..7836ab3 100644 --- a/source/dub/init.d +++ b/source/dub/init.d @@ -45,7 +45,9 @@ import dub.recipe.io : writePackageRecipe; void enforceDoesNotExist(string filename) { - enforce(!existsFile(root_path ~ filename), "The target directory already contains a '"~filename~"' file. Aborting."); + enforce(!existsFile(root_path ~ filename), + "The target directory already contains a '%s' %s. Aborting." + .format(filename, filename.isDir ? "directory" : "file")); } string username = getUserName(); diff --git a/source/dub/package_.d b/source/dub/package_.d index bac7020..089f179 100644 --- a/source/dub/package_.d +++ b/source/dub/package_.d @@ -116,6 +116,7 @@ // use the given recipe as the basis m_info = recipe; + checkMinDubVersion(); fillWithDefaults(); } @@ -619,6 +620,35 @@ return ret; } + private void checkMinDubVersion() + { + import dub.semver : compareVersions, expandVersion, isValidVersion; + import dub.version_ : dubVersion; + import std.exception : enforce; + + if (m_info.minDubVersion.length) { + auto mdv = m_info.minDubVersion; + if (!isValidVersion(mdv)) { + mdv = expandVersion(mdv); + enforce(isValidVersion(mdv), + "minDubVersion "~m_info.minDubVersion~" is not SemVer compliant!"); + } + + static assert(dubVersion.length); + static if (dubVersion[0] == 'v') { + enum dv = dubVersion[1 .. $]; + } + else { + enum dv = dubVersion; + } + static assert(isValidVersion(dv)); + + enforce(compareVersions(dv, mdv) >= 0, + "dub-"~dv~" does not comply with minDubVersion specification: "~mdv~ + ".\nPlease consider upgrading your dub installation."); + } + } + private void fillWithDefaults() { auto bs = &m_info.buildSettings; diff --git a/source/dub/platform.d b/source/dub/platform.d index f048286..1d91982 100644 --- a/source/dub/platform.d +++ b/source/dub/platform.d @@ -51,10 +51,10 @@ version(X86) ret ~= "x86"; version(X86_64) ret ~= "x86_64"; version(ARM) ret ~= "arm"; + version(AArch64) ret ~= "aarch64"; version(ARM_Thumb) ret ~= "arm_thumb"; version(ARM_SoftFloat) ret ~= "arm_softfloat"; version(ARM_HardFloat) ret ~= "arm_hardfloat"; - version(ARM64) ret ~= "arm64"; version(PPC) ret ~= "ppc"; version(PPC_SoftFP) ret ~= "ppc_softfp"; version(PPC_HardFP) ret ~= "ppc_hardfp"; diff --git a/source/dub/recipe/json.d b/source/dub/recipe/json.d index a254e89..707facb 100644 --- a/source/dub/recipe/json.d +++ b/source/dub/recipe/json.d @@ -33,6 +33,7 @@ case "authors": recipe.authors = deserializeJson!(string[])(value); break; case "copyright": recipe.copyright = value.get!string; break; case "license": recipe.license = value.get!string; break; + case "minDubVersion": recipe.minDubVersion = value.get!string; break; case "configurations": break; // handled below, after the global settings have been parsed case "buildTypes": foreach (string name, settings; value) { @@ -80,6 +81,7 @@ if (!recipe.authors.empty) ret["authors"] = serializeToJson(recipe.authors); if (!recipe.copyright.empty) ret["copyright"] = recipe.copyright; if (!recipe.license.empty) ret["license"] = recipe.license; + if (!recipe.minDubVersion.empty) ret["minDubVersion"] = recipe.minDubVersion; if (!recipe.subPackages.empty) { Json[] jsonSubPackages = new Json[recipe.subPackages.length]; foreach (i, subPackage; recipe.subPackages) { diff --git a/source/dub/recipe/packagerecipe.d b/source/dub/recipe/packagerecipe.d index 7775bdb..b323bc5 100644 --- a/source/dub/recipe/packagerecipe.d +++ b/source/dub/recipe/packagerecipe.d @@ -79,6 +79,7 @@ string[] authors; string copyright; string license; + string minDubVersion; string[] ddoxFilterArgs; string ddoxTool; BuildSettingsTemplate buildSettings; diff --git a/source/dub/recipe/sdl.d b/source/dub/recipe/sdl.d index 33dc59d..dfabb45 100644 --- a/source/dub/recipe/sdl.d +++ b/source/dub/recipe/sdl.d @@ -42,6 +42,7 @@ case "authors": recipe.authors ~= n.stringArrayTagValue; break; case "copyright": recipe.copyright = n.stringTagValue; break; case "license": recipe.license = n.stringTagValue; break; + case "minDubVersion": recipe.minDubVersion = n.stringTagValue; break; case "subPackage": subpacks ~= n; break; case "configuration": configs ~= n; break; case "buildType": @@ -96,6 +97,7 @@ if (recipe.authors.length) ret.add(new Tag(null, "authors", recipe.authors.map!(a => Value(a)).array)); if (recipe.copyright.length) add("copyright", recipe.copyright); if (recipe.license.length) add("license", recipe.license); + if (recipe.minDubVersion.length) add("minDubVersion", recipe.minDubVersion); foreach (name, settings; recipe.buildTypes) { auto t = new Tag(null, "buildType", [Value(name)]); t.add(settings.toSDL()); diff --git a/test/issue1070-init-mistakes-dirs-as-files.sh b/test/issue1070-init-mistakes-dirs-as-files.sh new file mode 100755 index 0000000..4cd8e85 --- /dev/null +++ b/test/issue1070-init-mistakes-dirs-as-files.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +cd ${CURR_DIR}/issue1070-init-mistakes-dirs-as-files + +${DUB} init 2>&1 | grep -c "The target directory already contains a 'source/' directory. Aborting." > /dev/null \ No newline at end of file diff --git a/test/issue1070-init-mistakes-dirs-as-files/.no_build b/test/issue1070-init-mistakes-dirs-as-files/.no_build new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/issue1070-init-mistakes-dirs-as-files/.no_build diff --git a/test/issue1070-init-mistakes-dirs-as-files/.no_run b/test/issue1070-init-mistakes-dirs-as-files/.no_run new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/issue1070-init-mistakes-dirs-as-files/.no_run diff --git a/test/issue1070-init-mistakes-dirs-as-files/.no_test b/test/issue1070-init-mistakes-dirs-as-files/.no_test new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/issue1070-init-mistakes-dirs-as-files/.no_test diff --git a/test/issue1070-init-mistakes-dirs-as-files/source/.empty b/test/issue1070-init-mistakes-dirs-as-files/source/.empty new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/issue1070-init-mistakes-dirs-as-files/source/.empty diff --git a/test/issue1427-betterC/.gitignore b/test/issue1427-betterC/.gitignore new file mode 100644 index 0000000..0fd9d37 --- /dev/null +++ b/test/issue1427-betterC/.gitignore @@ -0,0 +1,4 @@ +test +*.o +*.exe +.dub \ No newline at end of file diff --git a/test/issue1427-betterC/.min_frontend b/test/issue1427-betterC/.min_frontend new file mode 100644 index 0000000..67aaf4a --- /dev/null +++ b/test/issue1427-betterC/.min_frontend @@ -0,0 +1 @@ +2.078 diff --git a/test/issue1427-betterC/.no_run b/test/issue1427-betterC/.no_run new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/issue1427-betterC/.no_run diff --git a/test/issue1427-betterC/.no_test b/test/issue1427-betterC/.no_test new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/issue1427-betterC/.no_test diff --git a/test/issue1427-betterC/dub.json b/test/issue1427-betterC/dub.json new file mode 100644 index 0000000..d6e9256 --- /dev/null +++ b/test/issue1427-betterC/dub.json @@ -0,0 +1,4 @@ +{ + "name": "test", + "buildOptions": ["betterC"] +} \ No newline at end of file diff --git a/test/issue1427-betterC/source/app.d b/test/issue1427-betterC/source/app.d new file mode 100644 index 0000000..ca1a7ca --- /dev/null +++ b/test/issue1427-betterC/source/app.d @@ -0,0 +1,3 @@ +version(D_BetterC) {} else static assert(false); + +extern(C) void main() { } \ No newline at end of file diff --git a/test/issue1531-min-dub-version.sh b/test/issue1531-min-dub-version.sh new file mode 100755 index 0000000..7fc1230 --- /dev/null +++ b/test/issue1531-min-dub-version.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -e + +. $(dirname "${BASH_SOURCE[0]}")/common.sh + +cat << EOF | $DUB - || die "Did not pass minDubVersion \"1.0\"" +/+ dub.sdl: + minDubVersion "1.0" ++/ +void main() {} +EOF + +! cat << EOF | $DUB - || die "Did pass minDubVersion \"99.0\"" +/+ dub.sdl: + minDubVersion "99.0" ++/ +void main() {} +EOF diff --git a/test/issue97-targettype-none-nodeps/.fail_build b/test/issue97-targettype-none-nodeps/.fail_build new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/issue97-targettype-none-nodeps/.fail_build diff --git a/test/issue97-targettype-none-nodeps/.gitignore b/test/issue97-targettype-none-nodeps/.gitignore new file mode 100644 index 0000000..433d266 --- /dev/null +++ b/test/issue97-targettype-none-nodeps/.gitignore @@ -0,0 +1,5 @@ +.dub +docs.json +__dummy.html +*.o +*.obj diff --git a/test/issue97-targettype-none-nodeps/.no_run b/test/issue97-targettype-none-nodeps/.no_run new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/issue97-targettype-none-nodeps/.no_run diff --git a/test/issue97-targettype-none-nodeps/a/dub.sdl b/test/issue97-targettype-none-nodeps/a/dub.sdl new file mode 100644 index 0000000..0c83ba9 --- /dev/null +++ b/test/issue97-targettype-none-nodeps/a/dub.sdl @@ -0,0 +1,2 @@ +name "a" +targetType "executable" diff --git a/test/issue97-targettype-none-nodeps/a/source/app.d b/test/issue97-targettype-none-nodeps/a/source/app.d new file mode 100644 index 0000000..c3eec7f --- /dev/null +++ b/test/issue97-targettype-none-nodeps/a/source/app.d @@ -0,0 +1,6 @@ +import std.stdio; + +void main() +{ + writeln("Edit source/app.d to start your project."); +} diff --git a/test/issue97-targettype-none-nodeps/b/dub.sdl b/test/issue97-targettype-none-nodeps/b/dub.sdl new file mode 100644 index 0000000..97d00a8 --- /dev/null +++ b/test/issue97-targettype-none-nodeps/b/dub.sdl @@ -0,0 +1,2 @@ +name "b" +targetType "executable" diff --git a/test/issue97-targettype-none-nodeps/b/source/app.d b/test/issue97-targettype-none-nodeps/b/source/app.d new file mode 100644 index 0000000..c3eec7f --- /dev/null +++ b/test/issue97-targettype-none-nodeps/b/source/app.d @@ -0,0 +1,6 @@ +import std.stdio; + +void main() +{ + writeln("Edit source/app.d to start your project."); +} diff --git a/test/issue97-targettype-none-nodeps/dub.sdl b/test/issue97-targettype-none-nodeps/dub.sdl new file mode 100644 index 0000000..75bd0bd --- /dev/null +++ b/test/issue97-targettype-none-nodeps/dub.sdl @@ -0,0 +1,4 @@ +name "issue97-targettype-none" +targetType "none" +subPackage "./a/" +subPackage "./b/" diff --git a/test/issue97-targettype-none-onerecipe/.gitignore b/test/issue97-targettype-none-onerecipe/.gitignore new file mode 100644 index 0000000..433d266 --- /dev/null +++ b/test/issue97-targettype-none-onerecipe/.gitignore @@ -0,0 +1,5 @@ +.dub +docs.json +__dummy.html +*.o +*.obj diff --git a/test/issue97-targettype-none-onerecipe/.no_run b/test/issue97-targettype-none-onerecipe/.no_run new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/issue97-targettype-none-onerecipe/.no_run diff --git a/test/issue97-targettype-none-onerecipe/a/source/app.d b/test/issue97-targettype-none-onerecipe/a/source/app.d new file mode 100644 index 0000000..c3eec7f --- /dev/null +++ b/test/issue97-targettype-none-onerecipe/a/source/app.d @@ -0,0 +1,6 @@ +import std.stdio; + +void main() +{ + writeln("Edit source/app.d to start your project."); +} diff --git a/test/issue97-targettype-none-onerecipe/b/source/app.d b/test/issue97-targettype-none-onerecipe/b/source/app.d new file mode 100644 index 0000000..c3eec7f --- /dev/null +++ b/test/issue97-targettype-none-onerecipe/b/source/app.d @@ -0,0 +1,6 @@ +import std.stdio; + +void main() +{ + writeln("Edit source/app.d to start your project."); +} diff --git a/test/issue97-targettype-none-onerecipe/dub.sdl b/test/issue97-targettype-none-onerecipe/dub.sdl new file mode 100644 index 0000000..0914715 --- /dev/null +++ b/test/issue97-targettype-none-onerecipe/dub.sdl @@ -0,0 +1,14 @@ +name "issue97-targettype-none" +targetType "none" +dependency "issue97-targettype-none:a" version="*" +dependency "issue97-targettype-none:b" version="*" +subPackage { + name "a" + targetType "executable" + sourcePaths "a/source" +} +subPackage { + name "b" + targetType "executable" + sourcePaths "b/source" +} diff --git a/test/issue97-targettype-none.sh b/test/issue97-targettype-none.sh new file mode 100755 index 0000000..3ffe303 --- /dev/null +++ b/test/issue97-targettype-none.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -e + +${DUB} build --root ${CURR_DIR}/issue97-targettype-none 2>&1 || true + +# make sure both sub-packages are cleaned +OUTPUT=`${DUB} clean --root ${CURR_DIR}/issue97-targettype-none 2>&1` +echo $OUTPUT | grep -c "Cleaning package at .*/issue97-targettype-none/a/" > /dev/null +echo $OUTPUT | grep -c "Cleaning package at .*/issue97-targettype-none/b/" > /dev/null diff --git a/test/issue97-targettype-none/.no_build b/test/issue97-targettype-none/.no_build new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/issue97-targettype-none/.no_build diff --git a/test/issue97-targettype-none/.no_run b/test/issue97-targettype-none/.no_run new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/issue97-targettype-none/.no_run diff --git a/test/issue97-targettype-none/a/dub.sdl b/test/issue97-targettype-none/a/dub.sdl new file mode 100644 index 0000000..0c83ba9 --- /dev/null +++ b/test/issue97-targettype-none/a/dub.sdl @@ -0,0 +1,2 @@ +name "a" +targetType "executable" diff --git a/test/issue97-targettype-none/a/source/app.d b/test/issue97-targettype-none/a/source/app.d new file mode 100644 index 0000000..c3eec7f --- /dev/null +++ b/test/issue97-targettype-none/a/source/app.d @@ -0,0 +1,6 @@ +import std.stdio; + +void main() +{ + writeln("Edit source/app.d to start your project."); +} diff --git a/test/issue97-targettype-none/b/dub.sdl b/test/issue97-targettype-none/b/dub.sdl new file mode 100644 index 0000000..97d00a8 --- /dev/null +++ b/test/issue97-targettype-none/b/dub.sdl @@ -0,0 +1,2 @@ +name "b" +targetType "executable" diff --git a/test/issue97-targettype-none/b/source/app.d b/test/issue97-targettype-none/b/source/app.d new file mode 100644 index 0000000..c3eec7f --- /dev/null +++ b/test/issue97-targettype-none/b/source/app.d @@ -0,0 +1,6 @@ +import std.stdio; + +void main() +{ + writeln("Edit source/app.d to start your project."); +} diff --git a/test/issue97-targettype-none/dub.sdl b/test/issue97-targettype-none/dub.sdl new file mode 100644 index 0000000..1f47423 --- /dev/null +++ b/test/issue97-targettype-none/dub.sdl @@ -0,0 +1,6 @@ +name "issue97-targettype-none" +targetType "none" +dependency "issue97-targettype-none:a" version="*" +dependency "issue97-targettype-none:b" version="*" +subPackage "./a/" +subPackage "./b/"