Simplify gradle build configuration
This commit is contained in:
parent
e909eaf656
commit
b2f89b4471
@ -5,15 +5,6 @@ plugins {
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "com.readrops.api"
|
namespace = "com.readrops.api"
|
||||||
compileSdkVersion(34)
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
minSdkVersion(21)
|
|
||||||
targetSdkVersion(34)
|
|
||||||
buildToolsVersion("34.0.0")
|
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
getByName("androidTest") {
|
getByName("androidTest") {
|
||||||
@ -21,33 +12,16 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
isMinifyEnabled = true
|
|
||||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
|
||||||
}
|
|
||||||
|
|
||||||
debug {
|
|
||||||
isMinifyEnabled = false
|
|
||||||
isTestCoverageEnabled = true
|
|
||||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
|
||||||
}
|
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = "17"
|
|
||||||
freeCompilerArgs = listOf("-Xstring-concat=inline")
|
freeCompilerArgs = listOf("-Xstring-concat=inline")
|
||||||
}
|
}
|
||||||
|
|
||||||
lint {
|
lint {
|
||||||
abortOnError = false
|
abortOnError = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
//implementation fileTree(dir: "libs", include: ["*.jar"])
|
|
||||||
implementation(project(":db"))
|
implementation(project(":db"))
|
||||||
|
|
||||||
testImplementation("junit:junit:4.13")
|
testImplementation("junit:junit:4.13")
|
||||||
|
@ -3,18 +3,15 @@ plugins {
|
|||||||
kotlin("android")
|
kotlin("android")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "com.readrops.app"
|
namespace = "com.readrops.app"
|
||||||
compileSdk = 34
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "com.readrops.app"
|
applicationId = "com.readrops.app"
|
||||||
minSdk = 21
|
|
||||||
targetSdk = 34
|
|
||||||
versionCode = 15
|
versionCode = 15
|
||||||
versionName = "2.0-beta01"
|
versionName = "2.0-beta01"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@ -33,17 +30,6 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
|
||||||
isCoreLibraryDesugaringEnabled = true
|
|
||||||
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = "17"
|
|
||||||
}
|
|
||||||
|
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
buildConfig = true
|
buildConfig = true
|
||||||
compose = true
|
compose = true
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
import com.android.build.gradle.AppPlugin
|
||||||
|
import com.android.build.gradle.BaseExtension
|
||||||
|
import com.android.build.gradle.LibraryExtension
|
||||||
|
import com.android.build.gradle.LibraryPlugin
|
||||||
|
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
val kotlin_version = "1.8.0"
|
val kotlin_version = "1.8.0"
|
||||||
@ -7,8 +11,9 @@ buildscript {
|
|||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath("com.android.tools.build:gradle:8.1.1")
|
classpath("com.android.tools.build:gradle:8.1.4")
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
|
||||||
classpath("org.jacoco:org.jacoco.core:0.8.7")
|
classpath("org.jacoco:org.jacoco.core:0.8.7")
|
||||||
}
|
}
|
||||||
@ -29,11 +34,51 @@ allprojects {
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
subprojects {
|
||||||
val compileSdkVersion = 34
|
afterEvaluate {
|
||||||
val minSdkVersion = 21
|
tasks.withType<KotlinJvmCompile> {
|
||||||
val targetSdkVersion = 34
|
kotlinOptions {
|
||||||
val buildToolsVersion = "34.0.0"
|
jvmTarget = JavaVersion.VERSION_17.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins.withType<AppPlugin> {
|
||||||
|
configure<BaseExtension> {
|
||||||
|
configure(this)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
plugins.withType<LibraryPlugin> {
|
||||||
|
configure<LibraryExtension> {
|
||||||
|
configure(this)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fun configure(extension: BaseExtension) = with(extension) {
|
||||||
|
compileSdkVersion(34)
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk = 21
|
||||||
|
targetSdk = 34
|
||||||
|
buildToolsVersion = "34.0.0"
|
||||||
|
|
||||||
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
|
||||||
|
isCoreLibraryDesugaringEnabled = true
|
||||||
|
}
|
||||||
|
|
||||||
|
lintOptions.isAbortOnError = false
|
||||||
|
|
||||||
|
/*dependencies {
|
||||||
|
add("coreLibraryDesugaring", libs.jdk.desugar)
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register<Delete>("clean") {
|
tasks.register<Delete>("clean") {
|
||||||
@ -66,7 +111,7 @@ tasks.register("jacocoFullReport", JacocoReport) {
|
|||||||
//dependsOn ":app:connectedAndroidTest"
|
//dependsOn ":app:connectedAndroidTest"
|
||||||
dependsOn ":db:connectedAndroidTest"*/
|
dependsOn ":db:connectedAndroidTest"*/
|
||||||
|
|
||||||
//final fileFilter = ["**/R.class", "**/R\$*.class", "**/BuildConfig.*", "**/Manifest*.*", "android/**/*.*"]
|
//final fileFilter = ["**/R.class", "**/R\$*.class", "**/BuildConfig.*", "**/Manifest*.*", "android/**/*.*"]
|
||||||
|
|
||||||
/* classDirectories.setFrom files([
|
/* classDirectories.setFrom files([
|
||||||
//fileTree(dir: "$project.rootDir/app/build/intermediates/javac/debug", excludes: fileFilter),
|
//fileTree(dir: "$project.rootDir/app/build/intermediates/javac/debug", excludes: fileFilter),
|
||||||
|
@ -7,13 +7,8 @@ plugins {
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "com.readrops.db"
|
namespace = "com.readrops.db"
|
||||||
compileSdk = 34
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdk = 21
|
|
||||||
targetSdk = 34
|
|
||||||
buildToolsVersion ="34.0.0"
|
|
||||||
|
|
||||||
javaCompileOptions {
|
javaCompileOptions {
|
||||||
annotationProcessorOptions {
|
annotationProcessorOptions {
|
||||||
arguments += mapOf(
|
arguments += mapOf(
|
||||||
@ -23,7 +18,6 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
||||||
consumerProguardFiles("consumer-rules.pro")
|
consumerProguardFiles("consumer-rules.pro")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,30 +27,6 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
isMinifyEnabled = true
|
|
||||||
proguardFiles(
|
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
||||||
"proguard-rules.pro"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
debug {
|
|
||||||
isMinifyEnabled = false
|
|
||||||
isTestCoverageEnabled = true
|
|
||||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
|
||||||
}
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = "17"
|
|
||||||
}
|
|
||||||
lint {
|
lint {
|
||||||
abortOnError = false
|
abortOnError = false
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user