Skip to content

Commit ca55c6e

Browse files
committed
configure travis CI to build the runtime just once on PRs
1 parent 4bd1c4c commit ca55c6e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ matrix:
3333
git:
3434
submodules: false
3535
script:
36-
- "./gradlew -PpreReleaseVersion=$PACKAGE_VERSION -PgitCommitVersion=$TRAVIS_COMMIT --stacktrace"
36+
# (PR) build the runtime only once, with the c++ code optimizations
37+
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash ./gradlew -PskipUnoptimized -PpreReleaseVersion=$PACKAGE_VERSION -PgitCommitVersion=$TRAVIS_COMMIT --stacktrace; fi'
38+
# (master branch) build the runtime twice - optimized, and regular packages
39+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash ./gradlew -PpreReleaseVersion=$PACKAGE_VERSION -PgitCommitVersion=$TRAVIS_COMMIT --stacktrace; fi'
3740
- echo no | android create avd --force -n $EMULATOR_NAME-$EMULATOR_API_LEVEL -t android-$EMULATOR_API_LEVEL --abi $ANDROID_ABI -c 12M
3841
- emulator -avd $EMULATOR_NAME-$EMULATOR_API_LEVEL -no-skin -no-audio -no-window &
3942
- android-wait-for-emulator

build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def localMetadataGen = "../android-metadata-generator/dist/tns-android-metadata-
1818
def distDir = "$projectDir/dist"
1919
def pVersion = "no package version was provided by build.gradle build"
2020
def arVersion = "no commit sha was provided by build.gradle build"
21+
def generateRegularRuntimePackage = !project.hasProperty("skipUnoptimized");
2122

2223
task checkEnvironmentVariables {
2324
if ("$System.env.JAVA_HOME" == "" || "$System.env.JAVA_HOME" == "null") {
@@ -130,7 +131,10 @@ task getCommitVersion {
130131
task generateRuntime {
131132
doFirst {
132133
tasks.generateOptimizedRuntimeAar.execute();
133-
tasks.generateRuntimeAar.execute();
134+
135+
if (generateRegularRuntimePackage) {
136+
tasks.generateRuntimeAar.execute();
137+
}
134138
}
135139
}
136140

0 commit comments

Comments
 (0)