RejectedSoftware Forums

Sign up

How to specify ( a global ) dependency directory for dub registry packages ( on Windows ) ?

Hi,
by default all dub registry packages specified in myProject/package.json as dependencies are downloaded into %AppData%/dub/packages, but I would prefer to have them somewhere else.
I tried this:

"dependencies": {
	"derelict-gl3"		: { "version" : "~master" , "path" : "../Dependencies/DerelictOrg" } ,
	"derelict-glfw3"	: { "version" : "~master" , "path" : "../Dependencies/DerelictOrg" }
}

in the package.json and dub build gave me this error:
"Error executing command build: Cannot open or create file 'D:\Code\DUB_Projects\Dependencies\DerelictOrg\package.json'"

I guess the location is searched for existing packages, but not getting and storing the dependencies there.
I also tried dub add-path with "../Dependiencies" and "../Dependencies/DrelictOrg", without success.

So how can I specify ( a global ) dependency path ?
Sorry if this was asked already, I couldn't find it.

Re: How to specify ( a global ) dependency directory for dub registry packages ( on Windows ) ?

Am 04.02.2014 13:45, schrieb ParticlePeter:

Hi,
by default all dub registry packages specified in myProject/package.json as dependencies are downloaded into %AppData%/dub/packages, but I would prefer to have them somewhere else.
I tried this:

"dependencies": {
	"derelict-gl3"		: { "version" : "~master" , "path" : "../Dependencies/DerelictOrg" } ,
	"derelict-glfw3"	: { "version" : "~master" , "path" : "../Dependencies/DerelictOrg" }
}

in the package.json and dub build gave me this error:
"Error executing command build: Cannot open or create file 'D:\Code\DUB_Projects\Dependencies\DerelictOrg\package.json'"

I guess the location is searched for existing packages, but not getting and storing the dependencies there.
I also tried dub add-path with "../Dependiencies" and "../Dependencies/DrelictOrg", without success.

So how can I specify ( a global ) dependency path ?
Sorry if this was asked already, I couldn't find it.

There is currently no way to override the installation target path. By
default, it will always use the "%AppData%\dub\packages" one. However,
dub fetch --local <packagename> will store in the the current
directory, so this should work:

cd C:\Code\DUB_Projects\
mkdir Dependencies
cd Dependencies
mkdir DerelictOrg
cd DerelictOrg
dub add-path .
dub fetch --local derelict-gl3 --version=~master
dub fetch --local derelict-glfw3 --version=~master
...

Alternatively, you could also use "git clone" to get the derelict
repositories, you that you can also make changes and pull requests from
there (and use "git pull" to get the latest changes instead of deleting
and running "dub fetch" again).

The "dependencies" section in your main project then also doesn't have
to explicitly mention the path for those dependencies, they will be
found automatically due to the dub add-path ..

I'll open a ticket to support customizing the default installation folder.

Re: How to specify ( a global ) dependency directory for dub registry packages ( on Windows ) ?

On Tue, 04 Feb 2014 14:19:36 +0100, Sönke Ludwig wrote:

I'll open a ticket to support customizing the default installation folder.

https://github.com/rejectedsoftware/dub/issues/229

Re: How to specify ( a global ) dependency directory for dub registry packages ( on Windows ) ?

On Tue, 04 Feb 2014 13:23:29 GMT, Sönke Ludwig wrote:

On Tue, 04 Feb 2014 14:19:36 +0100, Sönke Ludwig wrote:

I'll open a ticket to support customizing the default installation folder.

https://github.com/rejectedsoftware/dub/issues/229

Thanks, this work around will do.