Skip to content

Commit 68a8bdd

Browse files
alxndrsngarethbowen
authored andcommitted
Enable proguard & shrinkResources for release builds
This includes proguard rules to ignore crosswalk core files, as advised at https://crosswalk-project.org/documentation/about/faq.html
1 parent feb0907 commit 68a8bdd

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ android {
145145
testCoverageEnabled = true
146146
}
147147
release {
148-
minifyEnabled false
149-
proguardFile getDefaultProguardFile('proguard-android.txt')
148+
minifyEnabled true
149+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'config/xwalk.pro'
150+
shrinkResources true
150151
signingConfig signingConfigs.release
151152
}
152153
}

config/xwalk.pro

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# ProGuard config for Crosswalk
2+
3+
-dontwarn javax.annotation.Nullable
4+
-dontwarn javax.annotation.Nonnull
5+
-dontwarn javax.annotation.concurrent.NotThreadSafe
6+
-dontwarn javax.annotation.concurrent.ThreadSafe
7+
8+
-keep class org.xwalk.core.** {
9+
*;
10+
}
11+
-keep class org.chromium.** {
12+
*;
13+
}
14+
-keepattributes **
15+
16+
-optimizations !code/allocation/variable

0 commit comments

Comments
 (0)