diff --git a/README.md b/README.md index d8be752..ccbe0f0 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ DUB emerged as a more general replacement for [vibe.d's](http://vibed.org/) package manager. It does not imply a dependecy to vibe.d for packages and was extended to not only directly build projects, but also to generate project files (currently [VisualD](https://github.com/rainers/visuald) and [Mono-D](http://mono-d.alexanderbothe.com/)). -The project's philosophy is to keep things as simple as possible. All that is needed to make a project a dub package is to write a short [package.json](http://code.dlang.org/publish) file and put the source code into a `source` subfolder. It *can* then be registered on the public [package registry](http://code.dlang.org) to be made available for everyone. Any dependencies specified in `package.json` are automatically downloaded and made available to the project during the build process. +The project's philosophy is to keep things as simple as possible. All that is needed to make a project a dub package is to write a short [dub.json](http://code.dlang.org/publish) file and put the source code into a `source` subfolder. It *can* then be registered on the public [package registry](http://code.dlang.org) to be made available for everyone. Any dependencies specified in `dub.json` are automatically downloaded and made available to the project during the build process. Key features diff --git a/dub.json b/dub.json new file mode 100644 index 0000000..20668d3 --- /dev/null +++ b/dub.json @@ -0,0 +1,37 @@ +{ + "name": "dub", + "description": "Package manager for D packages", + "license": "MIT", + "copyright": "Copyright © 2012-2014 rejectedsoftware e.K., Copyright © 2012-2014 Matthias Dondorff", + "authors": [ + "Matthias Dondorff", + "Sönke Ludwig" + ], + "targetPath": "bin", + "configurations": [ + { + "name": "application", + "targetType": "executable", + "mainSourceFile": "source/app.d", + "libs": ["curl"], + "copyFiles-windows": ["curllib.dll", "libeay32.dll", "openldap.dll", "ssleay32.dll"], + "versions": ["DubUseCurl"] + }, + { + "name": "library", + "targetType": "library", + "excludedSourceFiles": ["source/app.d"], + "libs": ["curl"], + "copyFiles-windows": ["curllib.dll", "libeay32.dll", "openldap.dll", "ssleay32.dll"], + "versions": ["DubUseCurl"] + }, + { + "name": "library-nonet", + "targetType": "library", + "dependencies": { + "vibe-d": {"version": "~>0.7.19-rc.4", "optional": true} + }, + "excludedSourceFiles": ["source/app.d"] + } + ] +} \ No newline at end of file diff --git a/examples/app/dub.json b/examples/app/dub.json new file mode 100644 index 0000000..7265230 --- /dev/null +++ b/examples/app/dub.json @@ -0,0 +1,4 @@ +{ + "name": "app-example", + "description": "A simple D application" +} diff --git a/examples/app/package.json b/examples/app/package.json deleted file mode 100644 index 7265230..0000000 --- a/examples/app/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "app-example", - "description": "A simple D application" -} diff --git a/examples/header-lib/dub.json b/examples/header-lib/dub.json new file mode 100644 index 0000000..671749b --- /dev/null +++ b/examples/header-lib/dub.json @@ -0,0 +1,6 @@ +{ + "name": "header-lib-example", + "description": "A simple D header library (C binding to libmylib.so)", + "targetType": "sourceLibrary", + "libs": ["mylib"] +} diff --git a/examples/header-lib/package.json b/examples/header-lib/package.json deleted file mode 100644 index 671749b..0000000 --- a/examples/header-lib/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "header-lib-example", - "description": "A simple D header library (C binding to libmylib.so)", - "targetType": "sourceLibrary", - "libs": ["mylib"] -} diff --git a/examples/lib-user/dub.json b/examples/lib-user/dub.json new file mode 100644 index 0000000..0f358eb --- /dev/null +++ b/examples/lib-user/dub.json @@ -0,0 +1,7 @@ +{ + "name": "lib-user-example", + "description": "An application using a local library dependency", + "dependencies": { + "lib-example": {"version": "~master", "path": "../lib"} + } +} diff --git a/examples/lib-user/package.json b/examples/lib-user/package.json deleted file mode 100644 index 0f358eb..0000000 --- a/examples/lib-user/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "lib-user-example", - "description": "An application using a local library dependency", - "dependencies": { - "lib-example": {"version": "~master", "path": "../lib"} - } -} diff --git a/examples/lib/dub.json b/examples/lib/dub.json new file mode 100644 index 0000000..7fb63c3 --- /dev/null +++ b/examples/lib/dub.json @@ -0,0 +1,5 @@ +{ + "name": "lib-example", + "description": "A simple D library", + "targetType": "library" +} diff --git a/examples/lib/package.json b/examples/lib/package.json deleted file mode 100644 index 7fb63c3..0000000 --- a/examples/lib/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "lib-example", - "description": "A simple D library", - "targetType": "library" -} diff --git a/examples/mixed/dub.json b/examples/mixed/dub.json new file mode 100644 index 0000000..234ffd1 --- /dev/null +++ b/examples/mixed/dub.json @@ -0,0 +1,4 @@ +{ + "name": "mixed-example", + "description": "A package usable as both, an application and a library" +} diff --git a/examples/mixed/package.json b/examples/mixed/package.json deleted file mode 100644 index 234ffd1..0000000 --- a/examples/mixed/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "mixed-example", - "description": "A package usable as both, an application and a library" -} diff --git a/examples/vibed-main/dub.json b/examples/vibed-main/dub.json new file mode 100644 index 0000000..5c1042b --- /dev/null +++ b/examples/vibed-main/dub.json @@ -0,0 +1,8 @@ +{ + "name": "vibed-main-example", + "description": "A project using vibe.d and a custom main() function", + "dependencies": { + "vibe-d": "~master" + }, + "versions": ["VibeCustomMain"] +} diff --git a/examples/vibed-main/package.json b/examples/vibed-main/package.json deleted file mode 100644 index 5c1042b..0000000 --- a/examples/vibed-main/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "vibed-main-example", - "description": "A project using vibe.d and a custom main() function", - "dependencies": { - "vibe-d": "~master" - }, - "versions": ["VibeCustomMain"] -} diff --git a/examples/vibed/dub.json b/examples/vibed/dub.json new file mode 100644 index 0000000..befdb65 --- /dev/null +++ b/examples/vibed/dub.json @@ -0,0 +1,7 @@ +{ + "name": "vibed-example", + "description": "A project using vibe.d", + "dependencies": { + "vibe-d": "~master" + } +} diff --git a/examples/vibed/package.json b/examples/vibed/package.json deleted file mode 100644 index befdb65..0000000 --- a/examples/vibed/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "vibed-example", - "description": "A project using vibe.d", - "dependencies": { - "vibe-d": "~master" - } -} diff --git a/package.json b/package.json deleted file mode 100644 index 20668d3..0000000 --- a/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "dub", - "description": "Package manager for D packages", - "license": "MIT", - "copyright": "Copyright © 2012-2014 rejectedsoftware e.K., Copyright © 2012-2014 Matthias Dondorff", - "authors": [ - "Matthias Dondorff", - "Sönke Ludwig" - ], - "targetPath": "bin", - "configurations": [ - { - "name": "application", - "targetType": "executable", - "mainSourceFile": "source/app.d", - "libs": ["curl"], - "copyFiles-windows": ["curllib.dll", "libeay32.dll", "openldap.dll", "ssleay32.dll"], - "versions": ["DubUseCurl"] - }, - { - "name": "library", - "targetType": "library", - "excludedSourceFiles": ["source/app.d"], - "libs": ["curl"], - "copyFiles-windows": ["curllib.dll", "libeay32.dll", "openldap.dll", "ssleay32.dll"], - "versions": ["DubUseCurl"] - }, - { - "name": "library-nonet", - "targetType": "library", - "dependencies": { - "vibe-d": {"version": "~>0.7.19-rc.4", "optional": true} - }, - "excludedSourceFiles": ["source/app.d"] - } - ] -} \ No newline at end of file diff --git a/source/dub/commandline.d b/source/dub/commandline.d index aef3aa0..bb816cd 100644 --- a/source/dub/commandline.d +++ b/source/dub/commandline.d @@ -346,7 +346,7 @@ " debug (default), plain, release, release-nobounds, unittest, profile, docs, ddox, cov, unittest-cov and custom types" ]); args.getopt("c|config", &m_buildConfig, [ - "Builds the specified configuration. Configurations can be defined in package.json" + "Builds the specified configuration. Configurations can be defined in dub.json" ]); args.getopt("compiler", &m_compilerName, [ "Specifies the compiler binary to use. Arbitrary pre- and suffixes to the identifiers below are recognized (e.g. ldc2 or dmd-2.063) and matched to the proper compiler type:", @@ -493,7 +493,7 @@ "Prints the list of available configurations" ]); args.getopt("print-platform", &m_printPlatform, [ - "Prints the identifiers for the current build platform as used for the build fields in package.json" + "Prints the identifiers for the current build platform as used for the build fields in dub.json" ]); } @@ -849,9 +849,9 @@ this.argumentsPattern = ""; this.description = "Manually retrieves and caches a package"; this.helpText = [ - "Note: Use the \"dependencies\" field in the package description file (e.g. package.json) if you just want to use a certain package as a dependency, you don't have to explicitly fetch packages.", + "Note: Use the \"dependencies\" field in the package description file (e.g. dub.json) if you just want to use a certain package as a dependency, you don't have to explicitly fetch packages.", "", - "Explicit retrieval/removal of packages is only needed when you want to put packages to a place where several applications can share these. If you just have an dependency to a package, just add it to your package.json, dub will do the rest for you." + "Explicit retrieval/removal of packages is only needed when you want to put packages to a place where several applications can share these. If you just have an dependency to a package, just add it to your dub.json, dub will do the rest for you." "", "Without specified options, placement/removal will default to a user wide shared location." "", diff --git a/source/dub/compilers/compiler.d b/source/dub/compilers/compiler.d index 25e62a3..94f4767 100644 --- a/source/dub/compilers/compiler.d +++ b/source/dub/compilers/compiler.d @@ -57,7 +57,7 @@ string alternative; } static immutable SpecialFlag[] s_specialFlags = [ - {["-c", "-o-"], "Automatically issued by DUB, do not specify in package.json"}, + {["-c", "-o-"], "Automatically issued by DUB, do not specify in dub.json"}, {["-w", "-Wall", "-Werr"], `Use "buildRequirements" to control warning behavior`}, {["-property", "-fproperty"], "Using this flag may break building of dependencies and it will probably be removed from DMD in the future"}, {["-wi"], `Use the "buildRequirements" field to control warning behavior`}, diff --git a/source/dub/dub.d b/source/dub/dub.d index cbe70ca..8fe58d2 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -130,7 +130,7 @@ if (!m_rootPath.absolute) m_rootPath = Path(getcwd()) ~ m_rootPath; } - /// Returns the name listed in the package.json of the current + /// Returns the name listed in the dub.json of the current /// application. @property string projectName() const { return m_project.name; } @@ -434,7 +434,7 @@ /// Removes a given package from the list of present/cached modules. /// @removeFromApplication: if true, this will also remove an entry in the - /// list of dependencies in the application's package.json + /// list of dependencies in the application's dub.json void remove(in Package pack, bool force_remove) { logInfo("Removing %s in %s", pack.name, pack.path.toNativeString()); diff --git a/source/dub/generators/build.d b/source/dub/generators/build.d index 1da607b..fbdcfcb 100644 --- a/source/dub/generators/build.d +++ b/source/dub/generators/build.d @@ -356,7 +356,7 @@ /* NOTE: for DMD experimental separate compile/link is used, but this is not yet implemented on the other compilers. Later this should be integrated somehow in the build process - (either in the package.json, or using a command line flag) + (either in the dub.json, or using a command line flag) */ if (settings.buildMode == BuildMode.allAtOnce || settings.platform.compilerBinary != "dmd" || !generate_binary || is_static_library) { // setup for command line diff --git a/source/dub/packagemanager.d b/source/dub/packagemanager.d index 47a60ce..ae355b6 100644 --- a/source/dub/packagemanager.d +++ b/source/dub/packagemanager.d @@ -353,7 +353,7 @@ } logDiagnostic("%s file(s) copied.", to!string(countFiles)); - // overwrite package.json (this one includes a version field) + // overwrite dub.json (this one includes a version field) auto pack = new Package(destination, null, package_info["version"].get!string); if (pack.packageInfoFile.head != defaultPackageFilename()) { @@ -745,7 +745,7 @@ dst_repos ~= pack; // Additionally to the internally defined subpackages, whose metadata - // is loaded with the main package.json, load all externally defined + // is loaded with the main dub.json, load all externally defined // packages after the package is available with all the data. foreach (sub_path; pack.exportedPackages) { auto path = pack.path ~ sub_path; diff --git a/source/dub/packagesupplier.d b/source/dub/packagesupplier.d index b51d497..27be871 100644 --- a/source/dub/packagesupplier.d +++ b/source/dub/packagesupplier.d @@ -76,7 +76,7 @@ Json getPackageDescription(string packageId, Dependency dep, bool pre_release) { auto filename = bestPackageFile(packageId, dep, pre_release); - return jsonFromZip(filename, "package.json"); + return jsonFromZip(filename, "dub.json"); } private Path bestPackageFile(string packageId, Dependency dep, bool pre_release) diff --git a/source/dub/project.d b/source/dub/project.d index 25e87c3..c1916d9 100644 --- a/source/dub/project.d +++ b/source/dub/project.d @@ -84,7 +84,7 @@ @property string info() const { if(!m_rootPackage) - return "-Unrecognized application in '"~m_rootPackage.path.toNativeString()~"' (probably no package.json in this directory)"; + 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:";