Skip to content

Commit

Permalink
Update kotlin and simplify build
Browse files Browse the repository at this point in the history
- leverages updated kmm features to get around hacky dependencies and tasks
  • Loading branch information
ToxicBakery committed Dec 17, 2022
1 parent cf65622 commit 7296e94
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 28 deletions.
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down Expand Up @@ -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()
Expand Down
9 changes: 1 addition & 8 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ jacoco {
}

kotlin {
jvm {
mavenPublication {
artifactId = 'arbor-jvm'
}
}
jvm()

js {
browser {
Expand All @@ -27,9 +23,6 @@ kotlin {
}
nodejs()
tasks[compilations.main.compileKotlinTaskName].kotlinOptions.moduleKind = "umd"
mavenPublication {
artifactId = 'arbor-js'
}
}

sourceSets {
Expand Down
14 changes: 6 additions & 8 deletions examples/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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'
Expand Down
8 changes: 4 additions & 4 deletions examples/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}
}
Expand All @@ -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
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit 7296e94

Please sign in to comment.