www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - dub.json dependencies per configuration?

reply "Arjan" <arjan ask.me.to> writes:
Snippet from: 
https://github.com/buggins/ddbc/blob/master/dub.json#L7

ddbc has a "dependencies" on "mysql-native": ">=0.0.12". But this 
is only true for "configurations": "MySQL".
Is it allowed to put the dependency within the configuration 
section for "MySQL?.

     "dependencies": {
         "mysql-native": ">=0.0.12"
     },
     "targetPath": "lib",
     "targetType": "staticLibrary",
     "configurations": [
         {
             "name": "full",
             "versions": ["USE_MYSQL", "USE_SQLITE", "USE_PGSQL"],
             "libs-posix": ["sqlite3", "pq"],
             "libs-windows": ["sqlite3", "libpq"],
             "copyFiles-windows-x86": [ "libs/win32/sqlite3.dll", 
"libs/win32/libpq.dll", "libs/win32/intl.dll" ],
             "sourceFiles-windows-x86" : [ 
"libs/win32/sqlite3.lib", "libs/win32/libpq.lib" ]
         },
         {
             "name": "MySQL",
             "versions": ["USE_MYSQL"]
         },
         {
             "name": "SQLite",
             "versions": ["USE_SQLITE"],
             "libs-posix": ["sqlite3"],
             "libs-windows": ["sqlite3"],
             "copyFiles-windows-x86": [ "libs/win32/sqlite3.dll" ],
             "sourceFiles-windows-x86" : [ 
"libs/win32/sqlite3.lib" ]
         },
         {
             "name": "PGSQL",
             "versions": ["USE_PGSQL"],
             "libs-posix": ["pq"],
             "libs-windows": ["libpq"],
             "copyFiles-windows-x86": [ "libs/win32/libpq.dll", 
"libs/win32/intl.dll" ],
             "sourceFiles-windows-x86" : [ "libs/win32/libpq.lib" ]
         }
     ]
Feb 10 2015
parent reply Mike Parker <aldacron gmail.com> writes:
On 2/11/2015 8:38 AM, Arjan wrote:
 Snippet from: https://github.com/buggins/ddbc/blob/master/dub.json#L7

 ddbc has a "dependencies" on "mysql-native": ">=0.0.12". But this is
 only true for "configurations": "MySQL".
 Is it allowed to put the dependency within the configuration section for
 "MySQL?.
Yes.
Feb 10 2015
parent "Arjan" <arjan ask.me.to> writes:
On Wednesday, 11 February 2015 at 01:06:02 UTC, Mike Parker wrote:
 On 2/11/2015 8:38 AM, Arjan wrote:
 Snippet from: 
 https://github.com/buggins/ddbc/blob/master/dub.json#L7

 ddbc has a "dependencies" on "mysql-native": ">=0.0.12". But 
 this is
 only true for "configurations": "MySQL".
 Is it allowed to put the dependency within the configuration 
 section for
 "MySQL?.
Yes.
I moved the "dependencies" into the configuration of "MySQL", but no dice. It is accepted by dub but does not make a difference when selecting an other configuration. e.g. "dub build -f -c SQLite -a x86" still fetches and builds the "mysql-native". Is this behavior of dub expected or a bug?
Feb 10 2015