Skip to content

Commit

Permalink
fix proguard issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Guardiola31337 committed Apr 4, 2018
1 parent d0ee4fd commit d0a9712
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 6 deletions.
3 changes: 1 addition & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ android {
testCoverageEnabled = false
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
minifyEnabled true
}
}

Expand Down
3 changes: 3 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
command: |
./gradlew accessToken
./gradlew app:assembleDebug
- run:
name: Build release to test ProGuard rules
command: ./gradlew app:assembleRelease
- run:
name: Log in to Google Cloud Platform
shell: /bin/bash -euo pipefail
Expand Down
1 change: 1 addition & 0 deletions libandroid-navigation-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ android {
"MAPBOX_NAVIGATION_EVENTS_USER_AGENT", String.format("\"mapbox-navigation-ui-android/%s\"",
project.VERSION_NAME
)
consumerProguardFiles 'proguard-consumer.pro'
}

configurations {
Expand Down
18 changes: 18 additions & 0 deletions libandroid-navigation-ui/proguard-consumer.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Consumer proguard rules for libandroid-navigation-ui

# --- OkHttp ---
-dontwarn okhttp3.**
# A resource is loaded with a relative path so the package of this class must be preserved.
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase

# --- Picasso ---
-dontwarn com.squareup.okhttp.**

# --- Java ---
-dontwarn java.awt.Color

# --- com.mapbox.api.directions.v5.MapboxDirections ---
-dontwarn com.sun.xml.internal.ws.spi.db.BindingContextFactory

# --- com.amazonaws.util.json.JacksonFactory ---
-dontwarn com.fasterxml.jackson.core.**
5 changes: 1 addition & 4 deletions libandroid-navigation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ android {
"MAPBOX_NAVIGATION_EVENTS_USER_AGENT", String.format("\"mapbox-navigation-android/%s\"",
project.VERSION_NAME
)
consumerProguardFiles 'proguard-consumer.pro'
}

configurations {
Expand All @@ -29,10 +30,6 @@ android {
debug {
testCoverageEnabled = true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

testOptions {
Expand Down
13 changes: 13 additions & 0 deletions libandroid-navigation/proguard-consumer.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Consumer proguard rules for libandroid-navigation

# --- OkHttp ---
-dontwarn okhttp3.**
-dontwarn okio.**
# A resource is loaded with a relative path so the package of this class must be preserved.
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase

# --- Java ---
-dontwarn java.awt.Color

# --- com.mapbox.api.directions.v5.MapboxDirections ---
-dontwarn com.sun.xml.internal.ws.spi.db.BindingContextFactory

0 comments on commit d0a9712

Please sign in to comment.