Skip to content

(fix): this fixes proguard rules when running minifyEnabled #266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a compile only for noveo android logger. We don't need both.


compileOnly "com.fasterxml.jackson.core:jackson-databind:$jacksonversion"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we explicitly bundle jackson with our SDK? Would the user be able to exclude it from their app?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is compile only. So, it is not a explicit dependency. If you are not using jackson, then, there is no effect. If you are using jackson, you would add this as a implementation in your gradle. Essentially, this is so our jackson code compiles. We still default to gson.

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does moving this here do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is just consistent with what is below it. We first cancel the alarm and then the pendingIntent. Here we cancel the job and then the pending intent. Basically, it is so if the pendingIntent throws, we have still cancelled the scheduled job.

} 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