Android build variants on travis.ci
Asked Answered
D

2

6

I currently have an Android project using gradle and integrated with travis.ci which has different productFlavors and buildTypes. When the "connectedCheck" task is then executed on travis.ci, it tries to package all build variants (all combinations of flavors and types). Some of them fail as the release builds need password input which I can't automate at the moment. Is there a way to tell travis.ci to build and test only a certain build variant of an Android project?

Datnow answered 4/7, 2014 at 12:47 Comment(6)
I suppose it's possible. You just probably need to specify the tasks for variants that You'd like to be built - not for all variants. How is the build process invoked with travis?Sewellel
run gradle tasks and you will see tasks related to each combination of flavour/type. So in your travis build only run these specific tasksElsaelsbeth
Thx, running a connectedAndroidTest<productFlavor><buildType>t task instead of connectedCheck seems to do the trick.Datnow
Also, I had to set the assemble task in the install section of the .travis.yml:Datnow
install: - TERM=dumb ./gradlew -s assemble<productFlavor><buildType>Datnow
You should post your solution as an answer.Pollitt
D
1

So here's how I made it work: Run a connectedAndroidTest<productFlavor><buildType> task instead of connectedCheck. Also set the assemble task in the install section of the .travis.yml:

install: - TERM=dumb ./gradlew -s assemble<productFlavor><buildType>
Datnow answered 28/6, 2017 at 10:15 Comment(0)
C
6

Say you only want to run the product flavor Trial and the build type Debug.

Instead of running ./gradlew assemble connectedCheck, which is similar to what you're doing, run this instead:

./gradlew assembleTrialDebug connectedCheckTrialDebug
Charr answered 18/9, 2015 at 1:47 Comment(0)
D
1

So here's how I made it work: Run a connectedAndroidTest<productFlavor><buildType> task instead of connectedCheck. Also set the assemble task in the install section of the .travis.yml:

install: - TERM=dumb ./gradlew -s assemble<productFlavor><buildType>
Datnow answered 28/6, 2017 at 10:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.