From ef2e39c1ef0c717f2259866aa9abc3c4f695faf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernat=20Borr=C3=A1s?= Date: Tue, 8 Jun 2021 10:14:34 +0200 Subject: [PATCH 1/5] Move library/build.gradle to kts --- library/build.gradle | 38 -------------------------------- library/build.gradle.kts | 44 ++++++++++++++++++++++++++++++++++++++ library/proguard-rules.pro | 2 +- sample/proguard-rules.pro | 2 +- 4 files changed, 46 insertions(+), 40 deletions(-) delete mode 100644 library/build.gradle create mode 100644 library/build.gradle.kts diff --git a/library/build.gradle b/library/build.gradle deleted file mode 100644 index a4f499e27..000000000 --- a/library/build.gradle +++ /dev/null @@ -1,38 +0,0 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply from: '../config/android-quality.gradle' - -android { - compileSdkVersion compileSdkVersionDeclared - - defaultConfig { - minSdkVersion minSdkVersionDeclared - targetSdkVersion compileSdkVersionDeclared - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - lintOptions { - disable 'InvalidPackage' - } - kotlinOptions.freeCompilerArgs += ["-module-name", "barista"] -} - -dependencies { - api 'androidx.test.espresso:espresso-core:3.1.1' - api 'androidx.test.espresso:espresso-contrib:3.1.1' - api 'androidx.test.uiautomator:uiautomator:2.2.0' - api 'androidx.test.espresso:espresso-intents:3.1.1' - - implementation 'androidx.annotation:annotation:1.0.2' - implementation 'androidx.legacy:legacy-support-core-ui:1.0.0' - implementation 'androidx.vectordrawable:vectordrawable-animated:1.0.0' - implementation 'androidx.recyclerview:recyclerview:1.0.0' - api 'androidx.viewpager2:viewpager2:1.0.0' - - implementation 'com.google.android.material:material:1.2.0' - - testImplementation 'junit:junit:4.12' - testImplementation 'pl.pragmatists:JUnitParams:1.1.0' - testImplementation 'org.assertj:assertj-core:1.7.0' - testImplementation 'org.mockito:mockito-core:2.28.2' -} diff --git a/library/build.gradle.kts b/library/build.gradle.kts new file mode 100644 index 000000000..4b1c82382 --- /dev/null +++ b/library/build.gradle.kts @@ -0,0 +1,44 @@ +plugins { + id("com.android.library") + kotlin("android") +} + +apply(from= "../config/android-quality.gradle") + +android { + compileSdk = ext["compileSdkVersionDeclared"] as Int + + defaultConfig { + minSdk = ext["minSdkVersionDeclared"] as Int + targetSdk = ext["compileSdkVersionDeclared"] as Int + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + lintOptions { + disable.add("InvalidPackage") + } + + kotlinOptions { + freeCompilerArgs = freeCompilerArgs + listOf("-module-name=barista") + } +} + +dependencies { + api("androidx.test.espresso:espresso-core:3.1.1") + api("androidx.test.espresso:espresso-contrib:3.1.1") + api("androidx.test.uiautomator:uiautomator:2.2.0") + api("androidx.test.espresso:espresso-intents:3.1.1") + + implementation("androidx.annotation:annotation:1.0.2") + implementation("androidx.legacy:legacy-support-core-ui:1.0.0") + implementation("androidx.vectordrawable:vectordrawable-animated:1.0.0") + implementation("androidx.recyclerview:recyclerview:1.0.0") + api("androidx.viewpager2:viewpager2:1.0.0") + + implementation("com.google.android.material:material:1.2.0") + + testImplementation("junit:junit:4.12") + testImplementation("pl.pragmatists:JUnitParams:1.1.0") + testImplementation("org.assertj:assertj-core:1.7.0") + testImplementation("org.mockito:mockito-core:2.28.2") +} diff --git a/library/proguard-rules.pro b/library/proguard-rules.pro index 5fcc082a5..00e127530 100644 --- a/library/proguard-rules.pro +++ b/library/proguard-rules.pro @@ -2,7 +2,7 @@ # By default, the flags in this file are appended to flags specified # in /Users/roc/.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/sample/proguard-rules.pro b/sample/proguard-rules.pro index 5fcc082a5..00e127530 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/roc/.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 From 28193a17e3899c989bbee6b241481305d7cb5c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernat=20Borr=C3=A1s?= Date: Tue, 8 Jun 2021 10:21:12 +0200 Subject: [PATCH 2/5] Move sample/build.gradle to kts --- sample/build.gradle | 52 --------------------------------------- sample/build.gradle.kts | 50 +++++++++++++++++++++++++++++++++++++ sample/proguard-rules.pro | 2 +- 3 files changed, 51 insertions(+), 53 deletions(-) delete mode 100644 sample/build.gradle create mode 100644 sample/build.gradle.kts diff --git a/sample/build.gradle b/sample/build.gradle deleted file mode 100644 index 2adb1e9d7..000000000 --- a/sample/build.gradle +++ /dev/null @@ -1,52 +0,0 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' -apply from: '../config/android-quality.gradle' - -android { - compileSdkVersion compileSdkVersionDeclared - defaultConfig { - applicationId "com.schibsted.spain.barista.sample" - minSdkVersion minSdkVersionDeclared - targetSdkVersion compileSdkVersionDeclared - versionCode 1 - versionName "1.0" - vectorDrawables.useSupportLibrary = true - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - testInstrumentationRunnerArguments clearPackageData: 'true' - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - testOptions { - execution 'ANDROIDX_TEST_ORCHESTRATOR' - } -} - -dependencies { - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'androidx.appcompat:appcompat:1.0.2' - implementation 'androidx.recyclerview:recyclerview:1.0.0' - implementation 'com.google.android.material:material:1.2.0' - implementation 'androidx.annotation:annotation:1.0.2' - implementation 'com.github.bumptech.glide:glide:4.10.0' - implementation 'com.google.android.material:material:1.2.0' - implementation 'androidx.core:core-ktx:1.0.1' - - androidTestUtil 'androidx.test:orchestrator:1.3.0' - androidTestImplementation project(':library') - androidTestImplementation "org.assertj:assertj-core:2.9.1" - androidTestImplementation "com.nhaarman:mockito-kotlin:1.5.0" - androidTestImplementation "org.mockito:mockito-android:2.28.2" - - testImplementation 'junit:junit:4.12' - -} \ No newline at end of file diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts new file mode 100644 index 000000000..3d447c8ce --- /dev/null +++ b/sample/build.gradle.kts @@ -0,0 +1,50 @@ +plugins { + id("com.android.application") + id("kotlin-android-extensions") + kotlin("android") +} + +apply(from = "../config/android-quality.gradle") + +android { + compileSdk = ext["compileSdkVersionDeclared"] as Int + + defaultConfig { + minSdk = ext["minSdkVersionDeclared"] as Int + targetSdk = ext["compileSdkVersionDeclared"] as Int + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + testInstrumentationRunnerArguments["clearPackageData"] = "true" + + vectorDrawables.useSupportLibrary = true + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + testOptions { + execution = "ANDROIDX_TEST_ORCHESTRATOR" + } +} + +dependencies { + implementation("androidx.legacy:legacy-support-v4:1.0.0") + implementation("androidx.appcompat:appcompat:1.0.2") + implementation("androidx.recyclerview:recyclerview:1.0.0") + implementation("com.google.android.material:material:1.2.0") + implementation("androidx.annotation:annotation:1.0.2") + implementation("com.github.bumptech.glide:glide:4.10.0") + implementation("com.google.android.material:material:1.2.0") + implementation("androidx.core:core-ktx:1.0.1") + + androidTestUtil("androidx.test:orchestrator:1.3.0") + androidTestImplementation(project(":library")) + androidTestImplementation("org.assertj:assertj-core:2.9.1") + androidTestImplementation("com.nhaarman:mockito-kotlin:1.5.0") + androidTestImplementation("org.mockito:mockito-android:2.28.2") + + testImplementation("junit:junit:4.12") + +} \ No newline at end of file diff --git a/sample/proguard-rules.pro b/sample/proguard-rules.pro index 00e127530..9ebabe9da 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/roc/.android-sdk/tools/proguard/proguard-android.txt # You can edit the include path and order by changing the proguardFiles -# directive in build.gradle.kts. +# directive in build.gradle.kts.kts. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html From a8717bb6f954299e82cbcd6034423cb529c5098b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernat=20Borr=C3=A1s?= Date: Tue, 8 Jun 2021 10:29:59 +0200 Subject: [PATCH 3/5] Move root build.gradle to kts --- build.gradle | 29 ----------------------------- build.gradle.kts | 21 +++++++++++++++++++++ library/build.gradle.kts | 6 +++--- sample/build.gradle.kts | 6 +++--- 4 files changed, 27 insertions(+), 35 deletions(-) delete mode 100644 build.gradle create mode 100644 build.gradle.kts diff --git a/build.gradle b/build.gradle deleted file mode 100644 index f5b3b8a8f..000000000 --- a/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -buildscript { - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:4.2.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.32" - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} - -ext.minSdkVersionDeclared = 19 -ext.compileSdkVersionDeclared = 30 - -ext.supportLibVersion = '27.1.1' -ext.espressoVersion = '3.0.2' -ext.uiAutomatorVersion = '2.1.3' -ext.baristaVersion = '3.10.0' diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..7bb12ec21 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,21 @@ +buildscript { + repositories { + google() + mavenCentral() + } + dependencies { + classpath("com.android.tools.build:gradle:4.2.1") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.32") + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +task("clean") { + setDelete(rootProject.buildDir) +} \ No newline at end of file diff --git a/library/build.gradle.kts b/library/build.gradle.kts index 4b1c82382..5ab776cca 100644 --- a/library/build.gradle.kts +++ b/library/build.gradle.kts @@ -6,11 +6,11 @@ plugins { apply(from= "../config/android-quality.gradle") android { - compileSdk = ext["compileSdkVersionDeclared"] as Int + compileSdk = 30 defaultConfig { - minSdk = ext["minSdkVersionDeclared"] as Int - targetSdk = ext["compileSdkVersionDeclared"] as Int + minSdk = 19 + targetSdk = 30 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index 3d447c8ce..93cf502d6 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -7,11 +7,11 @@ plugins { apply(from = "../config/android-quality.gradle") android { - compileSdk = ext["compileSdkVersionDeclared"] as Int + compileSdk = 30 defaultConfig { - minSdk = ext["minSdkVersionDeclared"] as Int - targetSdk = ext["compileSdkVersionDeclared"] as Int + minSdk = 19 + targetSdk = 30 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunnerArguments["clearPackageData"] = "true" From 102e33e66f1281ed84a4129558d3c1e95f811320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernat=20Borr=C3=A1s?= Date: Tue, 8 Jun 2021 10:35:52 +0200 Subject: [PATCH 4/5] Fix compile arg --- library/build.gradle.kts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/library/build.gradle.kts b/library/build.gradle.kts index 5ab776cca..b6f498165 100644 --- a/library/build.gradle.kts +++ b/library/build.gradle.kts @@ -17,10 +17,6 @@ android { lintOptions { disable.add("InvalidPackage") } - - kotlinOptions { - freeCompilerArgs = freeCompilerArgs + listOf("-module-name=barista") - } } dependencies { From 4880e1f29f061b87dae0fb366223e6ab47a7f48d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernat=20Borr=C3=A1s?= Date: Tue, 8 Jun 2021 11:15:33 +0200 Subject: [PATCH 5/5] Remvove proguard files --- library/proguard-rules.pro | 17 ----------------- sample/proguard-rules.pro | 17 ----------------- 2 files changed, 34 deletions(-) delete mode 100644 library/proguard-rules.pro delete mode 100644 sample/proguard-rules.pro diff --git a/library/proguard-rules.pro b/library/proguard-rules.pro deleted file mode 100644 index 00e127530..000000000 --- a/library/proguard-rules.pro +++ /dev/null @@ -1,17 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /Users/roc/.android-sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/sample/proguard-rules.pro b/sample/proguard-rules.pro deleted file mode 100644 index 9ebabe9da..000000000 --- a/sample/proguard-rules.pro +++ /dev/null @@ -1,17 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /Users/roc/.android-sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle.kts.kts. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#}