diff --git a/source/dub/compilers/buildsettings.d b/source/dub/compilers/buildsettings.d index ea86742..6884763 100644 --- a/source/dub/compilers/buildsettings.d +++ b/source/dub/compilers/buildsettings.d @@ -233,19 +233,6 @@ static if (__VERSION__ >= 2067) { @ignore BitFlags!BuildRequirement values; this(BuildRequirement req) { values = req; } - deprecated("Use BuildRequirement.* instead.") { - enum none = BuildRequirement.none; - enum allowWarnings = BuildRequirement.allowWarnings; - enum silenceWarnings = BuildRequirement.silenceWarnings; - enum disallowDeprecations = BuildRequirement.disallowDeprecations; - enum silenceDeprecations = BuildRequirement.silenceDeprecations; - enum disallowInlining = BuildRequirement.disallowInlining; - enum disallowOptimization = BuildRequirement.disallowOptimization; - enum requireBoundsCheck = BuildRequirement.requireBoundsCheck; - enum requireContracts = BuildRequirement.requireContracts; - enum relaxProperties = BuildRequirement.relaxProperties; - enum noDefaultFlags = BuildRequirement.noDefaultFlags; - } } else { @ignore BuildRequirement values; this(BuildRequirement req) { values = req; } @@ -302,30 +289,6 @@ @ignore BitFlags!BuildOption values; this(BuildOption opt) { values = opt; } this(BitFlags!BuildOption v) { values = v; } - deprecated("Use BuildOption.* instead. Will be removed for version 1.0.0.") { - enum none = BuildOption.none; - enum debugMode = BuildOption.debugMode; - enum releaseMode = BuildOption.releaseMode; - enum coverage = BuildOption.coverage; - enum debugInfo = BuildOption.debugInfo; - enum debugInfoC = BuildOption.debugInfoC; - enum alwaysStackFrame = BuildOption.alwaysStackFrame; - enum stackStomping = BuildOption.stackStomping; - enum inline = BuildOption.inline; - enum noBoundsCheck = BuildOption.noBoundsCheck; - enum optimize = BuildOption.optimize; - enum profile = BuildOption.profile; - enum unittests = BuildOption.unittests; - enum verbose = BuildOption.verbose; - enum ignoreUnknownPragmas = BuildOption.ignoreUnknownPragmas; - enum syntaxOnly = BuildOption.syntaxOnly; - enum warnings = BuildOption.warnings; - enum warningsAsErrors = BuildOption.warningsAsErrors; - enum ignoreDeprecations = BuildOption.ignoreDeprecations; - enum deprecationWarnings = BuildOption.deprecationWarnings; - enum deprecationErrors = BuildOption.deprecationErrors; - enum property = BuildOption.property; - } } else { @ignore BuildOption values; this(BuildOption opt) { values = opt; } diff --git a/source/dub/compilers/compiler.d b/source/dub/compilers/compiler.d index 5396fa0..3cd09a8 100644 --- a/source/dub/compilers/compiler.d +++ b/source/dub/compilers/compiler.d @@ -43,36 +43,6 @@ throw new Exception("Unknown compiler: "~name); } -/** Returns the binary name of the default compiler for the system. - - When calling this function for the first time, it will search the PATH - environment variable for files named "dmd", "gdc", "gdmd", "ldc2", "ldmd2" - (in that order) and return the first match. If no match is found, "dmd" is - returned. - - See_Also: `Dub.defaultCompiler` -*/ -deprecated("Use Dub.defaultCompiler instead. Will be removed for version 1.0.0.") -@property string defaultCompiler() -{ - static string name; - if (!name.length) name = findCompiler(); - return name; -} - -private string findCompiler() -{ - import std.process : env=environment; - version (Windows) enum sep = ";", exe = ".exe"; - version (Posix) enum sep = ":", exe = ""; - - auto compilers = ["dmd", "gdc", "gdmd", "ldc2", "ldmd2"]; - - auto paths = env.get("PATH", "").splitter(sep).map!Path; - auto res = compilers.find!(bin => paths.canFind!(p => existsFile(p ~ (bin~exe)))); - return res.empty ? compilers[0] : res.front; -} - /** Registers a new compiler handler. Note that by default `DMDCompiler`, `GDCCompiler` and `LDCCompiler` are diff --git a/source/dub/compilers/dmd.d b/source/dub/compilers/dmd.d index 4a2d868..edf23de 100644 --- a/source/dub/compilers/dmd.d +++ b/source/dub/compilers/dmd.d @@ -24,8 +24,6 @@ import std.typecons; -deprecated("Use DMDCompiler instead. Will be removed for version 1.0.0.") alias DmdCompiler = DMDCompiler; - class DMDCompiler : Compiler { private static immutable s_options = [ tuple(BuildOption.debugMode, ["-debug"]), diff --git a/source/dub/compilers/gdc.d b/source/dub/compilers/gdc.d index 10cc753..22aef92 100644 --- a/source/dub/compilers/gdc.d +++ b/source/dub/compilers/gdc.d @@ -24,8 +24,6 @@ import std.typecons; -deprecated("Use GDCCompiler instead. Will be removed for version 1.0.0.") alias GdcCompiler = GDCCompiler; - class GDCCompiler : Compiler { private static immutable s_options = [ tuple(BuildOption.debugMode, ["-fdebug"]), diff --git a/source/dub/compilers/ldc.d b/source/dub/compilers/ldc.d index 341ae9a..562edb1 100644 --- a/source/dub/compilers/ldc.d +++ b/source/dub/compilers/ldc.d @@ -24,8 +24,6 @@ import std.typecons; -deprecated("Use LDCCompiler instead. Will be removed for version 1.0.0.") alias LdcCompiler = LDCCompiler; - class LDCCompiler : Compiler { private static immutable s_options = [ tuple(BuildOption.debugMode, ["-d-debug"]), diff --git a/source/dub/dependency.d b/source/dub/dependency.d index 7a003af..3aa7c87 100644 --- a/source/dub/dependency.d +++ b/source/dub/dependency.d @@ -62,11 +62,6 @@ /// An invalid dependency (with no possible version matches). static @property Dependency invalid() { Dependency ret; ret.m_versA = Version.maxRelease; ret.m_versB = Version.minRelease; return ret; } - deprecated("Use .any instead. Will be removed for version 1.0.0.") - alias ANY = any; - deprecated("Use .invalid instead. Will be removed for version 1.0.0.") - alias INVALID = invalid; - /** Constructs a new dependency specification from a string See the `versionSpec` property for a description of the accepted @@ -120,10 +115,6 @@ return m_versA; } - /// Compatibility alias - deprecated("Use versionSpec instead. Will be removed for version 1.0.0.") - alias versionString = versionSpec; - /** Sets/gets the matching version range as a specification string. The acceptable forms for this string are as follows: @@ -651,19 +642,6 @@ static @property Version masterBranch() { return Version(masterString); } static @property Version unknown() { return Version(UNKNOWN_VERS); } - deprecated("Use minRelease instead. Will be removed for version 1.0.0.") - static @property RELEASE() { return Version("0.0.0"); } - deprecated("Use maxRelease instead. Will be removed for version 1.0.0.") - static @property HEAD() { return Version(MAX_VERS); } - deprecated("Use masterBranch instead. Will be removed for version 1.0.0.") - static @property MASTER() { return Version(MASTER_STRING); } - deprecated("Use unknown instead. Will be removed for version 1.0.0.") - static @property UNKNOWN() { return Version(UNKNOWN_VERS); } - deprecated("Use masterBranch.toString() instead. Will be removed for version 1.0.0.") - static @property MASTER_STRING() { return masterString; } - deprecated("Will be removed for version 1.0.0.") - static @property BRANCH_IDENT() { return branchPrefix; } - /** Constructs a new `Version` from its string representation. */ this(string vers) diff --git a/source/dub/description.d b/source/dub/description.d index 35e80ea..c4596a0 100644 --- a/source/dub/description.d +++ b/source/dub/description.d @@ -20,7 +20,6 @@ */ struct ProjectDescription { string rootPackage; /// Name of the root package being built - @ignore deprecated("Use rootPackage instead. Will be removed for version 1.0.0.") alias mainPackage = rootPackage; /// Compatibility alias string configuration; /// Name of the selected build configuration string buildType; /// Name of the selected build type string compiler; /// Canonical name of the compiler used (e.g. "dmd", "gdc" or "ldc") @@ -120,7 +119,6 @@ */ struct SourceFileDescription { @byName SourceFileRole role; /// Main role this file plays in the build process - @ignore deprecated("Use role instead. Will be removed for version 1.0.0.") alias type = role; /// Compatibility alias string path; /// Full path to the file } diff --git a/source/dub/dub.d b/source/dub/dub.d index 154dddf..d2242de 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -154,13 +154,6 @@ m_packageManager = new PackageManager(m_userDubPath, m_systemDubPath); updatePackageSearchPath(); } - /// ditto - deprecated("Will be removed for version 1.0.0.") - this(PackageSupplier[] additional_package_suppliers = null, string root_path = ".", - SkipPackageSuppliers skip_registry = SkipPackageSuppliers.none) - { - this(root_path, additional_package_suppliers, skip_registry); - } /** Initializes the instance with a single package search path, without loading a package. @@ -231,12 +224,6 @@ */ @property string defaultCompiler() const { return m_defaultCompiler; } - deprecated("Will be removed for version 1.0.0.") void shutdown() {} - deprecated("Will be removed for version 1.0.0.") void cleanCaches() {} - - deprecated("Use loadPackage instead. Will be removed for version 1.0.0.") - alias loadPackageFromCwd = loadPackage; - /** Loads the package that resides within the configured `rootPath`. */ void loadPackage() @@ -509,36 +496,6 @@ generator.generate(settings); } - /// Outputs a JSON description of the project, including its dependencies. - deprecated("Will be removed for version 1.0.0.") void describeProject(BuildPlatform platform, string config) - { - import std.stdio; - auto desc = m_project.describe(platform, config); - writeln(desc.serializeToPrettyJson()); - } - - /** Prints a list of all import paths necessary for building the root package. - */ - deprecated("Will be removed for version 1.0.0.") void listImportPaths(BuildPlatform platform, string config, string buildType, bool nullDelim) - { - import std.stdio; - - foreach(path; m_project.listImportPaths(platform, config, buildType, nullDelim)) { - writeln(path); - } - } - - /** Prints a list of all string import paths necessary for building the root package. - */ - deprecated("Will be removed for version 1.0.0.") void listStringImportPaths(BuildPlatform platform, string config, string buildType, bool nullDelim) - { - import std.stdio; - - foreach(path; m_project.listStringImportPaths(platform, config, buildType, nullDelim)) { - writeln(path); - } - } - /** Prints the specified build settings necessary for building the root package. */ void listProjectData(GeneratorSettings settings, string[] requestedData, ListBuildSettingsFormat list_type) @@ -566,20 +523,6 @@ write(data.joiner(delimiter)); if (delimiter != "\0\0") writeln(); } - deprecated("Use the overload taking GeneratorSettings instead. Will be removed for version 1.0.0.") - void listProjectData(BuildPlatform platform, string config, string buildType, - string[] requestedData, Compiler formattingCompiler, bool null_delim) - { - GeneratorSettings settings; - settings.platform = platform; - settings.compiler = formattingCompiler; - settings.config = config; - settings.buildType = buildType; - ListBuildSettingsFormat lt; - with (ListBuildSettingsFormat) - lt = formattingCompiler ? (null_delim ? commandLineNul : commandLine) : (null_delim ? listNul : list); - listProjectData(settings, requestedData, lt); - } /// Cleans intermediate/cache files of the given package void cleanPackage(Path path) @@ -593,10 +536,6 @@ if (existsFile(path ~ ".dub/obj")) rmdirRecurse((path ~ ".dub/obj").toNativeString()); } - - /// Returns all cached packages as a "packageId" = "version" associative array - deprecated("Will be removed for version 1.0.0.") string[string] cachedPackages() const { return m_project.cachedPackagesIDs; } - /// Fetches the package matching the dependency and places it in the specified location. Package fetch(string packageId, const Dependency dep, PlacementLocation location, FetchOptions options, string reason = "") { @@ -1055,10 +994,6 @@ private Path makeAbsolute(string p) const { return makeAbsolute(Path(p)); } } -deprecated("Will be removed for version 1.0.0.") alias determineModuleName = dub.internal.utils.determineModuleName; -deprecated("Will be removed for version 1.0.0.") alias getModuleNameFromContent = dub.internal.utils.getModuleNameFromContent; -deprecated("Will be removed for version 1.0.0.") alias getModuleNameFromFile = dub.internal.utils.getModuleNameFromFile; - /// Option flags for `Dub.fetch` enum FetchOptions @@ -1089,9 +1024,6 @@ all /// Uses only manually specified package suppliers. } -deprecated("Use SkipPackageSuppliers instead. Will be removed for version 1.0.0.") -alias SkipRegistry = SkipPackageSuppliers; - private class DependencyVersionResolver : DependencyResolver!(Dependency, Dependency) { protected { Dub m_dub; diff --git a/source/dub/generators/generator.d b/source/dub/generators/generator.d index 818c998..cb82072 100644 --- a/source/dub/generators/generator.d +++ b/source/dub/generators/generator.d @@ -228,6 +228,8 @@ private string[] downwardsInheritSettings(string target, TargetInfo[string] targets, in BuildSettings root_settings) { + import dub.internal.utils : stripDlangSpecialChars; + auto ti = &targets[target]; ti.buildSettings.addVersions(root_settings.versions); ti.buildSettings.addDebugVersions(root_settings.debugVersions); diff --git a/source/dub/package_.d b/source/dub/package_.d index df986ac..49dc122 100644 --- a/source/dub/package_.d +++ b/source/dub/package_.d @@ -66,37 +66,6 @@ Package m_parentPackage; } - /** Constructs a `Package` using a package that is physically present on the local file system. - - Params: - root = The directory in which the package resides. - recipe_file = Optional path to the package recipe file. If left - empty, the `root` directory will be searched for a recipe file. - parent = Reference to the parent package, if the new package is a - sub package. - version_override = Optional version to associate to the package - instead of the one declared in the package recipe, or the one - determined by invoking the VCS (GIT currently). - */ - deprecated("Use load() instead. Will be removed for version 1.0.0.") - this(Path root, Path recipe_file = Path.init, Package parent = null, string version_override = "") - { - import dub.recipe.io; - - if (recipe_file.empty) recipe_file = findPackageFile(root); - - enforce(!recipe_file.empty, - "No package file found in %s, expected one of %s" - .format(root.toNativeString(), - packageInfoFiles.map!(f => cast(string)f.filename).join("/"))); - - m_infoFile = recipe_file; - - auto recipe = readPackageRecipe(m_infoFile, parent ? parent.name : null); - - this(recipe, root, parent, version_override); - } - /** Constructs a `Package` using an in-memory package recipe. Params: @@ -234,38 +203,6 @@ @property Path recipePath() const { return m_infoFile; } - deprecated("Use .version_.toString() instead. Will be removed for version 1.0.0.") - @property string vers() const { return m_parentPackage ? m_parentPackage.vers : m_info.version_; } - - deprecated("Use .version instead. Will be removed for version 1.0.0.") - @property Version ver() const { return Version(this.vers); } - deprecated("Use .version instead. Will be removed for version 1.0.0.") - @property void ver(Version ver) { assert(m_parentPackage is null); m_info.version_ = ver.toString(); } - - deprecated("Use .recipe instead. Will be removed for version 1.0.0.") - @property ref inout(PackageRecipe) info() inout { return m_info; } - - deprecated("Use .recipePath instead. Will be removed for version 1.0.0.") - @property Path packageInfoFilename() const { return m_infoFile; } - - /** Returns a list of all possible dependencies of the package. - - This list includes all dependencies of all configurations. If different - configurations have a dependency to the same package, but with differing - version specifications, only one of them will be returned. Which one - is returned is undefined behavior. - - See_Also: `getAllDependencies` - */ - deprecated("Use getAllDependencies instead. Will be removed for version 1.0.0.") - @property const(Dependency[string]) dependencies() - const { - Dependency[string] ret; - foreach (d; getAllDependencies()) - ret[d.name] = d.spec; - return ret; - } - /** Returns the base package of this package. The base package is the root of the sub package hierarchy (i.e. the @@ -521,23 +458,6 @@ return ret.data; } - - /** Human readable information of this package and its dependencies. - - This will return the name and version of this package, as well as of all - root dependencies. - */ - deprecated("Will be removed for version 1.0.0.") - string generateInfoString() - const { - string s; - s ~= m_info.name ~ ", version '" ~ m_info.version_ ~ "'"; - s ~= "\n Dependencies:"; - foreach(PackageDependency d; this.getAllDependencies()) - s ~= "\n " ~ d.name ~ ", version '" ~ d.spec.toString() ~ "'"; - return s; - } - /** Determines if the package has a dependency to a certain package. Params: @@ -666,13 +586,6 @@ return ret; } - // ditto - deprecated("Will be removed for version 1.0.0.") void describe(ref Json dst, BuildPlatform platform, string config) - { - auto res = describe(platform, config); - foreach (string key, value; res.serializeToJson()) - dst[key] = value; - } private void fillWithDefaults() { diff --git a/source/dub/packagesupplier.d b/source/dub/packagesupplier.d index a1cfe71..877422b 100644 --- a/source/dub/packagesupplier.d +++ b/source/dub/packagesupplier.d @@ -60,9 +60,6 @@ */ void fetchPackage(Path path, string package_id, Dependency dep, bool pre_release); - deprecated("Use fetchPackage instead. Will be removed for version 1.0.0.") - alias retrievePackage = fetchPackage; - /** Retrieves only the recipe of a particular package. Params: @@ -73,9 +70,6 @@ */ Json fetchPackageRecipe(string package_id, Dependency dep, bool pre_release); - deprecated("Use fetchPackageRecipe instead. Will be removed for version 1.0.0.") - alias getPackageDescription = fetchPackageRecipe; - /** Searches for packages matching the given search query term. Search queries are currently a simple list of words separated by diff --git a/source/dub/project.d b/source/dub/project.d index 8c329f4..06c2725 100644 --- a/source/dub/project.d +++ b/source/dub/project.d @@ -97,27 +97,6 @@ reinit(); } - /// Gathers information - deprecated("Will be removed for version 1.0.0.") @property string info() - const { - if(!m_rootPackage) - return "-Unrecognized application in '"~m_rootPackage.path.toNativeString()~"' (probably no dub.json in this directory)"; - string s = "-Application identifier: " ~ m_rootPackage.name; - s ~= "\n" ~ m_rootPackage.generateInfoString(); - s ~= "\n-Retrieved dependencies:"; - foreach(p; m_dependencies) - s ~= "\n" ~ p.generateInfoString(); - return s; - } - - /// Gets all retrieved packages as a "packageId" = "version" associative array - deprecated("Will be removed for version 1.0.0.") @property string[string] cachedPackagesIDs() const { - string[string] pkgs; - foreach(p; m_dependencies) - pkgs[p.name] = p.version_.toString(); - return pkgs; - } - /** List of all resolved dependencies. This includes all direct and indirect dependencies of all configurations @@ -623,19 +602,6 @@ } } - /// Determines if the given dependency is already indirectly referenced by other dependencies of pack. - deprecated("Will be removed for version 1.0.0.") bool isRedundantDependency(in Package pack, in Package dependency) - const { - foreach (dep; pack.recipe.dependencies.byKey) { - auto dp = getDependency(dep, true); - if (!dp) continue; - if (dp is dependency) continue; - foreach (ddp; getTopologicalPackageList(false, dp)) - if (ddp is dependency) return true; - } - return false; - } - /// Outputs a build description of the project, including its dependencies. ProjectDescription describe(GeneratorSettings settings) { @@ -674,24 +640,6 @@ return ret; } - /// ditto - deprecated("Will be removed for version 1.0.0.") void describe(ref Json dst, BuildPlatform platform, string config) - { - auto desc = describe(platform, config); - foreach (string key, value; desc.serializeToJson()) - dst[key] = value; - } - /// ditto - deprecated("Use the overload taking a GeneratorSettings instance. Will be removed for version 1.0.0.") - ProjectDescription describe(BuildPlatform platform, string config, string build_type = null) - { - GeneratorSettings settings; - settings.platform = platform; - settings.compiler = getCompiler(platform.compilerBinary); - settings.config = config; - settings.buildType = build_type; - return describe(settings); - } private string[] listBuildSetting(string attributeName)(BuildPlatform platform, string config, ProjectDescription projectDescription, Compiler compiler, bool disableEscaping) @@ -1012,35 +960,6 @@ } } - deprecated("Use the overload taking a GeneratorSettings instance instead. Will be removed for version 1.0.0.") - string[] listBuildSettings(BuildPlatform platform, string config, string buildType, - string[] requestedData, Compiler formattingCompiler, bool nullDelim) - { - GeneratorSettings settings; - settings.platform = platform; - settings.config = config; - settings.buildType = buildType; - settings.compiler = formattingCompiler; - ListBuildSettingsFormat listtype; - with (ListBuildSettingsFormat) - listtype = formattingCompiler ? (nullDelim ? commandLineNul : commandLine) : (nullDelim ? listNul : list); - return listBuildSettings(settings, requestedData, listtype); - } - - /// Outputs the import paths for the project, including its dependencies. - deprecated("Will be removed for version 1.0.0.") string[] listImportPaths(BuildPlatform platform, string config, string buildType, bool nullDelim) - { - auto projectDescription = describe(platform, config, buildType); - return listBuildSetting!"importPaths"(platform, config, projectDescription, null, nullDelim); - } - - /// Outputs the string import paths for the project, including its dependencies. - deprecated("Will be removed for version 1.0.0.") string[] listStringImportPaths(BuildPlatform platform, string config, string buildType, bool nullDelim) - { - auto projectDescription = describe(platform, config, buildType); - return listBuildSetting!"stringImportPaths"(platform, config, projectDescription, null, nullDelim); - } - /** Saves the currently selected dependency versions to disk. The selections will be written to a file named @@ -1141,70 +1060,6 @@ } -/// Actions to be performed by the dub -deprecated("Will be removed for version 1.0.0.") struct Action { - enum Type { - fetch, - remove, - conflict, - failure - } - - immutable { - Type type; - string packageId; - PlacementLocation location; - Dependency vers; - Version existingVersion; - } - const Package pack; - const Dependency[string] issuer; - - static Action get(string pkg, PlacementLocation location, in Dependency dep, Dependency[string] context, Version old_version = Version.unknown) - { - return Action(Type.fetch, pkg, location, dep, context, old_version); - } - - static Action remove(Package pkg, Dependency[string] context) - { - return Action(Type.remove, pkg, context); - } - - static Action conflict(string pkg, in Dependency dep, Dependency[string] context) - { - return Action(Type.conflict, pkg, PlacementLocation.user, dep, context); - } - - static Action failure(string pkg, in Dependency dep, Dependency[string] context) - { - return Action(Type.failure, pkg, PlacementLocation.user, dep, context); - } - - private this(Type id, string pkg, PlacementLocation location, in Dependency d, Dependency[string] issue, Version existing_version = Version.unknown) - { - this.type = id; - this.packageId = pkg; - this.location = location; - this.vers = d; - this.issuer = issue; - this.existingVersion = existing_version; - } - - private this(Type id, Package pkg, Dependency[string] issue) - { - pack = pkg; - type = id; - packageId = pkg.name; - vers = cast(immutable)Dependency(pkg.version_); - issuer = issue; - } - - string toString() const { - return to!string(type) ~ ": " ~ packageId ~ ", " ~ to!string(vers); - } -} - - /// Indicates where a package has been or should be placed to. enum PlacementLocation { /// Packages retrieved with 'local' will be placed in the current folder @@ -1315,10 +1170,6 @@ throw new Exception("Invalid variable: "~name); } -deprecated("Will be removed for version 1.0.0.") string stripDlangSpecialChars(string s) -{ - return dub.internal.utils.stripDlangSpecialChars(s); -} /** Holds and stores a set of version selections for package dependencies. diff --git a/source/dub/recipe/packagerecipe.d b/source/dub/recipe/packagerecipe.d index 10c9734..300c584 100644 --- a/source/dub/recipe/packagerecipe.d +++ b/source/dub/recipe/packagerecipe.d @@ -87,18 +87,6 @@ SubPackage[] subPackages; - deprecated("Use Package.dependencies or the dependencies of the individual BuildSettingsTemplates instead. Will be removed for version 1.0.0.") - @property const(Dependency)[string] dependencies() - const { - Dependency[string] ret; - foreach (n, d; this.buildSettings.dependencies) - ret[n] = d; - foreach (ref c; configurations) - foreach (n, d; c.buildSettings.dependencies) - ret[n] = d; - return ret; - } - inout(ConfigurationInfo) getConfiguration(string name) inout { foreach (c; configurations)