Merge remote-tracking branch 'origin/kts' into kts
This commit is contained in:
commit
b6f2ab2d21
10 changed files with 197 additions and 19 deletions
|
@ -15,6 +15,8 @@ plugins {
|
|||
|
||||
apply(from = "${project.rootDir}/core/main/android_dependencies.gradle")
|
||||
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")
|
||||
apply(from = "${project.rootDir}/core/main/test_dependencies.gradle")
|
||||
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
@ -75,7 +77,7 @@ fun gitAvailable(): Boolean {
|
|||
} catch (ignored: Exception) {
|
||||
return false // NoGitSystemAvailable
|
||||
}
|
||||
return !stringBuilder.toString().isEmpty()
|
||||
return stringBuilder.toString().isNotEmpty()
|
||||
|
||||
}
|
||||
|
||||
|
@ -223,8 +225,6 @@ dependencies {
|
|||
api(Libs.Rx.rxDogTag)
|
||||
}
|
||||
|
||||
apply(from = "${project.rootDir}/core/main/test_dependencies.gradle")
|
||||
|
||||
println("-------------------")
|
||||
println("isMaster: ${isMaster()}")
|
||||
println("gitAvailable: ${gitAvailable()}")
|
||||
|
|
|
@ -75,7 +75,6 @@ buildscript {
|
|||
|
||||
plugins {
|
||||
id("org.jlleitschuh.gradle.ktlint") version "11.6.1"
|
||||
id("org.jetbrains.kotlin.android") version Libs.Kotlin.kotlin apply false
|
||||
}
|
||||
|
||||
allprojects {
|
||||
|
|
|
@ -1,7 +1,22 @@
|
|||
object KtsBuildVersions {
|
||||
|
||||
const val gradle = "8.1.2"
|
||||
const val kotlin = "1.9.0"
|
||||
}
|
||||
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
`kotlin-dsl-precompiled-script-plugins`
|
||||
}
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("com.android.tools.build:gradle:${KtsBuildVersions.gradle}")
|
||||
implementation(kotlin("gradle-plugin", version = KtsBuildVersions.kotlin))
|
||||
implementation(kotlin("allopen", version = KtsBuildVersions.kotlin))
|
||||
}
|
|
@ -5,6 +5,7 @@ object Libs {
|
|||
|
||||
const val kotlin = "1.9.10"
|
||||
|
||||
const val test = "org.jetbrains.kotlin:kotlin-test:$kotlin"
|
||||
}
|
||||
|
||||
object KotlinX {
|
||||
|
@ -21,6 +22,14 @@ object Libs {
|
|||
const val appCompat = "androidx.appcompat:appcompat:1.6.1"
|
||||
const val preference = "androidx.preference:preference-ktx:1.2.1"
|
||||
const val workRuntimeKtx = "androidx.work:work-runtime-ktx:2.8.1"
|
||||
|
||||
object Test {
|
||||
|
||||
const val espressoCore = "androidx.test.espresso:espresso-core:3.5.1"
|
||||
const val extKtx = "androidx.test.ext:junit-ktx:1.1.5"
|
||||
const val rules = "androidx.test:rules:1.5.0"
|
||||
const val uiAutomator = "androidx.test.uiautomator:uiautomator:2.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
object Google {
|
||||
|
@ -28,6 +37,8 @@ object Libs {
|
|||
|
||||
const val measurementApi = "com.google.android.gms:play-services-measurement-api:21.3.0"
|
||||
}
|
||||
|
||||
const val truth = "com.google.truth:truth:1.1.5"
|
||||
}
|
||||
|
||||
object Dagger {
|
||||
|
@ -59,12 +70,25 @@ object Libs {
|
|||
const val logbackAndroid = "com.github.tony19:logback-android:2.0.0"
|
||||
}
|
||||
|
||||
const val joda = "net.danlew:android.joda:2.12.5"
|
||||
const val androidSvg = "com.caverock:androidsvg:1.4"
|
||||
object JUnit {
|
||||
|
||||
private const val junitVersion = "5.10.0"
|
||||
|
||||
const val jupiter = "org.junit.jupiter:junit-jupiter:$junitVersion"
|
||||
const val jupiterApi = "org.junit.jupiter:junit-jupiter-api:$junitVersion"
|
||||
}
|
||||
|
||||
object Mockito {
|
||||
|
||||
const val jupiter = "org.mockito:mockito-junit-jupiter:5.6.0"
|
||||
const val kotlin = "org.mockito.kotlin:mockito-kotlin:5.1.0"
|
||||
}
|
||||
|
||||
const val androidSvg = "com.caverock:androidsvg:1.4"
|
||||
const val joda = "net.danlew:android.joda:2.12.5"
|
||||
const val json = "org.json:json:20230618"
|
||||
const val jsonAssert = "org.skyscreamer:jsonassert:1.5.0"
|
||||
|
||||
const val rxjava = "3.1.7"
|
||||
const val rxandroid = "3.0.2"
|
||||
const val rxkotlin = "3.0.1"
|
||||
const val room = "2.5.2"
|
||||
const val lifecycle = "2.6.2"
|
||||
const val coroutines = "1.7.3"
|
||||
|
@ -82,11 +106,9 @@ object Libs {
|
|||
const val guava = "32.1.3-jre"
|
||||
const val work = "2.8.1"
|
||||
const val tink = "1.10.0"
|
||||
const val json = "20230618"
|
||||
const val swipe = "1.1.0"
|
||||
|
||||
const val junit = "4.13.2"
|
||||
const val junit_jupiter = "5.10.0"
|
||||
const val mockito = "5.6.0"
|
||||
const val dexmaker = "1.2"
|
||||
const val retrofit2 = "2.9.0"
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
import org.gradle.api.JavaVersion
|
||||
|
||||
object Versions {
|
||||
|
||||
const val appVersion = "3.2.0-dev-m"
|
||||
const val versionCode = 1500
|
||||
|
||||
const val ndkVersion = "21.1.6352462"
|
||||
|
||||
const val compileSdk = 34
|
||||
const val minSdk = 28
|
||||
const val wearMinSdk = 26
|
||||
|
||||
val javaVersion = JavaVersion.VERSION_11
|
||||
}
|
12
buildSrc/src/main/kotlin/all-open-dependencies.gradle.kts
Normal file
12
buildSrc/src/main/kotlin/all-open-dependencies.gradle.kts
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
plugins {
|
||||
id("com.android.library")
|
||||
id("kotlin-android")
|
||||
id("kotlin-kapt")
|
||||
id("kotlin-allopen")
|
||||
}
|
||||
|
||||
allOpen {
|
||||
// allows mocking for classes w/o directly opening them for release builds
|
||||
annotation("app.aaps.annotations.OpenForTesting")
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
plugins {
|
||||
id("com.android.library")
|
||||
id("kotlin-android")
|
||||
id("kotlin-kapt")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = Versions.compileSdk
|
||||
defaultConfig {
|
||||
minSdk = 28
|
||||
@Suppress("DEPRECATION")
|
||||
targetSdk = 28
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
viewBinding = true
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
named("release") {
|
||||
isMinifyEnabled = false
|
||||
setProguardFiles(listOf(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"))
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
named("main") {
|
||||
jniLibs.srcDirs(listOf("src/main/jniLibs"))
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = Versions.javaVersion
|
||||
targetCompatibility = Versions.javaVersion
|
||||
}
|
||||
|
||||
lint {
|
||||
checkReleaseBuilds = false
|
||||
disable += "MissingTranslation"
|
||||
disable += "ExtraTranslation"
|
||||
}
|
||||
|
||||
flavorDimensions.add("standard")
|
||||
productFlavors {
|
||||
create("full") {
|
||||
isDefault = true
|
||||
dimension = "standard"
|
||||
}
|
||||
create("pumpcontrol") {
|
||||
dimension = "standard"
|
||||
}
|
||||
create("aapsclient") {
|
||||
dimension = "standard"
|
||||
}
|
||||
create("aapsclient2") {
|
||||
dimension = "standard"
|
||||
}
|
||||
}
|
||||
|
||||
// disable for modules here
|
||||
buildFeatures {
|
||||
buildConfig = false
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
kapt(Libs.Dagger.androidProcessor)
|
||||
kapt(Libs.Dagger.compiler)
|
||||
}
|
53
buildSrc/src/main/kotlin/test-dependencies.gradle.kts
Normal file
53
buildSrc/src/main/kotlin/test-dependencies.gradle.kts
Normal file
|
@ -0,0 +1,53 @@
|
|||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||
|
||||
plugins {
|
||||
id("com.android.library")
|
||||
id("kotlin-android")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation(Libs.Kotlin.test)
|
||||
testImplementation(Libs.JUnit.jupiter)
|
||||
testImplementation(Libs.JUnit.jupiterApi)
|
||||
testImplementation(Libs.json)
|
||||
testImplementation(Libs.Mockito.jupiter)
|
||||
testImplementation(Libs.Mockito.kotlin)
|
||||
testImplementation(Libs.joda)
|
||||
testImplementation(Libs.Google.truth)
|
||||
testImplementation(Libs.jsonAssert)
|
||||
|
||||
androidTestImplementation(Libs.AndroidX.Test.espressoCore)
|
||||
androidTestImplementation(Libs.AndroidX.Test.extKtx)
|
||||
androidTestImplementation(Libs.AndroidX.Test.rules)
|
||||
//androidTestImplementation(Libs.AndroidX.Test.uiAutomator)
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
// use to display stdout in travis
|
||||
testLogging {
|
||||
// set options for log level LIFECYCLE
|
||||
events = setOf(
|
||||
TestLogEvent.FAILED,
|
||||
TestLogEvent.STARTED,
|
||||
TestLogEvent.SKIPPED,
|
||||
TestLogEvent.STANDARD_OUT
|
||||
)
|
||||
exceptionFormat = TestExceptionFormat.FULL
|
||||
useJUnitPlatform()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Test>().configureEach {
|
||||
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
|
||||
forkEvery = 20
|
||||
}
|
||||
|
||||
android {
|
||||
testOptions {
|
||||
unitTests {
|
||||
isReturnDefaultValues = true
|
||||
isIncludeAndroidResources = true
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,10 +2,9 @@ plugins {
|
|||
id("com.android.library")
|
||||
id("kotlin-android")
|
||||
id("kotlin-kapt")
|
||||
id("android-module-dependencies")
|
||||
}
|
||||
|
||||
apply(from = "${project.rootDir}/core/main/android_dependencies.gradle")
|
||||
apply(from = "${project.rootDir}/core/main/android_module_dependencies.gradle")
|
||||
|
||||
android {
|
||||
|
||||
|
|
|
@ -2,22 +2,21 @@ plugins {
|
|||
id("com.android.library")
|
||||
id("kotlin-android")
|
||||
id("kotlin-kapt")
|
||||
id("kotlin-allopen")
|
||||
//id("kotlin-allopen")
|
||||
id("kotlin-parcelize")
|
||||
id("kotlinx-serialization")
|
||||
id("android-module-dependencies")
|
||||
id("all-open-dependencies")
|
||||
id("test-dependencies")
|
||||
}
|
||||
|
||||
apply(from = "${project.rootDir}/core/main/android_dependencies.gradle")
|
||||
apply(from = "${project.rootDir}/core/main/android_module_dependencies.gradle")
|
||||
apply(from = "${project.rootDir}/core/main/allopen_dependencies.gradle")
|
||||
apply(from = "${project.rootDir}/core/main/test_dependencies.gradle")
|
||||
apply(from = "${project.rootDir}/core/main/jacoco_global.gradle")
|
||||
|
||||
android {
|
||||
|
||||
namespace = "app.aaps.core.interfaces"
|
||||
defaultConfig {
|
||||
minSdk = 26 // for wear
|
||||
minSdk = Versions.wearMinSdk // for wear
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue