Skip to content
Closed
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
193 changes: 98 additions & 95 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-parcelize'
apply plugin: 'jacoco'

repositories {
mavenCentral()
}

android {
compileSdkVersion 33
buildToolsVersion '33.0.2'
compileSdk 34
buildToolsVersion '34.0.0'

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

defaultConfig {
applicationId "com.iterable.iterableapi.testapp"
minSdkVersion 16
targetSdkVersion 27
targetSdkVersion 35
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -38,12 +38,15 @@ android {
testOptions.unitTests.includeAndroidResources = true

compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 17
targetCompatibility = 17
}

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

Expand Down Expand Up @@ -86,90 +89,90 @@ tasks.withType(Test) {
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
}
def fileFilter = [
'**/*Test*.*',
'**/AutoValue_*.*',
'**/*JavascriptBridge.class',
'**/R.class',
'**/R$*.class',
'**/Manifest*.*',
'android/**/*.*',
'**/BuildConfig.*',
'**/*$ViewBinder*.*',
'**/*$ViewInjector*.*',
'**/Lambda$*.class',
'**/Lambda.class',
'**/*Lambda.class',
'**/*Lambda*.class',
'**/*$InjectAdapter.class',
'**/*$ModuleAdapter.class',
'**/*$ViewInjector*.class',
]

def debugTree = fileTree(dir: "${buildDir}/intermediates/javac/debug/classes", excludes: fileFilter) //we use "debug" build type for test coverage (can be other)
def sdkTree = fileTree(dir: "${buildDir}/../../iterableapi/build/intermediates/javac/debug/classes", excludes: fileFilter)
def sdkUiTree = fileTree(dir: "${buildDir}/../../iterableapi-ui/build/intermediates/javac/debug/classes", excludes: fileFilter)
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", includes: [
"jacoco/testDebugUnitTest.exec"
])
}

task jacocoDebugAndroidTestReport(type: JacocoReport, dependsOn: ['connectedCheck']) {
group = "reporting"
description = "Generate Jacoco code coverage report for instumentation tests"

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

def fileFilter = [
'**/*Test*.*',
'**/AutoValue_*.*',
'**/*JavascriptBridge.class',
'**/R.class',
'**/R$*.class',
'**/Manifest*.*',
'android/**/*.*',
'**/BuildConfig.*',
'**/*$ViewBinder*.*',
'**/*$ViewInjector*.*',
'**/Lambda$*.class',
'**/Lambda.class',
'**/*Lambda.class',
'**/*Lambda*.class',
'**/*$InjectAdapter.class',
'**/*$ModuleAdapter.class',
'**/*$ViewInjector*.class',
]

def debugTree = fileTree(dir: "${buildDir}/intermediates/javac/debug/classes", excludes: fileFilter) //we use "debug" build type for test coverage (can be other)
def sdkTree = fileTree(dir: "${buildDir}/../../iterableapi/build/intermediates/javac/debug/classes", excludes: fileFilter)
def sdkUiTree = fileTree(dir: "${buildDir}/../../iterableapi-ui/build/intermediates/javac/debug/classes", excludes: fileFilter)
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")
}
//task jacocoDebugTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
// group = "reporting"
// description = "Generate unified Jacoco code coverage report"
// reports {
////// xml = true
//// html = true
//// csv = false
// }
// def fileFilter = [
// '**/*Test*.*',
// '**/AutoValue_*.*',
// '**/*JavascriptBridge.class',
// '**/R.class',
// '**/R$*.class',
// '**/Manifest*.*',
// 'android/**/*.*',
// '**/BuildConfig.*',
// '**/*$ViewBinder*.*',
// '**/*$ViewInjector*.*',
// '**/Lambda$*.class',
// '**/Lambda.class',
// '**/*Lambda.class',
// '**/*Lambda*.class',
// '**/*$InjectAdapter.class',
// '**/*$ModuleAdapter.class',
// '**/*$ViewInjector*.class',
// ]
//
// def debugTree = fileTree(dir: "${buildDir}/intermediates/javac/debug/classes", excludes: fileFilter) //we use "debug" build type for test coverage (can be other)
// def sdkTree = fileTree(dir: "${buildDir}/../../iterableapi/build/intermediates/javac/debug/classes", excludes: fileFilter)
// def sdkUiTree = fileTree(dir: "${buildDir}/../../iterableapi-ui/build/intermediates/javac/debug/classes", excludes: fileFilter)
// 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", includes: [
// "jacoco/testDebugUnitTest.exec"
// ])
//}

//task jacocoDebugAndroidTestReport(type: JacocoReport, dependsOn: ['connectedCheck']) {
// group = "reporting"
// description = "Generate Jacoco code coverage report for instumentation tests"
//
// reports {
// xml.enabled = true
// html.enabled = true
// csv.enabled = false
// }
//
// def fileFilter = [
// '**/*Test*.*',
// '**/AutoValue_*.*',
// '**/*JavascriptBridge.class',
// '**/R.class',
// '**/R$*.class',
// '**/Manifest*.*',
// 'android/**/*.*',
// '**/BuildConfig.*',
// '**/*$ViewBinder*.*',
// '**/*$ViewInjector*.*',
// '**/Lambda$*.class',
// '**/Lambda.class',
// '**/*Lambda.class',
// '**/*Lambda*.class',
// '**/*$InjectAdapter.class',
// '**/*$ModuleAdapter.class',
// '**/*$ViewInjector*.class',
// ]
//
// def debugTree = fileTree(dir: "${buildDir}/intermediates/javac/debug/classes", excludes: fileFilter) //we use "debug" build type for test coverage (can be other)
// def sdkTree = fileTree(dir: "${buildDir}/../../iterableapi/build/intermediates/javac/debug/classes", excludes: fileFilter)
// def sdkUiTree = fileTree(dir: "${buildDir}/../../iterableapi-ui/build/intermediates/javac/debug/classes", excludes: fileFilter)
// 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")
//}
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.1'
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
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
#Mon Jul 22 14:29:06 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
12 changes: 10 additions & 2 deletions iterableapi-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 33
compileSdk 34

namespace 'com.iterable.iterableapi.ui'

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

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlin {
jvmToolchain(17)
}

publishing {
multipleVariants {
allVariants()
Expand Down
8 changes: 4 additions & 4 deletions iterableapi-ui/src/main/res/layout-v21/banner_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
android:ellipsize="end"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:singleLine="true"
Expand All @@ -91,8 +91,8 @@
android:layout_height="36dp"
android:background="@drawable/secondary_banner_button_background"
android:ellipsize="end"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:singleLine="true"
Expand Down
8 changes: 4 additions & 4 deletions iterableapi-ui/src/main/res/layout-v21/card_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
android:ellipsize="end"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:singleLine="true"
Expand All @@ -102,8 +102,8 @@
android:layout_height="36dp"
android:background="@drawable/secondary_card_button_background"
android:ellipsize="end"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:singleLine="true"
Expand Down
8 changes: 4 additions & 4 deletions iterableapi-ui/src/main/res/layout-v21/notification_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
android:textColor="@color/notification_text_color"
android:background="@drawable/primary_notification_button_background"
android:ellipsize="end"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:singleLine="true"
Expand All @@ -84,8 +84,8 @@
android:textColor="@color/notification_text_color"
android:background="@drawable/secondary_notification_button_background"
android:ellipsize="end"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:singleLine="true"
Expand Down
8 changes: 4 additions & 4 deletions iterableapi-ui/src/main/res/layout/banner_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
android:background="@drawable/primary_banner_button_background"
android:ellipsize="end"
android:layout_marginStart="16dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:singleLine="true"
Expand All @@ -90,8 +90,8 @@
android:layout_marginEnd="16dp"
android:background="@drawable/secondary_banner_button_background"
android:ellipsize="end"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:singleLine="true"
Expand Down
6 changes: 5 additions & 1 deletion iterableapi-ui/src/main/res/layout/card_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,16 @@

<Button
android:id="@+id/embedded_message_first_button"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:background="@drawable/primary_card_button_background"
android:ellipsize="end"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:singleLine="true"
android:stateListAnimator="@null"
android:textAllCaps="false"
Expand All @@ -97,6 +99,8 @@
android:layout_width="0dp"
android:layout_height="36dp"
android:layout_marginEnd="16dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:layout_weight="1"
android:background="@drawable/secondary_card_button_background"
android:ellipsize="end"
Expand Down
Loading
Loading