Skip to content

Commit

Permalink
Symmetry: Use and adapt to custom dub with inheritable dub.selections…
Browse files Browse the repository at this point in the history
….json support

See https://github.com/symmetryinvestments/dub/commits/sym-1.37.x/,
also including an important tweak for LDC related to symbol visibility
on Windows.
  • Loading branch information
kinke committed Feb 8, 2024
1 parent f177ea1 commit 2a57670
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
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.36.0",
"dub": {"repository":"git+https://github.com/symmetryinvestments/dub.git","version":"f4e32c8c4c470fd3b17369752edf93922d0db90e"},
"unit-threaded": "2.1.7"
}
}
12 changes: 11 additions & 1 deletion payload/reggae/options.d
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,18 @@ 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.project: lookupAndParseSelectionsFile;
import dub.internal.vibecompat.inet.path: NativePath;

() @trusted {
const res = lookupAndParseSelectionsFile(NativePath(projectPath));
if (!res.isNull())
maybeDubDeps ~= res.get().absolutePath.toNativeString();
}();
}
}

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

0 comments on commit 2a57670

Please sign in to comment.