diff --git a/build.gradle.kts b/build.gradle.kts index bae1dca8..ea16b7a0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,45 +1,29 @@ import org.ajoberstar.grgit.Grgit -import java.io.FileInputStream -import java.util.Properties plugins { - alias(libs.plugins.androidLibrary) apply false - alias(libs.plugins.androidApplication) apply false + alias(libs.plugins.android.library) apply false + alias(libs.plugins.android.application) apply false alias(libs.plugins.kotlin) apply false alias(libs.plugins.kapt) apply false - alias(libs.plugins.navigationSafeArgs) apply false - alias(libs.plugins.googleServices) apply false - alias(libs.plugins.kotlinAllOpen) apply false - alias(libs.plugins.grGit) + alias(libs.plugins.androidx.navigation.safeargs) apply false + alias(libs.plugins.google.services) apply false +// alias(libs.plugins.huawei.agconnect) apply false + alias(libs.plugins.kotlin.allopen) apply false + alias(libs.plugins.grgit) + alias(libs.plugins.dotenv) + alias(libs.plugins.kotlin.parcelize) apply false id("com.github.ben-manes.versions") version "0.46.0" } versionData() -loadDevConfig() - -fun loadDevConfig() { - - ext["devConfig"] = Properties() - - try { - val inputStream = FileInputStream("$projectDir/localConfig.properties") - (ext["devConfig"] as Properties).load(inputStream) - - } catch (ignore: Exception) { - } - - if (ext["devConfig"] != null) { - println("Using devConfig: ${ext["devConfig"]}") - } -} fun versionData() { val git = Grgit.open( mapOf("currentDir" to project.rootDir) ) - - if ((if (System.getenv("BLACKDUCK") == null) false else System.getenv("BLACKDUCK")) == false) { + try { git.fetch() + } catch (ignored: Exception) { } if (git.describe() == null) { throw RuntimeException("Couldn't get Version Name") @@ -52,11 +36,9 @@ fun versionData() { versionCode = ((System.currentTimeMillis() - 1602845230) / 10000).toInt(), versionCodeTime = git.head().time ) - ext["gitVersionName"] = v.versionName - ext["gitVersionCode"] = v.versionCode - ext["gitVersionCodeTime"] = v.versionCodeTime + + val version by extra(v) println("versionName: ${v.versionName}") println("versionCode: ${v.versionCode}") - } \ No newline at end of file diff --git a/buildSrc/src/main/java/GitVersion.kt b/buildSrc/src/main/java/GitVersion.kt index 1819f936..571ea659 100644 --- a/buildSrc/src/main/java/GitVersion.kt +++ b/buildSrc/src/main/java/GitVersion.kt @@ -1 +1 @@ -data class GitVersion(val versionName: String, val versionCode: Int, val versionCodeTime: Long) +data class GitVersion(val versionName: String, val versionCode: Int, val versionCodeTime: Long) \ No newline at end of file diff --git a/common/build.gradle b/common/build.gradle deleted file mode 100644 index 8b7b88d7..00000000 --- a/common/build.gradle +++ /dev/null @@ -1,14 +0,0 @@ -plugins { - alias(libs.plugins.androidLibrary) - alias(libs.plugins.kotlin) - alias(libs.plugins.kapt) - alias(libs.plugins.kotlinAllOpen) -} -dependencies { - implementation project(":core-api") - androidTestImplementation project(":testUtils") -} -android { - namespace "com.emarsys.common" - sourceCompatibility = 17 -} \ No newline at end of file diff --git a/common/build.gradle.kts b/common/build.gradle.kts new file mode 100644 index 00000000..bf0b2697 --- /dev/null +++ b/common/build.gradle.kts @@ -0,0 +1,24 @@ +plugins { + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin) + alias(libs.plugins.kotlin.allopen) + alias(libs.plugins.kapt) +} +dependencies { + implementation(project(":core-api")) + androidTestImplementation(project(":testUtils")) +} +android { + namespace = "com.emarsys.common" + defaultConfig { + compileSdk = libs.versions.android.compileSdk.get().toInt() + } +} + +allOpen { + annotation("com.emarsys.core.Mockable") +} + +kotlin { + jvmToolchain(17) +} \ No newline at end of file diff --git a/core-api/build.gradle.kts b/core-api/build.gradle.kts index 8ece3b81..0aa78606 100644 --- a/core-api/build.gradle.kts +++ b/core-api/build.gradle.kts @@ -1,8 +1,8 @@ plugins { - alias(libs.plugins.androidLibrary) + alias(libs.plugins.android.library) alias(libs.plugins.kotlin) + alias(libs.plugins.kotlin.allopen) alias(libs.plugins.kapt) - alias(libs.plugins.kotlinAllOpen) } dependencies { api(libs.androidx.annotation) @@ -16,5 +16,13 @@ dependencies { } android { namespace = "com.emarsys.core.api" + defaultConfig { + compileSdk = libs.versions.android.compileSdk.get().toInt() + } } + +allOpen { + annotation("com.emarsys.core.Mockable") +} + kotlin { jvmToolchain(17) } \ No newline at end of file diff --git a/core/build.gradle.kts b/core/build.gradle.kts index d825ed07..afb4dc27 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -1,8 +1,8 @@ plugins { - alias(libs.plugins.androidLibrary) + alias(libs.plugins.android.library) alias(libs.plugins.kotlin) + alias(libs.plugins.kotlin.allopen) alias(libs.plugins.kapt) - alias(libs.plugins.kotlinAllOpen) } dependencies { @@ -14,6 +14,17 @@ dependencies { } android { namespace = "com.emarsys.core" + defaultConfig { + val version: GitVersion by rootProject.extra + + compileSdk = libs.versions.android.compileSdk.get().toInt() + buildConfigField("int", "VERSION_CODE", "${version.versionCode}") + buildConfigField("String", "VERSION_NAME", "\"${version.versionName}\"") + } +} + +allOpen { + annotation("com.emarsys.core.Mockable") } kotlin { diff --git a/emarsys-e2e-test/build.gradle.kts b/emarsys-e2e-test/build.gradle.kts index e7bd5bb0..71c2d34b 100644 --- a/emarsys-e2e-test/build.gradle.kts +++ b/emarsys-e2e-test/build.gradle.kts @@ -1,8 +1,8 @@ plugins { - alias(libs.plugins.androidLibrary) + alias(libs.plugins.android.library) alias(libs.plugins.kotlin) + alias(libs.plugins.kotlin.allopen) alias(libs.plugins.kapt) - alias(libs.plugins.kotlinAllOpen) } dependencies { @@ -15,6 +15,13 @@ dependencies { } android { namespace = "com.emarsys.test.e2e" + defaultConfig { + compileSdk = libs.versions.android.compileSdk.get().toInt() + } +} + +allOpen { + annotation("com.emarsys.core.Mockable") } kotlin { diff --git a/emarsys-firebase/build.gradle b/emarsys-firebase/build.gradle.kts similarity index 58% rename from emarsys-firebase/build.gradle rename to emarsys-firebase/build.gradle.kts index 8657b869..7e1517ed 100644 --- a/emarsys-firebase/build.gradle +++ b/emarsys-firebase/build.gradle.kts @@ -1,8 +1,8 @@ plugins { - alias(libs.plugins.androidLibrary) + alias(libs.plugins.android.library) alias(libs.plugins.kotlin) + alias(libs.plugins.kotlin.allopen) alias(libs.plugins.kapt) - alias(libs.plugins.kotlinAllOpen) } dependencies { @@ -11,12 +11,19 @@ dependencies { implementation(project(":mobile-engage")) implementation(project(":mobile-engage-api")) - api(libs.google.fcm, { exclude group: 'androidx' }) + api(libs.google.fcm, { exclude(group = "androidx") }) androidTestImplementation(project(":testUtils")) } android { namespace = "com.emarsys.firebase" + defaultConfig { + compileSdk = libs.versions.android.compileSdk.get().toInt() + } +} + +allOpen { + annotation("com.emarsys.core.Mockable") } kotlin { diff --git a/emarsys-huawei/build.gradle.kts b/emarsys-huawei/build.gradle.kts index 8c3ab26e..350ffe3a 100644 --- a/emarsys-huawei/build.gradle.kts +++ b/emarsys-huawei/build.gradle.kts @@ -1,8 +1,9 @@ plugins { - alias(libs.plugins.androidLibrary) + alias(libs.plugins.android.library) alias(libs.plugins.kotlin) + alias(libs.plugins.kotlin.allopen) alias(libs.plugins.kapt) - alias(libs.plugins.kotlinAllOpen) + // alias(libs.plugins.huawei.agconnect) } dependencies { @@ -17,6 +18,13 @@ dependencies { } android { namespace = "com.emarsys.huawei" + defaultConfig { + compileSdk = libs.versions.android.compileSdk.get().toInt() + } +} + +allOpen { + annotation("com.emarsys.core.Mockable") } kotlin { diff --git a/emarsys-sdk/build.gradle.kts b/emarsys-sdk/build.gradle.kts index 30005d8d..caac7482 100644 --- a/emarsys-sdk/build.gradle.kts +++ b/emarsys-sdk/build.gradle.kts @@ -1,8 +1,8 @@ plugins { - alias(libs.plugins.androidLibrary) + alias(libs.plugins.android.library) alias(libs.plugins.kotlin) + alias(libs.plugins.kotlin.allopen) alias(libs.plugins.kapt) - alias(libs.plugins.kotlinAllOpen) } dependencies { @@ -21,6 +21,13 @@ dependencies { android { namespace = "com.emarsys" + defaultConfig { + compileSdk = libs.versions.android.compileSdk.get().toInt() + } +} + +allOpen { + annotation("com.emarsys.core.Mockable") } kotlin { diff --git a/emarsys/build.gradle.kts b/emarsys/build.gradle.kts index 6778a3b5..869078f5 100644 --- a/emarsys/build.gradle.kts +++ b/emarsys/build.gradle.kts @@ -1,8 +1,8 @@ plugins { - alias(libs.plugins.androidLibrary) + alias(libs.plugins.android.library) alias(libs.plugins.kotlin) + alias(libs.plugins.kotlin.allopen) alias(libs.plugins.kapt) - alias(libs.plugins.kotlinAllOpen) } dependencies { @@ -19,6 +19,13 @@ dependencies { } android { namespace = "com.emarsys.inner" + defaultConfig { + compileSdk = libs.versions.android.compileSdk.get().toInt() + } +} + +allOpen { + annotation("com.emarsys.core.Mockable") } kotlin { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 753bd8dd..a142ea2c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,10 @@ [versions] agp = "8.2.2" +kotlin = "1.9.21" +kotlinxCoroutines = "1.7.3" +compose = "1.6.1" +compose-compiler = "1.5.6" +compose-plugin = "1.6.0-dev1419" android-compileSdk = "34" android-minSdk = "28" android-targetSdk = "34" @@ -16,14 +21,9 @@ androidx-lifecycle = "2.7.0" androidx-espresso-idling-resource = "3.5.1" androidx-security-crypto = "1.1.0-alpha06" androidx-navigation-safe-args = "2.5.0" -compose = "1.6.1" -compose-compiler = "1.5.6" -compose-plugin = "1.6.0-dev1419" dokka = "1.9.10" junit = "4.13.2" tink = "1.9.0" -kotlin = "1.9.0" -kotlinxCoroutines = "1.7.3" kotest = "5.8.0" mockk = "1.13.9" fcm = "23.4.0" @@ -36,6 +36,7 @@ mockito = "4.9.0" mockito-kotlin = "4.1.0" grGit = "5.0.0-rc.3" byte-buddy = "1.14.11" +dotEnv = "4.0.0" [libraries] kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" } @@ -82,16 +83,15 @@ androidx-test-fragment = { module = "androidx.fragment:fragment-testing", versio androidx-test-multidex = { module = "androidx.multidex:multidex-instrumentation", version.ref = "androidx-test-runner" } [plugins] -androidApplication = { id = "com.android.application", version.ref = "agp" } -androidLibrary = { id = "com.android.library", version.ref = "agp" } -jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" } -kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } -navigationSafeArgs = { id = "androidx.navigation.safeargs", version.ref = "androidx-navigation-safe-args" } +android-application = { id = "com.android.application", version.ref = "agp" } +android-library = { id = "com.android.library", version.ref = "agp" } +androidx-navigation-safeargs = { id = "androidx.navigation.safeargs", version.ref = "androidx-navigation-safe-args" } kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } kotlin = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } -kotlinAllOpen = { id = "org.jetbrains.kotlin.plugin.allopen", version.ref = "kotlin" } -kotlinSerialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } +kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } +kotlin-allopen = { id = "org.jetbrains.kotlin.plugin.allopen", version.ref = "kotlin" } dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } -agconnect = { id = "com.huawei.agconnect", version.ref = "agconnect_core" } -googleServices = { id = "com.google.gms.google-services", version.ref = "googleServices" } -grGit = { id = "org.ajoberstar.grgit", version.ref = "grGit" } +huawei-agconnect = { id = "com.huawei.agconnect", version.ref = "agconnect_core" } +google-services = { id = "com.google.gms.google-services", version.ref = "googleServices" } +grgit = { id = "org.ajoberstar.grgit", version.ref = "grGit" } +dotenv = { id = "co.uzzu.dotenv.gradle", version.ref = "dotEnv" } diff --git a/mobile-engage-api/build.gradle.kts b/mobile-engage-api/build.gradle.kts index 367d166d..38cc2c3e 100644 --- a/mobile-engage-api/build.gradle.kts +++ b/mobile-engage-api/build.gradle.kts @@ -1,8 +1,8 @@ plugins { - alias(libs.plugins.androidLibrary) + alias(libs.plugins.android.library) alias(libs.plugins.kotlin) + alias(libs.plugins.kotlin.allopen) alias(libs.plugins.kapt) - alias(libs.plugins.kotlinAllOpen) } dependencies { @@ -15,6 +15,13 @@ dependencies { android { namespace = "com.emarsys.mobileengage.api" + defaultConfig { + compileSdk = libs.versions.android.compileSdk.get().toInt() + } +} + +allOpen { + annotation("com.emarsys.core.Mockable") } kotlin { diff --git a/mobile-engage/build.gradle.kts b/mobile-engage/build.gradle.kts index 855380f7..5eb7ffa1 100644 --- a/mobile-engage/build.gradle.kts +++ b/mobile-engage/build.gradle.kts @@ -1,8 +1,9 @@ plugins { - alias(libs.plugins.androidLibrary) + alias(libs.plugins.android.library) alias(libs.plugins.kotlin) + alias(libs.plugins.kotlin.allopen) + alias(libs.plugins.kotlin.parcelize) alias(libs.plugins.kapt) - alias(libs.plugins.kotlinAllOpen) } dependencies { @@ -17,6 +18,13 @@ dependencies { } android { namespace = "com.emarsys.mobileengage" + defaultConfig { + compileSdk = libs.versions.android.compileSdk.get().toInt() + } +} + +allOpen { + annotation("com.emarsys.core.Mockable") } kotlin { diff --git a/predict-api/build.gradle.kts b/predict-api/build.gradle.kts index 80282bc8..33e67fc5 100644 --- a/predict-api/build.gradle.kts +++ b/predict-api/build.gradle.kts @@ -1,6 +1,8 @@ plugins { - alias(libs.plugins.androidLibrary) + alias(libs.plugins.android.library) alias(libs.plugins.kotlin) + alias(libs.plugins.kotlin.allopen) + alias(libs.plugins.kapt) } dependencies { @@ -10,6 +12,13 @@ dependencies { } android { namespace = "com.emarsys.predict.api" + defaultConfig { + compileSdk = libs.versions.android.compileSdk.get().toInt() + } +} + +allOpen { + annotation("com.emarsys.core.Mockable") } kotlin { diff --git a/predict/build.gradle.kts b/predict/build.gradle.kts index f0cef546..331af248 100644 --- a/predict/build.gradle.kts +++ b/predict/build.gradle.kts @@ -1,8 +1,8 @@ plugins { - alias(libs.plugins.androidLibrary) + alias(libs.plugins.android.library) alias(libs.plugins.kotlin) + alias(libs.plugins.kotlin.allopen) alias(libs.plugins.kapt) - alias(libs.plugins.kotlinAllOpen) } dependencies { @@ -15,6 +15,13 @@ dependencies { android { namespace = "com.emarsys.predict" + defaultConfig { + compileSdk = libs.versions.android.compileSdk.get().toInt() + } +} + +allOpen { + annotation("com.emarsys.core.Mockable") } kotlin { diff --git a/sample/build.gradle b/sample/build.gradle deleted file mode 100644 index a89b521c..00000000 --- a/sample/build.gradle +++ /dev/null @@ -1,118 +0,0 @@ -plugins { - alias(libs.plugins.androidApplication) - alias(libs.plugins.kotlin) - alias(libs.plugins.kapt) - alias(libs.plugins.navigationSafeArgs) - alias(libs.plugins.kotlinAllOpen) -} - -group = 'com.emarsys.sample' - -android { - namespace = "com.emarsys.sample" - compileSdkVersion 34 - defaultConfig { - applicationId "com.emarsys.sample" - minSdkVersion 24 - targetSdkVersion 34 - multiDexEnabled true - versionCode gitVersionCode - versionName gitVersionName - testInstrumentationRunner "com.emarsys.sample.testutils.SampleAppTestRunner" - resValue "string", "sdk_version", "${gitVersionName}" - - def clientId = null - def localConfigPropertiesFile = rootProject.file('localConfig.properties') - def localConfigProperties = new Properties() - if (localConfigPropertiesFile.exists()) { - localConfigProperties.load(new FileInputStream(localConfigPropertiesFile)) - clientId = localConfigProperties.getProperty("googleOAuthServerClientId") - } - - buildConfigField "String", "GOOGLE_OAUTH_SERVER_CLIENT_ID", "\"${System.env.GOOGLE_OAUTH_SERVER_CLIENT_ID ?: clientId}\"" - } - - buildFeatures { - compose true - } - - kotlin { - jvmToolchain(17) - } - - composeOptions { - kotlinCompilerExtensionVersion '1.5.1' - kotlinCompilerVersion '1.9.0' - } - - if (project.devConfig.releaseSampleApp || System.env.DEVELOPMENT_MODE) { - signingConfigs { - release { - storePassword System.env.RELEASE_STORE_PASSWORD ?: project.devConfig.releaseStorePassword - keyAlias System.env.RELEASE_KEY_ALIAS ?: project.devConfig.releaseKeyAlias - keyPassword System.env.RELEASE_KEY_PASSWORD ?: project.devConfig.releaseKeyPassword - storeFile file(System.env.RELEASE_STORE_FILE ?: project.devConfig.releaseStoreFile) - } - } - buildTypes { - release { - signingConfig signingConfigs.release - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - } - - buildTypes { - debug { - multiDexKeepProguard file("proguard-multidex-rules.pro") - multiDexEnabled true - } - } - packagingOptions { - resources { - excludes += ['META-INF/LICENSE.md', 'META-INF/LICENSE-notice.md'] - } - } -} - -dependencies { - if (project.devConfig.useLocalDependency == true || System.env.DEVELOPMENT_MODE == true) { - implementation project(':emarsys-sdk') - implementation project(':emarsys-firebase') - implementation project(':emarsys-huawei') - } else { - implementation 'com.emarsys:emarsys-sdk:+' - implementation 'com.emarsys:emarsys-firebase:+' - implementation 'com.emarsys:emarsys-huawei:+' - } - // Getting a "Could not find firebase-core" error? Make sure you have - // the latest Google Repository in the Android SDK manager - - implementation "org.jetbrains.kotlin:kotlin-reflect:1.9.21" - implementation "org.jetbrains.kotlin:kotlin-stdlib:1.9.21" - implementation 'com.google.android.material:material:1.11.0' - implementation 'com.android.support:cardview-v7:28.0.0' - implementation 'com.google.android.gms:play-services-auth:20.7.0' - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'io.coil-kt:coil:2.5.0' - - implementation "androidx.core:core-ktx:1.12.0" - implementation "com.google.android.material:material:1.11.0" - implementation "androidx.compose.ui:ui:1.6.0" - implementation "androidx.compose.material:material:1.6.0" - implementation "androidx.compose.ui:ui-tooling-preview:1.6.0" - implementation "androidx.navigation:navigation-compose:2.7.6" - implementation "androidx.compose.material:material-icons-extended:1.6.0" - implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.7.0" - implementation "androidx.activity:activity-compose:1.8.2" - implementation "io.coil-kt:coil-compose:2.5.0" - implementation "androidx.datastore:datastore-preferences:1.0.0" - implementation "com.chibatching.kotpref:kotpref:2.13.2" - implementation "com.google.firebase:firebase-common-ktx:20.4.2" - implementation "com.google.firebase:firebase-messaging-ktx:23.4.0" - implementation "com.google.android.gms:play-services-auth:20.7.0" - implementation "com.google.accompanist:accompanist-swiperefresh:0.34.0" - implementation "com.google.code.gson:gson:2.10.1" - debugImplementation "androidx.compose.ui:ui-tooling:1.6.0" -} diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts new file mode 100644 index 00000000..043083e2 --- /dev/null +++ b/sample/build.gradle.kts @@ -0,0 +1,122 @@ +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin) + alias(libs.plugins.kotlin.allopen) + alias(libs.plugins.kapt) + alias(libs.plugins.androidx.navigation.safeargs) + alias(libs.plugins.google.services) +// alias(libs.plugins.huawei.agconnect) +} + +group = "com.emarsys.sample" + +android { + namespace = "com.emarsys.sample" + defaultConfig { + applicationId = "com.emarsys.sample" + compileSdk = libs.versions.android.compileSdk.get().toInt() + minSdk = libs.versions.android.minSdk.get().toInt() + lint { + targetSdk = libs.versions.android.targetSdk.get().toInt() + } + multiDexEnabled = true + val version: GitVersion by rootProject.extra + versionCode = version.versionCode + versionName = version.versionName + + testInstrumentationRunner = "com.emarsys.sample.testutils.SampleAppTestRunner" + resValue("string", "sdk_version", version.versionName) + buildConfigField( + "String", + "GOOGLE_OAUTH_SERVER_CLIENT_ID", + "\"${env.GOOGLE_OAUTH_SERVER_CLIENT_ID.value}\"" + ) + } + + buildFeatures { + compose = true + } + + allOpen { + annotation("com.emarsys.core.Mockable") + } + + kotlin { + jvmToolchain(17) + } + + composeOptions { + kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get().toString() + } + + if (env.RELEASE_MODE.orElse("false") == "true") { + signingConfigs { + create("release") { + storePassword = env.ANDROID_RELEASE_STORE_PASSWORD.value + keyAlias = env.ANDROID_RELEASE_KEY_ALIAS.value + keyPassword = env.ANDROID_RELEASE_KEY_PASSWORD.value + storeFile = file(env.ANDROID_RELEASE_STORE_FILE_BASE64.value) + } + } + buildTypes { + getByName("release") { + signingConfig = signingConfigs.getByName("release") + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + } + + buildTypes { + getByName("debug") { + multiDexKeepProguard = file("proguard-multidex-rules.pro") + multiDexEnabled = true + } + } + packagingOptions { + resources { + excludes += arrayOf("META-INF/LICENSE.md", "META-INF/LICENSE-notice.md") + } + } +} + +dependencies { + if (env.USE_LOCAL_DEPENDENCY.orElse("false") == "true") { + implementation(project(":emarsys-sdk")) + implementation(project(":emarsys-firebase")) + implementation(project(":emarsys-huawei")) + } else { + implementation("com.emarsys:emarsys-sdk:+") + implementation("com.emarsys:emarsys-firebase:+") + implementation("com.emarsys:emarsys-huawei:+") + } + // Getting a "Could not find firebase-core" error? Make sure you have + // the latest Google Repository in the Android SDK manager + + implementation("org.jetbrains.kotlin:kotlin-reflect:1.9.21") + implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.21") + implementation("com.google.android.material:material:1.11.0") + implementation("com.android.support:cardview-v7:28.0.0") + implementation("com.google.android.gms:play-services-auth:20.7.0") + implementation("androidx.appcompat:appcompat:1.6.1") + implementation("io.coil-kt:coil:2.5.0") + + implementation("androidx.core:core-ktx:1.12.0") + implementation("com.google.android.material:material:1.11.0") + implementation("androidx.compose.ui:ui:1.6.0") + implementation("androidx.compose.material:material:1.6.0") + implementation("androidx.compose.ui:ui-tooling-preview:1.6.0") + implementation("androidx.navigation:navigation-compose:2.7.6") + implementation("androidx.compose.material:material-icons-extended:1.6.0") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0") + implementation("androidx.activity:activity-compose:1.8.2") + implementation("io.coil-kt:coil-compose:2.5.0") + implementation("androidx.datastore:datastore-preferences:1.0.0") + implementation("com.chibatching.kotpref:kotpref:2.13.2") + implementation("com.google.firebase:firebase-common-ktx:20.4.2") + implementation("com.google.firebase:firebase-messaging-ktx:23.4.0") + implementation("com.google.android.gms:play-services-auth:20.7.0") + implementation("com.google.accompanist:accompanist-swiperefresh:0.34.0") + implementation("com.google.code.gson:gson:2.10.1") + debugImplementation("androidx.compose.ui:ui-tooling:1.6.0") +} \ No newline at end of file diff --git a/sample/proguard-rules.pro b/sample/proguard-rules.pro index 9a66704b..ee71bd71 100644 --- a/sample/proguard-rules.pro +++ b/sample/proguard-rules.pro @@ -2,7 +2,7 @@ # By default, the flags in this file are appended to flags specified # in /Users/jpollak/Library/Android/sdk/tools/proguard/proguard-android.txt # You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. +# directive in build.gradle.kts. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html diff --git a/settings.gradle.kts b/settings.gradle.kts index 58298fdd..97ee31f5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -24,6 +24,7 @@ dependencyResolutionManagement { maven(url = "https://maven.google.com") maven(url = "https://developer.huawei.com/repo/") maven(url = "https://ajoberstar.org/bintray-backup/") + maven(url = "https://androidx.dev/storage/compose-compiler/repository/") } } rootProject.name = "Android Emarsys SDK" diff --git a/testUtils/build.gradle.kts b/testUtils/build.gradle.kts index 45ed1c35..08c54dc6 100644 --- a/testUtils/build.gradle.kts +++ b/testUtils/build.gradle.kts @@ -1,14 +1,16 @@ plugins { - alias(libs.plugins.androidLibrary) + alias(libs.plugins.android.library) alias(libs.plugins.kotlin) } android { namespace = "com.emarsys.testUtil" - compileSdk = 34 + compileSdk = libs.versions.android.compileSdk.get().toInt() defaultConfig { - minSdkVersion(24) - targetSdkVersion(34) + minSdk = libs.versions.android.minSdk.get().toInt() + lint { + targetSdk = libs.versions.android.targetSdk.get().toInt() + } testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } buildTypes {