Skip to content

Commit

Permalink
[FSSDK-9917] update proguard rule for ODP (#471)
Browse files Browse the repository at this point in the history
- Release build with R8 (AGP 8) fails with missing java.beans.Transient. SDK consumer proguard rules are updated to support it.
- Upgrade Java source and target version from 8 to 11.
  • Loading branch information
jaeopt authored Jan 8, 2024
1 parent 0da9e47 commit 599ce89
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 16 deletions.
4 changes: 2 additions & 2 deletions android-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}

Expand Down
4 changes: 2 additions & 2 deletions datafile-handler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}

Expand Down
4 changes: 2 additions & 2 deletions event-handler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion build_tools_version
}
Expand Down
4 changes: 2 additions & 2 deletions odp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion build_tools_version

Expand Down
2 changes: 2 additions & 0 deletions proguard-rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
}
# Keep Payload classes that get sent to the ODP server
-keep class com.optimizely.ab.odp.ODPEvent { *; }
# ODP event uses this. R8 complains about it.
-dontwarn java.beans.Transient

# Keep Payload classes that get sent to Optimizely's backend
-keep class com.optimizely.ab.event.internal.payload.** { *; }
Expand Down
4 changes: 2 additions & 2 deletions shared/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion build_tools_version
}
Expand Down
9 changes: 5 additions & 4 deletions test-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ android {
// enable proguard for debug mode (keep both of these to detect issues while testing)
minifyEnabled true
debuggable false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'test-app-proguard-rules.pro'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'test-app-proguard-rules.pro'
signingConfig signingConfigs.debug
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
packagingOptions {
resources {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions user-profile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}

Expand Down

0 comments on commit 599ce89

Please sign in to comment.