diff --git a/RingPublishingGDPR/build.gradle b/RingPublishingGDPR/build.gradle index b01a36e..f8b4123 100644 --- a/RingPublishingGDPR/build.gradle +++ b/RingPublishingGDPR/build.gradle @@ -1,25 +1,19 @@ apply plugin: 'com.android.library' apply from: file('publish.gradle') -android -{ +android { namespace 'com.ringpublishing.gdpr' compileSdk APP_COMPILE_SDK_VERSION - compileOptions - { + compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } - defaultConfig - { + defaultConfig { minSdkVersion APP_MIN_SDK_VERSION targetSdkVersion APP_TARGET_SDK_VERSION - - multiDexEnabled true - buildConfigField "String", "CMP_HOST", "\"cmp.ringpublishing.com\"" buildConfigField "String", "CMP_JSON_CONFIGURATION_FIELD_HOST", "\"webview_url\"" buildConfigField "String", "CMP_JSON_CONFIGURATION_FIELD_GDPR_APPLIES", "\"gdpr_applies\"" @@ -36,20 +30,16 @@ android testApplicationId "com.ringpublishing.gdpr.test" } - buildTypes - { - release - { + buildTypes { + release { minifyEnabled false } - tst - { + tst { testCoverageEnabled = true } } - buildFeatures - { + buildFeatures { buildConfig = true } @@ -61,8 +51,7 @@ android useLibrary 'android.test.base' useLibrary 'android.test.mock' - testOptions - { + testOptions { unitTests.includeAndroidResources = true unitTests.returnDefaultValues = true unitTests.all { @@ -78,47 +67,46 @@ android } -dependencies -{ - api "androidx.annotation:annotation:1.7.1" - api "com.google.android.material:material:1.11.0" - api 'androidx.preference:preference:1.2.1' - api 'androidx.appcompat:appcompat:1.6.1' +dependencies { + api libs.annotation + api libs.material + api libs.preference + api libs.appcompat - api "com.squareup.okhttp3:okhttp:4.12.0" - api "com.squareup.retrofit2:retrofit:2.9.0" - api "com.squareup.retrofit2:converter-moshi:2.9.0" - api "com.squareup.retrofit2:converter-gson:2.9.0" + api libs.okhttp3 + api libs.retrofit + api libs.retrofit.moshi + api libs.retrofit.gson // Fix for missing conscrypt hostname verifier in logs - api 'org.conscrypt:conscrypt-android:2.5.2' + api libs.conscrypt.android // Core library - testImplementation "junit:junit:4.13.2" - testImplementation 'androidx.test:core:1.5.0' + testImplementation libs.junit + testImplementation libs.test.core // AndroidJUnitRunner and JUnit Rules - testImplementation 'androidx.test:runner:1.5.2' - testImplementation 'androidx.test:rules:1.5.0' + testImplementation libs.test.runner + testImplementation libs.test.rules // Assertions - testImplementation 'androidx.test.ext:junit:1.1.5' - testImplementation 'androidx.test.ext:truth:1.5.0' - testImplementation 'com.google.truth:truth:1.0' + testImplementation libs.junit.ext + testImplementation libs.test.truth.ext + testImplementation libs.truth - testImplementation 'org.json:json:20220320' + testImplementation libs.json // Core library - androidTestImplementation 'androidx.test:core:1.5.0' + androidTestImplementation libs.test.core // AndroidJUnitRunner and JUnit Rules - androidTestImplementation 'androidx.test:runner:1.5.2' - androidTestImplementation 'androidx.test:rules:1.5.0' + androidTestImplementation libs.test.runner + androidTestImplementation libs.test.rules // Assertions - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.ext:truth:1.5.0' - androidTestImplementation 'com.google.truth:truth:1.0' + androidTestImplementation libs.junit.ext + androidTestImplementation libs.test.truth.ext + androidTestImplementation libs.truth } diff --git a/bamboo.gradle b/bamboo.gradle deleted file mode 100644 index 9b8e2ad..0000000 --- a/bamboo.gradle +++ /dev/null @@ -1,27 +0,0 @@ -// -=-=-=-=-= Bamboo Section =-=-=-=-=- -def buildAliases = [ -'stageClean' : ['clean'], -'stageBuild' : ['clean', 'assemble'], -'stageProfile' : ['dependencyUpdates', 'projectReport'], - -'stageStaticAnalysis' : ['clean', 'assemble', 'lint'], - -'stageJvmTest' : ['clean', 'test'], -'stageAndroidTest' : ['uninstallAll', 'clean', ':RingPublishingGDPR:connectedAndroidTest', 'createTstCoverageReport'], - -'stageReleaseSnapshot': ['clean', ':RingPublishingGDPR:assembleRelease', ':RingPublishingGDPR:artifactoryPublish'], - -'stageTagRepository' : ['tagRepository'], -'' : ['', ''], -] - -def expandedTaskList = [] - -gradle.startParameter.taskNames.each { - expandedTaskList << (buildAliases[it] ? buildAliases[it] : it) -} - -gradle.startParameter.taskNames = expandedTaskList.flatten() -// -=-=-=-=-= End Bamboo =-=-=-=-=- -//build.mustRunAfter clean -//uploadArchives.mustRunAfter build diff --git a/build.gradle b/build.gradle index 2dd17ed..120c578 100644 --- a/build.gradle +++ b/build.gradle @@ -1,23 +1,21 @@ -buildscript -{ - repositories - { +buildscript { + repositories { google() + mavenCentral() gradlePluginPortal() } - dependencies - { - classpath "com.android.tools.build:gradle:8.6.0" - classpath "com.github.ben-manes:gradle-versions-plugin:0.43.0" - classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.24.18" + dependencies { + classpath libs.classpath.gradle.tools + classpath libs.classpath.gradle.versions + classpath libs.classpath.jfrog.info + + classpath libs.classpath.kotlin } } -allprojects -{ - repositories - { +allprojects { + repositories { mavenCentral() google() @@ -36,9 +34,8 @@ tasks.register('clean', Delete) { delete rootProject.buildDir } -project.ext { +ext { APP_MIN_SDK_VERSION = 24 APP_COMPILE_SDK_VERSION = 35 APP_TARGET_SDK_VERSION = 35 - APP_BUILD_TOOLS_VERSION = '35.0.0' } diff --git a/demo/build.gradle b/demo/build.gradle index f2db378..1165d6b 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -1,5 +1,4 @@ apply plugin: 'com.android.application' -apply from: '../bamboo.gradle' android { namespace 'com.ringpublishing.gdpr.demo' @@ -84,12 +83,11 @@ dependencies //Then comment 'implementation project(path: ':RingPublishingGDPR')' and uncomment: //implementation("com.ringpublishing:gdpr:1.5.3") - implementation "androidx.multidex:multidex:2.0.1" - implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2' - implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2' + implementation libs.lifecycle.livedata + implementation libs.lifecycle.viewmodel - implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) + implementation(platform(libs.kotlin.bom)) - debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.12' - debugImplementation 'com.squareup.curtains:curtains:1.2.4' + debugImplementation libs.leakcanary.android + debugImplementation libs.curtains } diff --git a/demo/fabric.properties b/demo/fabric.properties deleted file mode 100644 index e9f8d09..0000000 --- a/demo/fabric.properties +++ /dev/null @@ -1,4 +0,0 @@ -#Contains API Secret used to validate your application. Commit to internal source control; avoid making secret public. -#Wed May 04 09:30:18 CEST 2016 -apiKey=b7868f1a601bac93a7353bd5ec2dae71e4b540e5 -apiSecret=aa3a94a2e2c9066a232955f7b9a401765e63bdc75a0989f5b8b1709fbee9b580 diff --git a/demo/src/main/java/com/ringpublishing/gdpr/demo/DemoApplication.java b/demo/src/main/java/com/ringpublishing/gdpr/demo/DemoApplication.java index 2c81592..4743c42 100644 --- a/demo/src/main/java/com/ringpublishing/gdpr/demo/DemoApplication.java +++ b/demo/src/main/java/com/ringpublishing/gdpr/demo/DemoApplication.java @@ -1,5 +1,6 @@ package com.ringpublishing.gdpr.demo; +import android.app.Application; import android.graphics.Color; import android.graphics.Typeface; import android.text.TextUtils; @@ -7,8 +8,6 @@ import android.webkit.WebView; import android.widget.Toast; -import androidx.multidex.MultiDexApplication; - import com.ringpublishing.gdpr.BuildConfig; import com.ringpublishing.gdpr.LogListener; import com.ringpublishing.gdpr.RingPublishingGDPR; @@ -16,7 +15,7 @@ import com.ringpublishing.gdpr.RingPublishingGDPRListener; import com.ringpublishing.gdpr.RingPublishingGDPRUIConfig; -public class DemoApplication extends MultiDexApplication { +public class DemoApplication extends Application { private final RingPublishingGDPR ringPublishingGDPR = RingPublishingGDPR.getInstance(); diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..c72cfbc --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,58 @@ +[versions] +conscrypt-android = "2.5.2" +curtains = "1.2.4" +json = "20220320" +junit-ext = "1.1.5" +kotlin = "2.0.21" +annotation = "1.7.0" +appcompat = "1.7.1" +material = "1.12.0" +preference = "1.2.1" +lifecycle = "2.6.+" +okhttp3 = "4.12.0" +retrofit = "2.12.0" +test-rules = "1.5.0" +test-runner = "1.5.2" +test-truth = "1.5.0" +truth = "1.1.3" +junit = "4.13.2" +test-core = "1.6.1" +leakcanary-android = "2.+" + +gradle-tools = "8.6.1" +gradle-versions = "0.52.+" +gradle-jfrog-info = "5.2.+" + +[libraries] +annotation = { group = "androidx.annotation", name = "annotation", version.ref = "annotation" } +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +curtains = { module = "com.squareup.curtains:curtains", version.ref = "curtains" } +lifecycle-livedata = { group = "androidx.lifecycle", name = "lifecycle-livedata-ktx", version.ref = "lifecycle" } +lifecycle-viewmodel = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycle" } +preference = { group = "androidx.preference", name = "preference-ktx", version.ref = "preference" } + +conscrypt-android = { group = "org.conscrypt", name = "conscrypt-android", version.ref = "conscrypt-android" } +material = { group = "com.google.android.material", name = "material", version.ref = "material" } +kotlin-bom = { group = "org.jetbrains.kotlin", name = "kotlin-bom", version.ref = "kotlin" } +leakcanary-android = { group = "com.squareup.leakcanary", name = "leakcanary-android", version.ref = "leakcanary-android" } +retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit" } +retrofit-gson = { group = "com.squareup.retrofit2", name = "converter-gson", version.ref = "retrofit" } +retrofit-moshi = { group = "com.squareup.retrofit2", name = "converter-moshi", version.ref = "retrofit" } +okhttp3 = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp3" } + +# Test +test-core = { group = "androidx.test", name = "core", version.ref = "test-core" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +test-runner = { group = "androidx.test", name = "runner", version.ref = "test-runner" } +test-rules = { group = "androidx.test", name = "rules", version.ref = "test-rules" } +junit-ext = { group = "androidx.test.ext", name = "junit", version.ref = "junit-ext" } +json = { group = "org.json", name = "json", version.ref = "json" } +truth = { group = "com.google.truth", name = "truth", version.ref = "truth" } +test-truth-ext = { group = "androidx.test.ext", name = "truth", version.ref = "test-truth" } + + +# Classpath +classpath-gradle-tools = { group = "com.android.tools.build", name = "gradle", version.ref = "gradle-tools" } +classpath-gradle-versions = { group = "com.github.ben-manes", name = "gradle-versions-plugin", version.ref = "gradle-versions" } +classpath-jfrog-info = { group = "org.jfrog.buildinfo", name = "build-info-extractor-gradle", version.ref = "gradle-jfrog-info" } +classpath-kotlin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c674402..a8382d7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists \ No newline at end of file