From 7296e94a83f4e1df268846a7885c071cee15c1fb Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Sat, 17 Dec 2022 07:13:09 -0800 Subject: [PATCH] Update kotlin and simplify build - leverages updated kmm features to get around hacky dependencies and tasks --- android/build.gradle | 6 +++--- build.gradle | 8 ++++---- common/build.gradle | 9 +-------- examples/android/build.gradle | 14 ++++++-------- examples/java/build.gradle | 8 ++++---- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle | 1 + 7 files changed, 20 insertions(+), 28 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 57ec7c5..20e46d6 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -57,12 +57,12 @@ kotlin { androidMain { dependencies { implementation 'org.jetbrains.kotlin:kotlin-stdlib' - implementation project(':common') + implementation project(':arbor') } } androidTest { dependencies { - implementation project(':common') + implementation project(':arbor') implementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" implementation "org.mockito:mockito-core:3.5.15" } @@ -88,7 +88,7 @@ build.dependsOn jacocoTestReportAndroid detekt { buildUponDefaultConfig = true input = files("src/androidMain/kotlin") - config = project(':common').files("detekt.yml") + config = project(':arbor').files("detekt.yml") } task dokkaJavadocAndroidJar(type: Jar, dependsOn: dokkaJavadoc) { diff --git a/build.gradle b/build.gradle index 6794ba6..37e52aa 100644 --- a/build.gradle +++ b/build.gradle @@ -2,16 +2,16 @@ import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.20' ext.dokka_version = '1.4.20' - ext.jacoco_version = '0.8.5' + ext.jacoco_version = '0.8.8' repositories { google() mavenCentral() maven { url "https://plugins.gradle.org/m2/" } } dependencies { - classpath 'com.android.tools.build:gradle:7.0.4' + classpath 'com.android.tools.build:gradle:7.3.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version" } @@ -52,7 +52,7 @@ subprojects { final buildNumber = getGitCommitCount() ?: "0" group 'com.ToxicBakery.logging' - version "1.37.$buildNumber" + (isCI && isMaster ? "" : "-SNAPSHOT") + version "1.38.$buildNumber" + (isCI && isMaster ? "" : "-SNAPSHOT") repositories { google() diff --git a/common/build.gradle b/common/build.gradle index f884aee..c247af7 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -12,11 +12,7 @@ jacoco { } kotlin { - jvm { - mavenPublication { - artifactId = 'arbor-jvm' - } - } + jvm() js { browser { @@ -27,9 +23,6 @@ kotlin { } nodejs() tasks[compilations.main.compileKotlinTaskName].kotlinOptions.moduleKind = "umd" - mavenPublication { - artifactId = 'arbor-js' - } } sourceSets { diff --git a/examples/android/build.gradle b/examples/android/build.gradle index d544d5e..fafe4d6 100644 --- a/examples/android/build.gradle +++ b/examples/android/build.gradle @@ -2,12 +2,12 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' android { - compileSdkVersion 31 + compileSdkVersion 33 defaultConfig { applicationId "com.example.arborsample" minSdkVersion 15 - targetSdkVersion 31 + targetSdkVersion 33 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -23,18 +23,16 @@ android { } repositories { - flatDir { dirs new File(project(':common').buildDir, 'libs').path } mavenCentral() mavenLocal() } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'androidx.appcompat:appcompat:1.4.1' - implementation 'androidx.constraintlayout:constraintlayout:2.1.3' - implementation "io.reactivex.rxjava3:rxjava:3.0.0-RC5" - //implementation "com.ToxicBakery.logging:common-jvm:$version" - implementation project(":common") + implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation "io.reactivex.rxjava3:rxjava:3.1.5" + implementation project(":arbor") implementation project(":android") testImplementation 'junit:junit:4.13.2' diff --git a/examples/java/build.gradle b/examples/java/build.gradle index 7b17c44..e15a927 100644 --- a/examples/java/build.gradle +++ b/examples/java/build.gradle @@ -7,16 +7,15 @@ plugins { sourceCompatibility = 1.8 repositories { - flatDir { dirs new File(project(':common').buildDir, 'libs').path } mavenCentral() } kotlin { jvm { dependencies { - implementation "com.ToxicBakery.logging:common-jvm:$version" + implementation project(":arbor") implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - testImplementation group: 'junit', name: 'junit', version: '4.13.1' + testImplementation group: 'junit', name: 'junit', version: '4.13.2' } } } @@ -25,4 +24,5 @@ application { mainClass = "com.ToxicBakery.logging.Main" } -assemble.dependsOn ':common:build', ':common:publishToMavenLocal' +java.sourceCompatibility = JavaVersion.VERSION_1_8 +java.targetCompatibility = JavaVersion.VERSION_1_8 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 41dfb87..070cb70 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-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle index 93d7991..89efc5a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,5 +4,6 @@ include ':android' include ':examples:android' include ':examples:java' +project(':common').name = 'arbor' project(':examples:android').name = 'android-example' project(':examples:java').name = 'java-example'