Skip to content

Commit

Permalink
(fix): this fixes proguard rules when running minifyEnabled (#266)
Browse files Browse the repository at this point in the history
* this fixes proguard rules when running minifyEnabled

* remove extra compileOnly include

* add compile only for slf4j. also, cleanup organization of gradle file.

* cancel pending after jobscheduler
  • Loading branch information
thomaszurkan-optimizely authored Apr 23, 2019
1 parent c4bb4f9 commit f34202a
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 9 deletions.
3 changes: 1 addition & 2 deletions android-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ dependencies {
exclude group: 'com.google.code.findbugs'
}

compileOnly group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'

compileOnly "com.fasterxml.jackson.core:jackson-databind:$jacksonversion"
implementation "com.android.support:support-annotations:$support_annotations_ver"

testImplementation "junit:junit:$junit_ver"
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ ext {
target_sdk_version = 28
java_core_ver = "3.0.0"
android_logger_ver = "1.3.6"
jacksonversion= "2.9.8"
support_annotations_ver = "24.2.1"
junit_ver = "4.12"
mockito_ver = "1.9.5"
Expand Down
2 changes: 1 addition & 1 deletion datafile-handler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dependencies {
api project(':shared')
implementation "com.android.support:support-annotations:$support_annotations_ver"

compileOnly group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'
compileOnly "com.noveogroup.android:android-logger:$android_logger_ver"

testImplementation "junit:junit:$junit_ver"
testImplementation "org.mockito:mockito-core:$mockito_ver"
Expand Down
2 changes: 1 addition & 1 deletion event-handler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies {
api project(':shared')
implementation "com.android.support:support-annotations:$support_annotations_ver"

compileOnly group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'
compileOnly "com.noveogroup.android:android-logger:$android_logger_ver"

testImplementation "junit:junit:$junit_ver"
testImplementation "org.mockito:mockito-core:$mockito_ver"
Expand Down
6 changes: 6 additions & 0 deletions proguard-rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,9 @@

# Android Logger
-keep class com.noveogroup.android.log.** { *; }

-optimizations !class/unboxing/enum

-dontwarn com.google.gson.**
-dontwarn com.optimizely.ab.config.parser.**

4 changes: 1 addition & 3 deletions shared/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,12 @@ android {
}

dependencies {
compileOnly "com.noveogroup.android:android-logger:$android_logger_ver"
api ("com.optimizely.ab:core-api:$java_core_ver") {
exclude group: 'com.google.code.findbugs'
}
implementation "com.google.code.gson:gson:$gson_ver"

compileOnly group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'

compileOnly "com.noveogroup.android:android-logger:$android_logger_ver"
compileOnly "com.android.support:support-annotations:$support_annotations_ver"

testImplementation "junit:junit:$junit_ver"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ private void cancelRepeating(PendingIntent pendingIntent, Intent intent) {
Integer id = null;
try {
id = (Integer) Class.forName(clazz).getDeclaredField("JOB_ID").get(null);
pendingIntent.cancel();
// only cancel periodic services
if (ServiceScheduler.isScheduled(context, id)) {
jobScheduler.cancel(id);
}
pendingIntent.cancel();
} catch (Exception e) {
logger.error("Error in Cancel ", e);
}
Expand Down
2 changes: 1 addition & 1 deletion user-profile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dependencies {
api project(':shared')

compileOnly "com.android.support:support-annotations:$support_annotations_ver"
compileOnly group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'
compileOnly "com.noveogroup.android:android-logger:$android_logger_ver"

testImplementation "junit:junit:$junit_ver"
testImplementation "org.mockito:mockito-core:$mockito_ver"
Expand Down

0 comments on commit f34202a

Please sign in to comment.