diff --git a/source/dub/generators/build.d b/source/dub/generators/build.d index c893fb097..d3cc65cf3 100644 --- a/source/dub/generators/build.d +++ b/source/dub/generators/build.d @@ -766,15 +766,17 @@ unittest { } unittest { // issue #1235 - pass no library files to compiler command line when building a static lib - import dub.internal.vibecompat.data.json : parseJsonString; + import dub.recipe.io : parsePackageRecipe; import dub.compilers.gdc : GDCCompiler; import dub.platform : determinePlatform; version (Windows) auto libfile = "bar.lib"; else auto libfile = "bar.a"; - auto desc = parseJsonString(`{"name": "test", "targetType": "library", "sourceFiles": ["foo.d", "`~libfile~`"]}`); - auto pack = new Package(desc, NativePath("/tmp/fooproject")); + auto recipe = parsePackageRecipe( + `{"name":"test", "targetType":"library", "sourceFiles":["foo.d", "`~libfile~`"]}`, + `/tmp/fooproject/dub.json`); + auto pack = new Package(recipe, NativePath("/tmp/fooproject")); auto pman = new PackageManager(pack.path, NativePath("/tmp/foo/"), NativePath("/tmp/foo/"), false); auto prj = new Project(pman, pack); diff --git a/source/dub/generators/generator.d b/source/dub/generators/generator.d index 7402438be..c112cc4be 100644 --- a/source/dub/generators/generator.d +++ b/source/dub/generators/generator.d @@ -1225,7 +1225,7 @@ private void storeRecursiveInvokations(ref const(string[string])[] env, string[] version(Posix) { // https://github.com/dlang/dub/issues/2238 unittest { - import dub.internal.vibecompat.data.json : parseJsonString; + import dub.recipe.io : parsePackageRecipe; import dub.compilers.gdc : GDCCompiler; import std.algorithm : canFind; import std.path : absolutePath; @@ -1235,8 +1235,10 @@ version(Posix) { write("dubtest/preGen/source/foo.d", ""); scope(exit) rmdirRecurse("dubtest"); - auto desc = parseJsonString(`{"name": "test", "targetType": "library", "preGenerateCommands": ["touch $PACKAGE_DIR/source/bar.d"]}`); - auto pack = new Package(desc, NativePath("dubtest/preGen".absolutePath)); + auto recipe = parsePackageRecipe( + `{"name":"test", "targetType":"library", "preGenerateCommands":["touch $PACKAGE_DIR/source/bar.d"]}`, + `dubtest/preGen/dub.json`); + auto pack = new Package(recipe, NativePath("dubtest/preGen".absolutePath)); auto pman = new PackageManager(pack.path, NativePath("/tmp/foo/"), NativePath("/tmp/foo/"), false); auto prj = new Project(pman, pack);