Skip to content

Commit

Permalink
Cleanup installation process
Browse files Browse the repository at this point in the history
Make us of the built-in qbs.installDir configuration for Application types.
  • Loading branch information
rweickelt committed May 20, 2019
1 parent 07829b8 commit b8b1ab1
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 13 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
include:
# Qst application for Linux
- stage: build
name: Build Qst application (linux_amd64)
sudo: required
services:
- docker
Expand All @@ -35,7 +36,7 @@ jobs:
- TARGET=qst
- PLATFORM=linux-x86_64
- QBS_PROFILE=qt5
- QBS_OPTIONS="project.runAutotest:true project.version:$QST_VERSION"
- QBS_OPTIONS="modules.qstbuildconfig.runAutotest:true project.version:$QST_VERSION"
script:
- docker-compose run --rm linux qbs install
--install-root qst
Expand All @@ -46,6 +47,7 @@ jobs:
- find qst/
# Qst application for Windows
- stage: build
name: Build Qst application (mingw-w64)
sudo: required
services:
- docker
Expand All @@ -68,6 +70,7 @@ jobs:
- find qst/
# Launchpad probe for CC13x0
- stage: build
name: Build Launchpad probe
sudo: required
services:
- docker
Expand All @@ -91,6 +94,7 @@ jobs:
- find qst/
# Deploy linux bundle
- stage: bundle and deploy
name: Bundle and deploy for Linux
sudo: false
env:
- TARGET="linux-x86_64 bundle"
Expand All @@ -113,6 +117,7 @@ jobs:
all_branches: true
# Deploy windows bundle
- stage: bundle and deploy
name: Bundle and deploy for Windows
sudo: false
env:
- TARGET="windows-x86_64 bundle"
Expand Down
1 change: 1 addition & 0 deletions dist/distribute.qbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Product {
Depends { name: "cpp" }
Depends { name: "Qt.core" }
Depends { name: "Qt.qml" }
Depends { name: "qstbuildconfig" }

Group {
name: "Qt QML files"
Expand Down
7 changes: 4 additions & 3 deletions qbs/imports/QstAutoTest.qbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import qbs
QtApplication {
type: [ "application", "autotest" ]

condition : { return qbs.architecture.startsWith("x86") }
condition : qbs.architecture.startsWith("x86")

property string dataDirectory: sourceDirectory

destinationDirectory: "bin"

Depends { name : "Qt.testlib" }
Depends { name: "qsttestlib" }
Depends { name: "qstbuildconfig" }

cpp.defines: base.concat([
'SOURCE_DIR="' + dataDirectory + '"'
Expand All @@ -19,8 +20,8 @@ QtApplication {
consoleApplication: true

Group {
fileTagsFilter: product.type
qbs.install: project.installTests
fileTagsFilter: "application"
qbs.install: qstbuildconfig.installTests
qbs.installDir : "bin"
}
}
9 changes: 9 additions & 0 deletions qbs/modules/qstbuildconfig/common.qbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import qbs

Module {
name: "qbsbuildconfig"
property bool runAutotest: false
property bool installTests: false

qbs.installPrefix: ""
}
2 changes: 0 additions & 2 deletions qst-project.qbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ Project {

minimumQbsVersion: "1.6"

property bool runAutotest: false
property bool installTests: false
property string commit: Environment.getEnv("QST_COMMIT") || "unspecified"
property string version: Environment.getEnv("QST_VERSION") || "local-build"
}
2 changes: 2 additions & 0 deletions share/share.qbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Product {
sourceDirectory + "/share/qst/imports",
]

Depends { name: "qstbuildconfig" }

Group {
name : "qst imports"
prefix : "qst/imports/qst/"
Expand Down
1 change: 1 addition & 0 deletions src/launchpad-probe/launchpad-probe.qbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Project {

Depends { name: "simplelink"; submodules: [ "core", "drivers", "tirtos", "board" ] }
Depends { name: "shared-types" }
Depends { name: "qstbuildconfig" }

simplelink.core.device: "cc1310f128"
simplelink.board.type: "CC1310_LAUNCHXL"
Expand Down
18 changes: 13 additions & 5 deletions src/qst/qst.qbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@ QtApplication {

condition : qbs.architecture.startsWith("x86")

Depends { name : "Qt.qml"; }
Depends { name : "Qt.serialport"; }
Depends {
name : "Qt";
submodules: [
"core",
"network",
"qml",
"qml-private",
"serialport"
]
}
Depends { name : "cpp" }
Depends { name : "Qt.qml-private"; }
Depends { name : "shared-types" }
Depends { name: "qstbuildconfig" }

cpp.cxxLanguageVersion : "c++14"
cpp.rpaths: [
"$ORIGIN/../lib/"
cpp.rpathOrigin + "/../lib/"
]
cpp.defines: [
"QST_COMMIT=" + project.commit,
Expand Down Expand Up @@ -112,7 +120,7 @@ QtApplication {
]

Group {
fileTagsFilter: product.type
fileTagsFilter: "application"
qbs.install: true
qbs.installDir : "bin"
}
Expand Down
5 changes: 3 additions & 2 deletions tests/tests.qbs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ Project {
}

AutotestRunner {
condition : { return qbs.architecture.startsWith("x86") }
condition : qbs.architecture.startsWith("x86")

builtByDefault: project.runAutotest
Depends { name: "qstbuildconfig" }
builtByDefault: qstbuildconfig.runAutotest
}

}

0 comments on commit b8b1ab1

Please sign in to comment.