diff --git a/changelog/minDubVersion.dd b/changelog/minDubVersion.dd deleted file mode 100644 index 79d91f0..0000000 --- a/changelog/minDubVersion.dd +++ /dev/null @@ -1,17 +0,0 @@ -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/package_.d b/source/dub/package_.d index 089f179..bac7020 100644 --- a/source/dub/package_.d +++ b/source/dub/package_.d @@ -116,7 +116,6 @@ // use the given recipe as the basis m_info = recipe; - checkMinDubVersion(); fillWithDefaults(); } @@ -620,35 +619,6 @@ 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/recipe/json.d b/source/dub/recipe/json.d index 707facb..a254e89 100644 --- a/source/dub/recipe/json.d +++ b/source/dub/recipe/json.d @@ -33,7 +33,6 @@ 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) { @@ -81,7 +80,6 @@ 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 b323bc5..7775bdb 100644 --- a/source/dub/recipe/packagerecipe.d +++ b/source/dub/recipe/packagerecipe.d @@ -79,7 +79,6 @@ 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 dfabb45..33dc59d 100644 --- a/source/dub/recipe/sdl.d +++ b/source/dub/recipe/sdl.d @@ -42,7 +42,6 @@ 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": @@ -97,7 +96,6 @@ 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/issue1531-min-dub-version.sh b/test/issue1531-min-dub-version.sh deleted file mode 100755 index 7fc1230..0000000 --- a/test/issue1531-min-dub-version.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/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