From 6bfbead1b82af50b620fb1caa6612c82bfc2ae7e Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Sat, 28 Jan 2023 00:51:31 +0100 Subject: [PATCH] Bump dub to v1.39 With inheritable dub.selections.json support. --- dub.json | 2 +- dub.selections.json | 2 +- payload/reggae/options.d | 14 +++++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dub.json b/dub.json index f2025bb9..b62a741b 100644 --- a/dub.json +++ b/dub.json @@ -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" diff --git a/dub.selections.json b/dub.selections.json index b1f8b8ba..bda8362d 100644 --- a/dub.selections.json +++ b/dub.selections.json @@ -1,7 +1,7 @@ { "fileVersion": 1, "versions": { - "dub": "1.38.0", + "dub": "1.39.0-beta.1", "unit-threaded": "2.2.0" } } diff --git a/payload/reggae/options.d b/payload/reggae/options.d index 153572ae..8fa614ae 100644 --- a/payload/reggae/options.d +++ b/payload/reggae/options.d @@ -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;