Skip to content

Commit

Permalink
Bump dub to v1.39
Browse files Browse the repository at this point in the history
With inheritable dub.selections.json support.
  • Loading branch information
kinke committed Jul 11, 2024
1 parent 6d46389 commit 6bfbead
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"mainSourceFile": "src/reggae/reggae_main.d",
"preGenerateCommands": ["rdmd $PACKAGE_DIR/list_payload.d $PACKAGE_DIR"],
"dependencies": {
"dub": "~>1.38.0"
"dub": "~>1.39.0"
},
"subConfigurations": {
"dub": "library"
Expand Down
2 changes: 1 addition & 1 deletion dub.selections.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"fileVersion": 1,
"versions": {
"dub": "1.38.0",
"dub": "1.39.0-beta.1",
"unit-threaded": "2.2.0"
}
}
14 changes: 13 additions & 1 deletion payload/reggae/options.d
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,20 @@ struct Options {
maybeDubDeps ~= _dubProjectFile;

const selectionsJsonPath = buildPath(projectPath, "dub.selections.json");
if (selectionsJsonPath.exists)
if (selectionsJsonPath.exists) {
maybeDubDeps ~= selectionsJsonPath;
} else version(Have_dub) {
import dub.packagemanager: PackageManager;
import dub.internal.vibecompat.inet.path: NativePath;

() @trusted {
auto projectRoot = NativePath(projectPath);
auto pm = new PackageManager(projectRoot);
const res = pm.readSelections(projectRoot);
if (!res.isNull())
maybeDubDeps ~= res.get().absolutePath.toNativeString();
}();
}
}

return ranFromPath ~ maybeReggaeFile ~ maybeReggaeFileDeps ~ maybeDubDeps ~ dependencies;
Expand Down

0 comments on commit 6bfbead

Please sign in to comment.