Skip to content
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

MOB-9249 - Android 15 upgrade #811

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from
Draft
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
11 changes: 4 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@ jobs:
- name: Configure JDK
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # v1.4.3
with:
java-version: 11
java-version: 17

- run: touch local.properties

- name: Checkstyle
run: ./gradlew :iterableapi:checkstyle :iterableapi-ui:assembleDebug

- name: Javadoc Check
run: ./gradlew :iterableapi:javadoc :iterableapi-ui:javadoc

unit-tests:
name: Unit tests
runs-on: ubuntu-latest
Expand All @@ -41,7 +38,7 @@ jobs:
- name: Configure JDK
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # v1.4.3
with:
java-version: 11
java-version: 17

- run: touch local.properties

Expand Down Expand Up @@ -69,7 +66,7 @@ jobs:
- name: Configure JDK
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # v1.4.3
with:
java-version: 11
java-version: 17

- run: touch local.properties

Expand Down Expand Up @@ -102,7 +99,7 @@ jobs:
- name: Configure JDK
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # v1.4.3
with:
java-version: 11
java-version: 17

- run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- run: chmod +x ./cc-test-reporter
Expand Down
78 changes: 39 additions & 39 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'jacoco'

repositories {
mavenCentral()
}

android {
compileSdkVersion 33
buildToolsVersion '33.0.2'
compileSdk 34

namespace 'com.iterable.iterableapi.testapp'
testNamespace 'iterable.com.iterableapi'

defaultConfig {
applicationId "com.iterable.iterableapi.testapp"
minSdkVersion 16
targetSdkVersion 27
// applicationId "com.iterable.iterableapi.testapp"
minSdkVersion 21
targetSdkVersion 34
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -26,7 +24,7 @@ android {

buildTypes {
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}

Expand All @@ -38,12 +36,11 @@ android {
testOptions.unitTests.includeAndroidResources = true

compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "1.8"
kotlin {
jvmToolchain(17)
}
}

Expand All @@ -52,46 +49,46 @@ dependencies {
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.fragment:fragment:1.2.4'
debugImplementation 'androidx.fragment:fragment-testing:1.2.4'
implementation 'androidx.fragment:fragment:1.8.5'
androidTestImplementation 'androidx.fragment:fragment-testing:1.8.5'

implementation project(':iterableapi')
implementation project(':iterableapi-ui')

testImplementation 'junit:junit:4.13.2'
testImplementation 'androidx.test:runner:1.5.2'
testImplementation 'androidx.test.espresso:espresso-core:3.5.1'
testImplementation 'androidx.test.ext:junit:1.1.5'
testImplementation 'androidx.test:rules:1.5.0'
testImplementation 'org.mockito:mockito-core:3.3.3'
testImplementation 'org.robolectric:robolectric:4.9.2'
testImplementation 'androidx.test:runner:1.6.2'
testImplementation 'androidx.test.espresso:espresso-core:3.6.1'
testImplementation 'androidx.test.ext:junit:1.2.1'
testImplementation 'androidx.test:rules:1.6.1'
testImplementation 'org.mockito:mockito-core:4.8.0'
testImplementation 'org.robolectric:robolectric:4.13'
testImplementation 'org.robolectric:shadows-playservices:4.9.2'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.2.2'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.9.3'
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation 'org.mockito:mockito-android:3.0.0'
androidTestImplementation 'androidx.test:runner:1.6.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test:rules:1.6.1'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.3.0'
androidTestImplementation 'org.mockito:mockito-android:4.8.0'
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:4.2.2'
androidTestImplementation 'androidx.test.espresso:espresso-web:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-web:3.6.1'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.6.1'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.6.1'
}

tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
}

//
task jacocoDebugTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
group = "reporting"
description = "Generate unified Jacoco code coverage report"
reports {
xml.enabled = true
html.enabled = true
csv.enabled = false
xml.required = true
html.required = true
csv.required = false
}
def fileFilter = [
'**/*Test*.*',
Expand Down Expand Up @@ -134,9 +131,9 @@ task jacocoDebugAndroidTestReport(type: JacocoReport, dependsOn: ['connectedChec
description = "Generate Jacoco code coverage report for instumentation tests"

reports {
xml.enabled = true
html.enabled = true
csv.enabled = false
xml.required = true
html.required = true
csv.required = false
}

def fileFilter = [
Expand Down Expand Up @@ -165,10 +162,13 @@ task jacocoDebugAndroidTestReport(type: JacocoReport, dependsOn: ['connectedChec
def mainSrc = "${project.projectDir}/src/main/java"
def sdkSrc = "${project.projectDir}/../iterableapi/src/main/java"
def sdkUiSrc = "${project.projectDir}/../iterableapi-ui/src/main/java"

sourceDirectories.from = files([mainSrc])
classDirectories.from = files([debugTree])
additionalSourceDirs.from = files([sdkSrc, sdkUiSrc])
additionalClassDirs.from = files([sdkTree, sdkUiTree])
executionData.from = fileTree(dir: "$buildDir", include: "outputs/code_coverage/debugAndroidTest/connected/**/*.ec")
}
}

// java doc

2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme">
<activity
android:name="com.iterable.androidsdk.MainActivity"
android:label="@string/app_name"
android:exported="true"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.6.21'
ext.kotlin_version = '1.9.0'
ext.mavenPublishEnabled = true
repositories {
google()
Expand All @@ -10,8 +10,8 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.android.tools.build:gradle:8.5.2'
classpath 'com.google.gms:google-services:4.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath ('com.hiya:jacoco-android:0.2') {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.defaults.buildfeatures.buildconfig=true
android.enableJetifier=true
android.nonFinalResIds=false
android.nonTransitiveRClass=false
android.useAndroidX=true
org.gradle.jvmargs=-Xmx2048m

Expand All @@ -34,4 +37,4 @@ POM_DEVELOPER_ID=Iterable
POM_DEVELOPER_NAME=Iterable
POM_PACKAGING=aar

org.gradle.daemon=true
org.gradle.daemon=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Oct 10 10:01:47 MDT 2023
#Fri Jul 26 15:55:29 PDT 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
30 changes: 18 additions & 12 deletions iterableapi-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 33
compileSdk 34

namespace 'com.iterable.iterableapi.ui'

defaultConfig {
minSdkVersion 16
targetSdkVersion 28
minSdkVersion 21
targetSdkVersion 32
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled = true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

publishing {
Expand All @@ -22,7 +28,7 @@ android {

buildTypes {
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

Expand All @@ -34,19 +40,19 @@ android {

dependencies {
api project(':iterableapi')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
implementation 'com.google.android.flexbox:flexbox:3.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation "com.github.bumptech.glide:glide:4.16.0"
implementation 'com.google.android.material:material:1.2.0'
implementation 'com.google.android.material:material:1.12.0'

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
androidTestImplementation 'androidx.test:runner:1.6.2'
androidTestImplementation 'androidx.test:rules:1.6.1'
}

ext {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class IterableEmbeddedView(
gradientDrawable.setColor(backgroundColor)
gradientDrawable.setStroke(borderWidth, borderColor)
gradientDrawable.cornerRadius = borderCornerRadius
view.setBackgroundDrawable(gradientDrawable)
view.background = gradientDrawable

val firstButton = view.findViewById<Button>(R.id.embedded_message_first_button)
val secondButton = view.findViewById<Button>(R.id.embedded_message_second_button)
Expand All @@ -100,7 +100,7 @@ class IterableEmbeddedView(
else ContextCompat.getDrawable(requireContext(), R.drawable.primary_banner_button_background) as? GradientDrawable
primaryBtnBackgroundDrawable?.setColor(primaryBtnBackgroundColor)

firstButton.setBackgroundDrawable(primaryBtnBackgroundDrawable)
firstButton.background = primaryBtnBackgroundDrawable
}

if(config?.secondaryBtnBackgroundColor != null) {
Expand All @@ -109,7 +109,7 @@ class IterableEmbeddedView(
else ContextCompat.getDrawable(requireContext(), R.drawable.secondary_banner_button_background) as? GradientDrawable
secondaryBtnBackgroundDrawable?.setColor(secondaryBtnBackgroundColor)

secondButton.setBackgroundDrawable(secondaryBtnBackgroundDrawable)
secondButton.background = secondaryBtnBackgroundDrawable
}

firstButton.setTextColor(primaryBtnTextColor)
Expand Down
Loading
Loading