Skip to content

Commit

Permalink
Update to add useEsModules() and kotlin 1.8.20
Browse files Browse the repository at this point in the history
  • Loading branch information
ToxicBakery committed Apr 19, 2023
1 parent c3aa79a commit 3438390
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 49 deletions.
8 changes: 4 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ task jacocoTestReportAndroid(type: JacocoReport) {
executionData.from(fileTree(dir: "$buildDir/jacoco", include: "*.exec"))

reports {
xml.enabled = true
html.enabled = true
xml.required = true
html.required = true
}
}
build.dependsOn jacocoTestReportAndroid
Expand All @@ -92,12 +92,12 @@ detekt {
}

task dokkaJavadocAndroidJar(type: Jar, dependsOn: dokkaJavadoc) {
classifier('javadoc')
archiveClassifier.set("javadoc")
from "$buildDir/javadoc/android"
}

task androidSourcesJar(type: Jar) {
classifier('sources')
archiveClassifier.set('sources')
from kotlin.sourceSets.androidMain.kotlin.srcDirs
}

Expand Down
11 changes: 2 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension

buildscript {
ext.kotlin_version = '1.7.20'
ext.kotlin_version = '1.8.20'
ext.dokka_version = '1.4.20'
ext.jacoco_version = '0.8.8'
repositories {
Expand All @@ -29,13 +29,6 @@ repositories {
maven { url "https://plugins.gradle.org/m2/" }
}

// Work around for mac based builds which are only supported in NPM 16 and newer
// https://youtrack.jetbrains.com/issue/KT-49109
rootProject.plugins.withType(Class.forName("org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin")) {
rootProject.extensions.getByType(NodeJsRootExtension.class)
.nodeVersion = "16.0.0"
}

def getGitCommitCount() {
try {
def process = "git rev-list HEAD --count".execute()
Expand All @@ -52,7 +45,7 @@ subprojects {
final buildNumber = getGitCommitCount() ?: "0"

group 'com.ToxicBakery.logging'
version "1.39.$buildNumber" + (isCI && isMaster ? "" : "-SNAPSHOT")
version "1.40.$buildNumber" + (isCI && isMaster ? "" : "-SNAPSHOT")

repositories {
google()
Expand Down
34 changes: 14 additions & 20 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,17 @@ jacoco {

kotlin {
jvm()

js(BOTH) {
js(IR) {
browser {
testTask {
// Skip if CI
enabled = "$System.env.CI".isEmpty()
}
}
nodejs()
tasks[compilations.main.compileKotlinTaskName].kotlinOptions.moduleKind = "umd"
useEsModules()
}

wasm32()

sourceSets {
commonMain {
dependencies {
Expand Down Expand Up @@ -88,8 +85,8 @@ task jacocoTestReportJvm(type: JacocoReport, group: 'jacoco') {
executionData.from(files("$buildDir/jacoco/jvmTest.exec"))

reports {
xml.enabled = true
html.enabled = true
xml.required = true
html.required = true
}
}

Expand All @@ -116,9 +113,9 @@ task jacocoTestReportUnified(type: JacocoReport, dependsOn: ':android:build', gr
))

reports {
xml.enabled = true
xml.required = true
xml.setDestination(file("$buildDir/reports/jacoco/unified/jacocoTestReportUnified.xml"))
html.enabled = true
html.required = true
html.setDestination(file("$buildDir/reports/jacoco/unified/html"))
}
}
Expand Down Expand Up @@ -154,29 +151,29 @@ task dokkaGhPages(type: org.jetbrains.dokka.gradle.DokkaTask, group: 'documentat
}

task emptySourcesJar(type: Jar, group: 'publishing') {
classifier('sources')
archiveClassifier.set('sources')
}
task emptyJavadocJar(type: Jar, group: 'publishing') {
classifier('javadoc')
archiveClassifier.set('javadoc')
}

task dokkaJavadocCommonJar(type: Jar, dependsOn: dokkaHtml, group: 'publishing') {
classifier('javadoc')
archiveClassifier.set('javadoc')
from "$buildDir/javadoc/common"
}

task dokkaJavadocJsJar(type: Jar, dependsOn: dokkaHtml, group: 'publishing') {
classifier('javadoc')
archiveClassifier.set('javadoc')
from "$buildDir/javadoc/js"
}

task dokkaJavadocJvmJar(type: Jar, dependsOn: dokkaHtml, group: 'publishing') {
classifier('javadoc')
archiveClassifier.set('javadoc')
from "$buildDir/javadoc/jvm"
}

task dokkaJavadocWasm32Jar(type: Jar, dependsOn: dokkaHtml, group: 'publishing') {
classifier('javadoc')
archiveClassifier.set('javadoc')
from "$buildDir/javadoc/jvm"
}

Expand Down Expand Up @@ -227,12 +224,12 @@ publishing {
dependsOn: project(":android").tasks.find { it.name == 'build' },
group: 'publishing'
) {
classifier('javadoc')
archiveClassifier.set('javadoc')
from "${project(':android').buildDir}/libs/android-${project.version}-javadoc.jar"
}

task androidSourcesJar(type: Jar, group: 'publishing') {
classifier('sources')
archiveClassifier.set('sources')
from "${project(':android').buildDir}/libs/android-${project.version}-sources.jar"
}

Expand All @@ -251,9 +248,6 @@ publishing {
publications.getByName('jvm') {
artifact dokkaJavadocJvmJar
}
publications.getByName('wasm32') {
artifact dokkaJavadocWasm32Jar
}
publications.getByName('kotlinMultiplatform') {
artifact dokkaJavadocCommonJar
}
Expand Down
33 changes: 17 additions & 16 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
#kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.code.style=official
org.gradle.jvmargs=-Xmx4096m
android.useAndroidX=true

POM_NAME=Arbor
POM_PACKAGING=jar
POM_DESCRIPTION=Like Timber, just different.
POM_URL=https://github.com/ToxicBakery/arbor
POM_SCM_URL=https://github.com/ToxicBakery/arbor.git
POM_SCM_CONNECTION=scm:git@github.com:ToxicBakery/arbor.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:ToxicBakery/arbor.git
POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_EMAIL=toxicbakery@gmail.com
POM_DEVELOPER_ID=toxicbakery
POM_DEVELOPER_NAME=Ian Thomas
POM_DEVELOPER_EMAIL=toxicbakery@gmail.com
POM_DEVELOPER_ORGANIZATION=Toxic Bakery
POM_DEVELOPER_ORGANIZATION_URL=https://github.com/ToxicBakery
POM_DEVELOPER_ORGANIZATION_URL=https\://github.com/ToxicBakery
POM_LICENCE_DIST=repo
POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http\://www.apache.org/licenses/LICENSE-2.0.txt
POM_NAME=Arbor
POM_PACKAGING=jar
POM_SCM_CONNECTION=scm\:git@github.com\:ToxicBakery/arbor.git
POM_SCM_DEV_CONNECTION=scm\:git@github.com\:ToxicBakery/arbor.git
POM_SCM_URL=https\://github.com/ToxicBakery/arbor.git
POM_URL=https\://github.com/ToxicBakery/arbor

android.enableJetifier=true
android.useAndroidX=true
kotlin.code.style=official
kotlin.js.compiler=ir
org.gradle.jvmargs=-Xmx4096m

0 comments on commit 3438390

Please sign in to comment.