-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Android 21 compatibility #188
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
base: main
Are you sure you want to change the base?
Changes from all commits
2e2aef4
7c4adee
794cea4
026d26f
1bf96c8
11491c9
cc48752
4e49a11
da903ec
07d94f8
693db13
9644260
8fd8b30
b86f444
20ee787
20af008
f34fc5c
77e3199
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
api-level: [26, 31, 34] | ||
api-level: [21, 26, 31, 34] | ||
# Allow other tests to continue if one fails | ||
fail-fast: false | ||
|
||
|
@@ -51,9 +51,17 @@ jobs: | |
echo "SDK Branch: android-sdk@${SDK_BRANCH}" | ||
echo "API Level: ${{ matrix.api-level }}" | ||
|
||
- name: Check out Common Java SDK | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. temporary until java.v4 is published (which we'll do when this and the java-server PRs are ready for merge) |
||
uses: actions/checkout@v4 | ||
with: | ||
repository: Eppo-exp/sdk-common-jdk | ||
ref: typo/pull-json | ||
path: sdk-common-jdk | ||
|
||
- name: Check out Java SDK | ||
uses: actions/checkout@v4 | ||
with: | ||
path: android-sdk | ||
repository: ${{ inputs.base_repo || github.repository }} | ||
ref: ${{ env.SDK_BRANCH }} | ||
|
||
|
@@ -69,7 +77,15 @@ jobs: | |
mkdir -p ~/.gradle/ | ||
echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV | ||
|
||
- name: Gradle cache | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Publish Common SDK to Maven Local | ||
working-directory: sdk-common-jdk | ||
run: ./gradlew publishToMavenLocal --no-daemon | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. build the common SDK and publish to a local repository for the Android SDK |
||
- name: Set up test data | ||
working-directory: android-sdk | ||
run: make test-data branchName=${{env.TEST_DATA_BRANCH}} | ||
|
||
- name: Wait for mock UFC DNS to resolve | ||
|
@@ -92,10 +108,8 @@ jobs: | |
sudo udevadm control --reload-rules | ||
sudo udevadm trigger --name-match=kvm | ||
|
||
- name: Gradle cache | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Run tests | ||
working-directory: android-sdk | ||
run: ./gradlew check --no-daemon | ||
|
||
- name: AVD cache | ||
|
@@ -105,7 +119,7 @@ jobs: | |
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-api-${{ matrix.api-level }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
key: avd-api-${{ matrix.api-level }}-${{ hashFiles('android-sdk/**/*.gradle*', 'android-sdk/**/gradle-wrapper.properties') }} | ||
|
||
- name: create AVD and generate snapshot for caching | ||
if: steps.avd-cache.outputs.cache-hit != 'true' | ||
|
@@ -135,16 +149,16 @@ jobs: | |
touch app/emulator.log # create log file | ||
chmod 777 app/emulator.log # allow writing to log file | ||
adb logcat | grep EppoSDK >> app/emulator.log & # pipe all logcat messages into log file as a background process | ||
./gradlew connectedCheck --no-daemon -Pandroid.testInstrumentationRunnerArguments.TEST_DATA_BRANCH=${{ env.TEST_DATA_BRANCH }} # run tests | ||
cd android-sdk && ./gradlew connectedCheck --no-daemon -Pandroid.testInstrumentationRunnerArguments.TEST_DATA_BRANCH=${{ env.TEST_DATA_BRANCH }} # run tests | ||
|
||
- name: Store reports on failure | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: reports | ||
path: | | ||
**/build/reports/ | ||
**/build/test-results/ | ||
android-sdk/**/build/reports/ | ||
android-sdk/**/build/test-results/ | ||
|
||
- name: Upload Emulator Logs | ||
if: always() | ||
|
@@ -158,4 +172,4 @@ jobs: | |
uses: actions/upload-artifact@v4 | ||
with: | ||
name: report-api-level-${{ matrix.api-level }} | ||
path: /Users/runner/work/android-sdk/android-sdk/eppo/build/reports/androidTests/connected/index.html | ||
path: /Users/runner/work/android-sdk/android-sdk/android-sdk/eppo/build/reports/androidTests/connected/index.html |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ android { | |
|
||
defaultConfig { | ||
namespace "cloud.eppo.android" | ||
minSdk 26 | ||
minSdk 21 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. drop min to Android 21 |
||
targetSdk 34 | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
|
@@ -38,7 +38,8 @@ android { | |
matchingFallbacks = ['debug'] | ||
} | ||
} | ||
compileOptions { | ||
compileOptions { // Flag to enable support for the new language APIs | ||
coreLibraryDesugaringEnabled true | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
|
@@ -52,6 +53,7 @@ android { | |
} | ||
} | ||
|
||
|
||
ext {} | ||
ext.versions = [ | ||
"junit": "4.13.2", | ||
|
@@ -68,14 +70,15 @@ ext.versions = [ | |
] | ||
|
||
dependencies { | ||
api 'cloud.eppo:sdk-common-jvm:3.10.0' | ||
api 'cloud.eppo:sdk-common-jvm:4.0.0' | ||
|
||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5' | ||
|
||
implementation 'org.slf4j:slf4j-api:2.0.17' | ||
|
||
implementation "androidx.core:core:${versions.androidx_core}" | ||
implementation "com.squareup.okhttp3:okhttp:${versions.okhttp}" | ||
implementation "com.github.zafarkhaja:java-semver:${versions.semver}" | ||
implementation "com.fasterxml.jackson.core:jackson-databind:2.19.0" | ||
|
||
testImplementation "junit:junit:${versions.junit}" | ||
testImplementation "commons-io:commons-io:${versions.commonsio}" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
big change!