Skip to content

Commit

Permalink
Remove manual dex options
Browse files Browse the repository at this point in the history
Android Gradle Plugin now takes care of it.

WARNING: DSL element 'dexOptions' is obsolete and should be removed.
It will be removed in version 8.0 of the Android Gradle plugin.
Using it has no effect, and the AndroidGradle plugin optimizes dexing automatically.
  • Loading branch information
vgaidarji committed Oct 6, 2023
1 parent c972e14 commit e14a3e8
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
command: ./gradlew connectedAndroidTest
- run:
name: Build and check
command: ./gradlew testDebug jacocoTestReport coveralls checkstyle pmd jdepend lintDebug buildDashboard crashlyticsUploadDistributionDebug -PpreDexEnable=false -PversionCode=$CIRCLE_BUILD_NUM -PfabricApiKey=$FABRIC_API_KEY -PfabricApiSecret=$FABRIC_API_SECRET
command: ./gradlew testDebug jacocoTestReport coveralls checkstyle pmd jdepend lintDebug buildDashboard crashlyticsUploadDistributionDebug -PversionCode=$CIRCLE_BUILD_NUM -PfabricApiKey=$FABRIC_API_KEY -PfabricApiSecret=$FABRIC_API_SECRET
- store_artifacts:
path: app/build/outputs
destination: outputs
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ jobs:
FABRIC_API_KEY: ${{ secrets.FABRIC_API_KEY }}
FABRIC_API_SECRET: ${{ secrets.FABRIC_API_SECRET }}
with:
args: "sdkmanager 'platforms;android-26' && ./gradlew assembleDebug -PpreDexEnable=false"
args: "sdkmanager 'platforms;android-26' && ./gradlew assembleDebug"
- name: Check
uses: vgaidarji/[email protected]
env:
FABRIC_API_KEY: ${{ secrets.FABRIC_API_KEY }}
FABRIC_API_SECRET: ${{ secrets.FABRIC_API_SECRET }}
with:
args: "./gradlew testDebug jacocoTestReport checkstyle pmd jdepend lintDebug buildDashboard -PpreDexEnable=false"
args: "./gradlew testDebug jacocoTestReport checkstyle pmd jdepend lintDebug buildDashboard"
- name: Distribute
uses: vgaidarji/[email protected]
env:
FABRIC_API_KEY: ${{ secrets.FABRIC_API_KEY }}
FABRIC_API_SECRET: ${{ secrets.FABRIC_API_SECRET }}
with:
args: "./gradlew crashlyticsUploadDistributionDebug -PpreDexEnable=false"
args: "./gradlew crashlyticsUploadDistributionDebug"
- name: Publish Code Coverage
uses: vgaidarji/[email protected]
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
with:
args: "./gradlew coveralls -PpreDexEnable=false"
args: "./gradlew coveralls"
androidTest:
runs-on: macOS-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ before_script:
- adb shell input keyevent 82 &

script:
- ./gradlew clean assembleDebug testDebug jacocoTestReport coveralls checkstyle pmd jdepend lintDebug buildDashboard connectedAndroidTest crashlyticsUploadDistributionDebug -PpreDexEnable=false -PversionCode=$TRAVIS_BUILD_NUMBER -PfabricApiKey=$FABRIC_API_KEY -PfabricApiSecret=$FABRIC_API_SECRET
- ./gradlew clean assembleDebug testDebug jacocoTestReport coveralls checkstyle pmd jdepend lintDebug buildDashboard connectedAndroidTest crashlyticsUploadDistributionDebug -PversionCode=$TRAVIS_BUILD_NUMBER -PfabricApiKey=$FABRIC_API_KEY -PfabricApiSecret=$FABRIC_API_SECRET

env:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion GITHUB_ACTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ GitHub provides [basic documentation](https://developer.github.com/actions) on h
See these projects' `README` and `Dockerfile` files for configuration details.

Use `vgaidarji/android-github-actions/[email protected]` for regular build steps and provide commands via action `args` parameter.
For example: `args = "./gradlew assembleDebug -PpreDexEnable=false"`. This will be passed to `entrypoint.sh` of the appropriate GitHub Action and executed in root folder of the workspace.
For example: `args = "./gradlew assembleDebug"`. This will be passed to `entrypoint.sh` of the appropriate GitHub Action and executed in root folder of the workspace.

Use `vgaidarji/android-github-actions/[email protected]` for running UI tests on Android Emulator.
By default, this action will execute [ui-test-on-emulator](https://github.com/vgaidarji/android-github-actions/blob/0381c333953e22b4b95d4ef843effefb35c67fdf/emulator/Dockerfile#L18) script (see [script sources](https://github.com/vgaidarji/docker-android/blob/570d8f3aacd6af72b817254d08c99cd5bae57636/docker-android-emulator/ui-tests-on-emulator.sh)).
Expand Down
19 changes: 1 addition & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,4 @@ allprojects {

task clean(type: Delete) {
delete rootProject.buildDir
}

project.ext {
if (project.hasProperty('preDexEnable')) {
project.ext.preDexLibs = project.properties['preDexEnable'].equals('true')
} else {
project.ext.preDexLibs = true
}
}
subprojects {
project.plugins.whenPluginAdded { plugin ->
if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
} else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
}
}
}
}
2 changes: 1 addition & 1 deletion shippable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ build:
- android list targets
- ./ui_tests_on_emulator.sh emulator64-arm
# one line build steps (don't want to pass paramaters to every gradlew command)
- ./gradlew clean assembleDebug testDebug jacocoTestReport coveralls checkstyle pmd jdepend lintDebug buildDashboard crashlyticsUploadDistributionDebug -PpreDexEnable=false -PversionCode=$BUILD_NUMBER
- ./gradlew clean assembleDebug testDebug jacocoTestReport coveralls checkstyle pmd jdepend lintDebug buildDashboard crashlyticsUploadDistributionDebug -PversionCode=$BUILD_NUMBER
# convert JaCoCo to cobertura
- wget -O cover2cover.py https://raw.githubusercontent.com/rix0rrr/cover2cover/master/cover2cover.py
- python cover2cover.py $JACOCO_REPORT_LOCATION app/src/main/java > shippable/codecoverage/coverage.xml
Expand Down

0 comments on commit e14a3e8

Please sign in to comment.