File tree 2 files changed +26
-1
lines changed
2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ license "MIT"
7
7
dependency "dfmt" version="~>0.15.0"
8
8
dependency "inifiled" version="1.3.3"
9
9
dependency "serve-d:dcd" path=".."
10
+ # we can't upgrade to 1.34.0 yet! PR https://github.com/dlang/dub/pull/2703 must
11
+ # be merged first to avoid a regression with building that cannot stabily be
12
+ # fixed without hardcoding DUB paths into the code here.
10
13
dependency "dub" version="1.33.1"
11
14
dependency "emsi_containers" version="0.9.0"
12
15
dependency "dscanner" version="~>0.16.0-beta.1"
Original file line number Diff line number Diff line change @@ -264,7 +264,26 @@ class DubComponent : ComponentWrapper
264
264
debugVersions ~= target.buildSettings.debugVersions;
265
265
}
266
266
267
- _importPaths = importPaths.data;
267
+ string [] rootSourcePaths;
268
+ if (auto rootTargetIndex = _dub.projectName in gen.targetDescriptionLookup)
269
+ {
270
+ auto rootTarget = gen.targetDescriptions[* rootTargetIndex];
271
+ // upstream PR: https://github.com/dlang/dub/pull/2704
272
+ static if (__traits(hasMember, rootTarget.buildSettings, " specifiedSourcePaths" ))
273
+ {
274
+ pragma (msg,
275
+ " \n\n\n\n\n\n\n TODO: remove this message and the `static if` around this code, this change made it into DUB now and we upgraded!\n\n "
276
+ ~ __FILE__ ~ " :" ~ __LINE__ .stringof
277
+ ~ " \n\n\n\n\n\n\n " );
278
+
279
+ // adds the specified `sourcePaths` of the current package (only) as import paths for DCD
280
+ foreach (sourcePath; rootTarget.buildSettings.specifiedSourcePaths)
281
+ if (! rootTarget.buildSettings.importPaths.canFind(sourcePath))
282
+ rootSourcePaths ~= sourcePath;
283
+ }
284
+ }
285
+
286
+ _importPaths = rootSourcePaths ~ importPaths.data;
268
287
_stringImportPaths = stringImportPaths.data;
269
288
_importFiles = sourceFiles.data;
270
289
_versions = versions.data;
@@ -280,6 +299,9 @@ class DubComponent : ComponentWrapper
280
299
e.toString);
281
300
_importPaths = [];
282
301
_stringImportPaths = [];
302
+ _importFiles = [];
303
+ _versions = [];
304
+ _debugVersions = [];
283
305
return false ;
284
306
}
285
307
}
You can’t perform that action at this time.
0 commit comments