digitalmars.D.learn - dub import local D package
- data pulverizer (28/28) Apr 20 2022 Hi all,
- Steven Schveighoffer (6/39) Apr 20 2022 Did you substitute something real with `...` to hide it from your post?
- data pulverizer (3/5) Apr 20 2022 I used it to hide my actual paths.
- Steven Schveighoffer (8/14) Apr 20 2022 OK, so reviewing with that in mind, it looks like you're trying to
- data pulverizer (4/9) Apr 21 2022 Yes, looks like that it works if I change to `import
Hi all, I'm trying to import a local dub package into a dub project (`json` format). I have added the package I'm trying to import with `dub add-local` and `dub add-path` and including it within the json file, but I get the error ``` $ dub build Performing "debug" build using /.../ldc2/bin/ldc2 for x86_64. myPackageName 0.1.0: target for configuration "library" is up to date. test ~master: building configuration "application"... source/app.d(1,8): Error: module `mymodule` is in file 'myPackageName/modules/mymodule.d' which cannot be read import path[0] = source/ import path[1] = ../myPackageName/source/ import path[2] = /.../ldc2/bin/../import /.../ldc2/bin/ldc2 failed with exit code 1. ``` The dependencies in the dub.json file looks like this: ``` "dependencies": { "myPackageName": { "path": "/.../myPackageName", "version": "0.1.0" } } ``` Thanks in advance
Apr 20 2022
On 4/20/22 7:39 PM, data pulverizer wrote:Hi all, I'm trying to import a local dub package into a dub project (`json` format). I have added the package I'm trying to import with `dub add-local` and `dub add-path` and including it within the json file, but I get the error ``` $ dub build Performing "debug" build using /.../ldc2/bin/ldc2 for x86_64. myPackageName 0.1.0: target for configuration "library" is up to date. test ~master: building configuration "application"... source/app.d(1,8): Error: module `mymodule` is in file 'myPackageName/modules/mymodule.d' which cannot be read import path[0] = source/ import path[1] = ../myPackageName/source/ import path[2] = /.../ldc2/bin/../import /.../ldc2/bin/ldc2 failed with exit code 1. ``` The dependencies in the dub.json file looks like this: ``` "dependencies": { "myPackageName": { "path": "/.../myPackageName", "version": "0.1.0" } } ``` Thanks in advanceDid you substitute something real with `...` to hide it from your post? Because that's not a real path. Note that if you use path dependencies, you do not have to dub add-local the package. -Steve
Apr 20 2022
On Thursday, 21 April 2022 at 00:14:16 UTC, Steven Schveighoffer wrote:Did you substitute something real with `...` to hide it from your post? Because that's not a real path.I used it to hide my actual paths.
Apr 20 2022
On 4/20/22 9:53 PM, data pulverizer wrote:On Thursday, 21 April 2022 at 00:14:16 UTC, Steven Schveighoffer wrote:OK, so reviewing with that in mind, it looks like you're trying to import `myPackage.modules.mymodule`, but the file `../myPackageName/source/myPackageName/modules/mymodule.d` doesn't exist. Is there one too many "myPackageName" packages here? There also could be a typo somewhere, but that is masked by the fact that you substituted all the real names with these fake ones. -SteveDid you substitute something real with `...` to hide it from your post? Because that's not a real path.I used it to hide my actual paths.
Apr 20 2022
On Thursday, 21 April 2022 at 03:59:26 UTC, Steven Schveighoffer wrote:OK, so reviewing with that in mind, it looks like you're trying to import `myPackage.modules.mymodule`, but the file `../myPackageName/source/myPackageName/modules/mymodule.d` doesn't exist. Is there one too many "myPackageName" packages here?Yes, looks like that it works if I change to `import modules.mymodule;`.
Apr 21 2022