Thread overview
[dub] specify dependency configuration
Jan 19, 2015
cal
Jan 19, 2015
Rikki Cattermole
Jan 19, 2015
Rikki Cattermole
Jan 19, 2015
cal
Jan 19, 2015
cal
January 19, 2015
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?
January 19, 2015
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"
	}
}
January 19, 2015
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.
January 19, 2015
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.
January 19, 2015
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!