www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - [dub] specify dependency configuration

reply "cal" <callumenator gmail.com> writes:
Given myapp and a dependency, specified by dub.json's:

myapp: dub.json
{
   ...
   "dependencies": {
     "dependency_a": ">=0.6.0"		
   }
   ...
}

dependency_a: dub.json
{
   ...
   "configurations": [
   {
     "name": "config_a",
     "targetType": "library",
     ...
   },
   {
     "name": "config_b",
     "targetType": "executable",
     ...
   },
   ...
}

How do I specify (in myapp: dub.json) that I want the "config_a" 
configuration of dependency_a?
Jan 18 2015
parent reply Rikki Cattermole <alphaglosined gmail.com> writes:
On 19/01/2015 1:59 p.m., cal wrote:
 Given myapp and a dependency, specified by dub.json's:

 myapp: dub.json
 {
    ...
    "dependencies": {
      "dependency_a": ">=0.6.0"
    }
    ...
 }

 dependency_a: dub.json
 {
    ...
    "configurations": [
    {
      "name": "config_a",
      "targetType": "library",
      ...
    },
    {
      "name": "config_b",
      "targetType": "executable",
      ...
    },
    ...
 }

 How do I specify (in myapp: dub.json) that I want the "config_a"
 configuration of dependency_a?
I just want to verify, you are using configurations only to determine if its being built a certain way? And not lets say as a subpackage? Ignoring that, there is something called subConfigurations section. Example from: http://code.dlang.org/package-format { ... "name": "somepackage" "configurations": [ { "name": "metro-app", "targetType": "executable", "platforms": ["windows"], "versions": ["MetroApp"], "libs": ["d3d11"] }, { "name": "desktop-app", "targetType": "executable", "platforms": ["windows"], "versions": ["DesktopApp"], "libs": ["d3d9"] }, { "name": "glut-app", "targetType": "executable", "versions": ["GlutApp"] } ] } { ... "dependencies": { "somepackage": ">=1.0.0" }, "subConfigurations": { "somepackage": "glut-app" } }
Jan 18 2015
next sibling parent Rikki Cattermole <alphaglosined gmail.com> writes:
I forgot to mention dub should automatically choose the first 
configuration available if you do not specify it.
In this case that's the library one. Or atleast it should do that.
Jan 18 2015
prev sibling next sibling parent "cal" <callumenator gmail.com> writes:
On Monday, 19 January 2015 at 02:10:41 UTC, Rikki Cattermole 
wrote:
 I just want to verify, you are using configurations only to 
 determine if its being built a certain way?
 And not lets say as a subpackage?
Some dependency (that I don't control) might define for example two configurations, a sourceLibrary type and a library type (my own app does not define it's own configurations). I'm just wondering if there is a way to tell dub i'm only interested in using that dependency as a sourceLibrary for example.
Jan 18 2015
prev sibling parent "cal" <callumenator gmail.com> writes:
On Monday, 19 January 2015 at 02:10:41 UTC, Rikki Cattermole 
wrote:
 	"subConfigurations": {
 		"somepackage": "glut-app"
 	}
 }
Ahh I guess this is it, thanks for that!
Jan 18 2015