diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a3769eb..3a0f859 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,4 +8,11 @@ updates: - package-ecosystem: "gradle" directory: "/" schedule: - interval: "daily" \ No newline at end of file + interval: "daily" + target-branch: "main" + + - package-ecosystem: "gradle" + directory: "/" + schedule: + interval: "daily" + target-branch: "publishing" \ No newline at end of file diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index fe1a3e2..8f71744 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -49,28 +49,24 @@ jobs: - name: Setup gradle uses: gradle/gradle-build-action@v2 - - name: Write secrets to local.properties + # Updated to 16.3 to meet Kotlin 2.2.10 requirements + - name: Set up Xcode version + run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer + + - name: Publish to MavenCentral if: ${{ github.event_name != 'pull_request' }} - run: | - echo sonatypeUsername="${SONATYPE_USERNAME}" >> "local.properties" - echo sonatypePassword="${SONATYPE_PASSWORD}" >> "local.properties" - echo gpgKeyId="${GPG_KEY_ID}" >> "local.properties" - echo gpgKeySecret="${GPG_KEY_SECRET}" >> "local.properties" - echo gpgKeyPassword="${GPG_KEY_PASSWORD}" >> "local.properties" + run: ./gradlew publishToMavenCentral --no-configuration-cache env: - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} - GPG_KEY_SECRET: ${{ secrets.GPG_KEY_SECRET }} - GPG_KEY_PASSWORD: ${{ secrets.GPG_KEY_PASSWORD }} - - - name: Release to sonatype - run: ./gradlew publish + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.GPG_KEY_ID }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY_SECRET}} documentation: name: Publish documentation if: ${{ github.event_name != 'pull_request' }} - runs-on: ubuntu-latest + runs-on: macos-latest needs: - check environment: @@ -92,7 +88,7 @@ jobs: uses: actions/configure-pages@v3 - name: Generate api docs with dokka - run: ./gradlew dokkaHtml + run: ./gradlew dokkaGenerate - name: Upload pages uses: actions/upload-pages-artifact@v3 @@ -101,4 +97,4 @@ jobs: - name: Release to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/VERSIONS.md b/VERSIONS.md new file mode 100644 index 0000000..adb27cc --- /dev/null +++ b/VERSIONS.md @@ -0,0 +1,9 @@ +# Version History + +| Release | Kotlin | AGP | Dokka | BCV | Kover | +| :--- | :--- | :--- | :--- | :--- | :--- | +| v0.2.6 | 2.1.21 | 8.9.2 | 2.0.0 | 0.17.0 | 0.9.1 | +| v0.2.6-beta03 | 2.1.21-RC | 8.9.2 | 2.0.0 | 0.17.0 | 0.9.1 | +| v0.2.6-beta02 | 2.1.20 | 8.9.1 | 2.0.0 | 0.17.0 | 0.9.1 | +| v0.2.6-beta01 | 2.1.20 | 8.9.1 | 2.0.0 | 0.17.0 | 0.9.1 | +| v0.2.5 | 2.1.20 | 8.7.3 | 2.0.0 | 0.17.0 | 0.9.1 | diff --git a/basic-logging/build.gradle.kts b/basic-logging/build.gradle.kts index 332a352..49f4ba0 100644 --- a/basic-logging/build.gradle.kts +++ b/basic-logging/build.gradle.kts @@ -4,7 +4,7 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget plugins { alias(libs.plugins.multiplatform) - alias(libs.plugins.android.library) + alias(libs.plugins.multiplatform.library) alias(libs.plugins.kotlinx.binary.compatibility.validator) alias(libs.plugins.dokka) alias(libs.plugins.kover) @@ -18,9 +18,13 @@ kotlin { // DON'T FORGET TO RUN `./gradlew apiDump` explicitApi() - jvm() + jvm { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_21) + } + } - js(IR) { + js { binaries.executable() browser { commonWebpackConfig { @@ -47,12 +51,9 @@ kotlin { iosX64(), // mobile iosArm64(), // mobile iosSimulatorArm64(), // mobile - macosX64(), // desktop macosArm64(), // desktop - tvosX64(), // tv tvosArm64(), // tv tvosSimulatorArm64(), // tv - watchosX64(), // watch watchosArm32(), // watch watchosArm64(), // watch watchosDeviceArm64(), // watch @@ -79,28 +80,14 @@ kotlin { compilerOptions { freeCompilerArgs.add("-Xexpect-actual-classes") } - // Android JVM target target options - androidTarget { - publishLibraryVariants("release", "debug") - compilations.all{ - compileTaskProvider.configure{ - compilerOptions { - jvmTarget.set(JvmTarget.JVM_17) - } - } - } - } -} - -android { - namespace = "app.lexilabs.basic.logging" - compileSdk = 35 + android { + namespace = "app.lexilabs.basic.logging" + compileSdk = libs.versions.build.sdk.compile.get().toInt() + minSdk = libs.versions.build.sdk.min.get().toInt() + withJava() - defaultConfig { - minSdk = 4 // was 24 - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + compilerOptions { + jvmTarget.set(JvmTarget.JVM_26) + } } } \ No newline at end of file diff --git a/basic-logging/src/wasmJsMain/kotlin/app/lexilabs/basic/logging/Connectors.kt b/basic-logging/src/wasmJsMain/kotlin/app/lexilabs/basic/logging/Connectors.kt index 846cd08..1d546a3 100644 --- a/basic-logging/src/wasmJsMain/kotlin/app/lexilabs/basic/logging/Connectors.kt +++ b/basic-logging/src/wasmJsMain/kotlin/app/lexilabs/basic/logging/Connectors.kt @@ -1,4 +1,5 @@ @file:JsModule("logger.js") +@file:OptIn(ExperimentalWasmJsInterop::class) package app.lexilabs.basic.logging diff --git a/build.gradle.kts b/build.gradle.kts index 2ced4d8..fd5b4bf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,23 +1,18 @@ -import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties -import org.jetbrains.dokka.base.DokkaBase -import org.jetbrains.dokka.base.DokkaBaseConfiguration -import org.jetbrains.dokka.gradle.DokkaTask +import com.vanniktech.maven.publish.MavenPublishBaseExtension + plugins { alias(libs.plugins.multiplatform).apply(false) - alias(libs.plugins.android.library).apply(false) + alias(libs.plugins.multiplatform.library).apply(false) alias(libs.plugins.dokka) alias(libs.plugins.kover) } -dependencies { - kover(project(":basic-logging")) -} +dependencies { kover(project(":basic-logging")) } buildscript { - dependencies { - classpath(libs.dokka.base) - } + plugins { alias(libs.plugins.maven.publish)} + dependencies { classpath(libs.dokka.base) } } allprojects { @@ -25,103 +20,59 @@ allprojects { version = rootProject.libs.versions.logging.get() apply(plugin = "org.jetbrains.dokka") - apply(plugin = "maven-publish") - apply(plugin = "signing") + apply(plugin = "com.vanniktech.maven.publish") - extensions.configure { - repositories { - maven { - name = "maven" - url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2") - credentials { - username = gradleLocalProperties(rootDir, providers).getProperty("sonatypeUsername") - password = gradleLocalProperties(rootDir, providers).getProperty("sonatypePassword") - } - } + /** dokka generation **/ + dokka { + moduleName.set(project.name) + moduleVersion.set(project.version.toString()) + dokkaPublications.html { + outputDirectory.set(rootDir.resolve("docs")) + suppressObviousFunctions.set(true) + suppressInheritedMembers.set(false) + failOnWarning.set(false) + offlineMode.set(false) } - - val javadocJar = tasks.register("javadocJar") { - dependsOn(tasks.dokkaHtml) - archiveClassifier.set("javadoc") - from("${layout.buildDirectory}/dokka") + pluginsConfiguration.html { + customAssets.from(rootDir.resolve("images/logo-icon.svg")) + footerMessage.set("(c) 2026 LexiLabs") } + } - /** dokka generation **/ - tasks.register("clearDokkaHtml") { - delete("${projectDir.parent}/docs") - } - tasks.withType().configureEach{ - pluginConfiguration { - dependsOn("clearDokkaHtml") - outputDirectory = file("${projectDir.parent}/docs") - moduleName = project.name - moduleVersion = project.version.toString() - customAssets = listOf(file("${projectDir.parent}/images/logo-icon.svg")) - // Need to create a cool looking theme at some point - //customStyleSheets = listOf(file("${projectDir.parent}/dokka/styles.css")) - footerMessage = "(c) 2025 LexiLabs" - failOnWarning = false - suppressObviousFunctions = true - suppressInheritedMembers = false - offlineMode = false - } - } + extensions.configure { - publications { - withType { - artifact(javadocJar) + mavenPublishing { + publishToMavenCentral(automaticRelease = true) - pom { - name.set("Basic") - description.set("Easily integrate logging into your Kotlin Multiplatform Mobile (KMP / KMM) project") - licenses { - license { - name.set("MIT License") - url.set("https://raw.githubusercontent.com/LexiLabs-App/basic-logging/refs/heads/main/LICENSE") - } + signAllPublications() + coordinates(group.toString(), project.name, version.toString()) + pom { + name.set("Basic") + description.set("Easily integrate logging into your Kotlin Multiplatform Mobile (KMP / KMM) project") + licenses { + license { + name.set("MIT License") + url.set("https://raw.githubusercontent.com/LexiLabs-App/basic-logging/refs/heads/main/LICENSE") } + } + url.set("https://github.com/LexiLabs-App/basic-logging") + issueManagement { + system.set("Github") + url.set("https://github.com/LexiLabs-App/basic-logging/issues") + } + scm { + connection.set("https://github.com/LexiLabs-App/basic-logging.git") url.set("https://github.com/LexiLabs-App/basic-logging") - issueManagement { - system.set("Github") - url.set("https://github.com/LexiLabs-App/basic-logging/issues") - } - scm { - connection.set("https://github.com/LexiLabs-App/basic-logging.git") - url.set("https://github.com/LexiLabs-App/basic-logging") - } - developers { - developer { - id.set("rjamison") - name.set("Robert Jamison") - email.set("rjamison@lexilabs.app") - url.set("https://logging.basic.lexilabs.app") - } + } + developers { + developer { + id.set("rjamison") + name.set("Robert Jamison") + email.set("rjamison@lexilabs.app") + url.set("https://logging.basic.lexilabs.app") } } } } } - - val publishing = extensions.getByType() - - if (gradle.startParameter.taskNames.any { it == "publish" }) { - extensions.configure { - useInMemoryPgpKeys( - gradleLocalProperties(rootDir, providers).getProperty("gpgKeyId"), - gradleLocalProperties(rootDir, providers).getProperty("gpgKeySecret"), - gradleLocalProperties(rootDir, providers).getProperty("gpgKeyPassword") - ) - sign(publishing.publications) - } - } else { - extensions.configure { - useGpgCmd() - sign(publishing.publications) - } - } - - // remove after https://youtrack.jetbrains.com/issue/KT-46466 is fixed - project.tasks.withType(AbstractPublishToMaven::class.java).configureEach { - dependsOn(project.tasks.withType(Sign::class.java)) - } -} \ No newline at end of file +} diff --git a/gradle.properties b/gradle.properties index 4fdf02c..c5fd945 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,8 +8,6 @@ org.gradle.parallel=true #Kotlin kotlin.code.style=official -kotlin.native.cacheKind.iosArm64=none -kotlin.native.cacheKind.iosSimulatorArm64=none #Android android.useAndroidX=true @@ -23,6 +21,9 @@ kotlin.apple.xcodeCompatibility.nowarn=true org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true +#Windows +kotlin.native.ignoreDisabledTargets=true + #Maven Publishing #https://stackoverflow.com/questions/68127791/configuration-cache-enabled-causes-build-to-fail org.gradle.unsafe.configuration-cache-problems=WARN @@ -31,4 +32,4 @@ systemProp.org.gradle.internal.publish.checksums.insecure=true #Dokka org.gradle.caching=false org.gradle.configuration-cache=false -org.jetbrains.dokka.experimental.gradle.pluginMode=V2EnabledWithHelper \ No newline at end of file +org.jetbrains.dokka.experimental.gradle.pluginMode=V2EnabledWithHelpers \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6766144..d42f5b1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,17 +1,21 @@ [versions] -logging = "0.2.6" -kotlin = "2.1.21" -agp = "8.9.2" -bcv = "0.17.0" -dokka = "2.0.0" -kover = "0.9.1" +logging = "0.3.0" +build-sdk-compile = "37" +build-sdk-min = "24" +kotlin = "2.4.10" +agp = "9.3.0" # switch to AGP 9.3.0 when released (switched early due to android toolchain +bcv = "0.18.1" +dokka = "2.2.0" +kover = "0.9.8" +maven-publish = "0.37.0" [libraries] dokka-base = { module = "org.jetbrains.dokka:dokka-base", version.ref = "dokka" } [plugins] multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } -android-library = { id = "com.android.library", version.ref = "agp" } +multiplatform-library = { id = "com.android.kotlin.multiplatform.library", version.ref = "agp"} kotlinx-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "bcv"} dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } +maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish"} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e644113..b1b8ef5 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37f853b..a9db115 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,9 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip networkTimeout=10000 +retries=0 +retryBackOffMs=500 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index faf9300..249efbb 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ ############################################################################## # -# Gradle start up script for POSIX generated by Gradle. +# gradlew start up script for POSIX generated by Gradle. # # Important for running: # @@ -29,7 +29,7 @@ # bash, then to run this script, type that shell name before the whole # command line, like: # -# ksh Gradle +# ksh gradlew # # Busybox and similar reduced shells will NOT work, because this script # requires all of these POSIX shell features: @@ -57,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -114,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -172,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -212,8 +210,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 9d21a21..a51ec4f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -19,12 +19,12 @@ @if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem -@rem Gradle startup script for Windows +@rem gradlew startup script for Windows @rem @rem ########################################################################## -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +@rem Set local scope for the variables, and ensure extensions are enabled +setlocal EnableExtensions set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. @@ -51,7 +51,7 @@ echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 -goto fail +"%COMSPEC%" /c exit 1 :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% @@ -65,30 +65,18 @@ echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 -goto fail +"%COMSPEC%" /c exit 1 :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +@rem Execute gradlew +@rem endlocal doesn't take effect until after the line is parsed and variables are expanded +@rem which allows us to clear the local environment before executing the java command +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +:exitWithErrorLevel +@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts +"%COMSPEC%" /c exit %ERRORLEVEL% diff --git a/settings.gradle.kts b/settings.gradle.kts index 4ba6265..5b60e53 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -9,11 +9,14 @@ pluginManagement { } } +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version("1.0.0") +} + dependencyResolutionManagement { @Suppress("UnstableApiUsage") repositories { google() mavenCentral() } -} - +} \ No newline at end of file