diff options
author | Jake Petroules <jake.petroules@qt.io> | 2016-06-10 23:31:05 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2016-06-20 07:22:56 +0000 |
commit | 532e8ea991cf0dede72d3f357619f49f4b36187b (patch) | |
tree | 048ac18f8d5105eae0e56e666345e892f7467bf9 /tests/auto/cmdlineparser | |
parent | e55b41dde5789bd45164555f2bddc0a8fe15771d (diff) |
Stop special casing qbs.buildVariant in command line handling.
This introduces qbs.configurationName, which takes the place of
qbs.buildVariant in the command line and acts as a unique identifier
for each build configuration, rather than relying on the combination of
qbs.buildVariant and the profile name to do so.
No longer special casing qbs.buildVariant allows the variant to be
decoupled from the build configuration, and allow scenarios where a
project may contain products hardcoded for particular build variants,
and in future, special debug-and-release builds which create a single
framework product containing multiple build variants.
Incidentally, this change allows building multiple configurations of the
same build variant and profile name combination, since the build
configuration is no longer keyed on the aggregate of those values.
Building for different profiles with the same configuration name in
parallel is now no longer possible, but this is easily worked around by
simply specifying different configuration names for such combinations.
For example, the following is now possible:
qbs \
static profile:a qbs.buildVariant:release project.useStaticLibraries:true \
dynamic profile:a qbs.buildVariant:release project.useStaticLibraries:false
[ChangeLog] Each build configuration now requires a unique name, which
is specified on the command line in the same place that qbs.buildVariant
used to be specified. This allows building for multiple configurations
with the same variant.
Change-Id: I96ab9fc96861ab7e6a04a7d291a093115c22010e
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/cmdlineparser')
-rw-r--r-- | tests/auto/cmdlineparser/tst_cmdlineparser.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/cmdlineparser/tst_cmdlineparser.cpp b/tests/auto/cmdlineparser/tst_cmdlineparser.cpp index ed6200ad6..01ec44b18 100644 --- a/tests/auto/cmdlineparser/tst_cmdlineparser.cpp +++ b/tests/auto/cmdlineparser/tst_cmdlineparser.cpp @@ -108,18 +108,18 @@ private slots: QCOMPARE(parser.buildConfigurations().count(), 1); QCOMPARE(parser.buildConfigurations().first().value("qbs.profile").toString(), QLatin1String("b")); - // Second build variant-specific profile overwrites first. + // Second build configuration-specific profile overwrites first. QVERIFY(parser.parseCommandLine(QStringList(fileArgs) << "debug" << "profile:a" << "profile:b")); QCOMPARE(parser.buildConfigurations().count(), 1); QCOMPARE(parser.buildConfigurations().first().value("qbs.profile").toString(), QLatin1String("b")); - QVERIFY(parser.parseCommandLine(QStringList(fileArgs) << "debug" << "profile:a" - << "debug" << "profile:b")); + QVERIFY(parser.parseCommandLine(QStringList(fileArgs) << "a-debug" << "profile:a" + << "b-debug" << "profile:b")); QCOMPARE(parser.buildConfigurations().count(), 2); - QCOMPARE(parser.buildConfigurations().first().value("qbs.buildVariant").toString(), QLatin1String("debug")); + QCOMPARE(parser.buildConfigurations().first().value("qbs.configurationName").toString(), QLatin1String("a-debug")); QCOMPARE(parser.buildConfigurations().first().value("qbs.profile").toString(), QLatin1String("a")); - QCOMPARE(parser.buildConfigurations().at(1).value("qbs.buildVariant").toString(), QLatin1String("debug")); + QCOMPARE(parser.buildConfigurations().at(1).value("qbs.configurationName").toString(), QLatin1String("b-debug")); QCOMPARE(parser.buildConfigurations().at(1).value("qbs.profile").toString(), QLatin1String("b")); // Redundant build request @@ -130,16 +130,16 @@ private slots: QVERIFY(parser.parseCommandLine(QStringList(fileArgs) << "debug" << "profile:a" << "release" << "profile:b")); QCOMPARE(parser.buildConfigurations().count(), 2); - QCOMPARE(parser.buildConfigurations().first().value("qbs.buildVariant").toString(), QLatin1String("debug")); + QCOMPARE(parser.buildConfigurations().first().value("qbs.configurationName").toString(), QLatin1String("debug")); QCOMPARE(parser.buildConfigurations().first().value("qbs.profile").toString(), QLatin1String("a")); - QCOMPARE(parser.buildConfigurations().at(1).value("qbs.buildVariant").toString(), QLatin1String("release")); + QCOMPARE(parser.buildConfigurations().at(1).value("qbs.configurationName").toString(), QLatin1String("release")); QCOMPARE(parser.buildConfigurations().at(1).value("qbs.profile").toString(), QLatin1String("b")); // Non-global property takes precedence. QVERIFY(parser.parseCommandLine(QStringList(fileArgs) << "profile:a" << "debug" << "profile:b")); QCOMPARE(parser.buildConfigurations().count(), 1); - QCOMPARE(parser.buildConfigurations().first().value("qbs.buildVariant").toString(), QLatin1String("debug")); + QCOMPARE(parser.buildConfigurations().first().value("qbs.configurationName").toString(), QLatin1String("debug")); QCOMPARE(parser.buildConfigurations().first().value("qbs.profile").toString(), QLatin1String("b")); } |