Skip to content

Commit

Permalink
Update Kotlin to 2.0.0 (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajalt authored May 22, 2024
1 parent 4a0cc97 commit 498efc3
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 62 deletions.
32 changes: 11 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
test:
strategy:
matrix:
os: [macos-14, windows-latest, ubuntu-latest]
os: [macos-latest, windows-latest, ubuntu-latest]
include:
- os: ubuntu-latest
GRADLE_ARGS: |
GRADLE_ARGS: >-
apiCheck
:test:check
:colormath:compileKotlinLinuxArm64
Expand All @@ -29,8 +29,8 @@ jobs:
:extensions:colormath-ext-android-colorint:check
:extensions:colormath-ext-android-color:check
--stacktrace
- os: macos-14
GRADLE_ARGS: |
- os: macos-latest
GRADLE_ARGS: >-
macosX64Test
:colormath:compileKotlinMacosArm64
iosX64Test
Expand All @@ -44,42 +44,32 @@ jobs:
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
java-version: 17
distribution: 'graalvm-community'
set-java-home: false
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- uses: gradle/actions/setup-gradle@v3
with:
arguments: ${{matrix.GRADLE_ARGS}}
- name: Bundle the build report
if: failure()
run: find . -type d -name 'reports' | zip -@ -r build-reports.zip
- run: ./gradlew ${{matrix.GRADLE_ARGS}}
- name: Upload the build report
if: failure()
uses: actions/upload-artifact@master
with:
name: error-report
path: build-reports.zip
name: build-report-${{ matrix.os }}
path: '**/build/reports'
publish:
needs: test
runs-on: macos-14
runs-on: macos-latest
if: ${{ github.ref == 'refs/heads/master' && github.repository == 'ajalt/colormath' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- uses: gradle/actions/setup-gradle@v3
- name: Deploy to sonatype
uses: gradle/actions/setup-gradle@v3
with:
# disable configuration cache due to https://github.com/gradle/gradle/issues/22779
arguments: publishToMavenCentral -PsnapshotVersion=true --no-configuration-cache
# disable configuration cache due to https://github.com/gradle/gradle/issues/22779
run: ./gradlew publishToMavenCentral -PsnapshotVersion=true --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }}
Expand Down
53 changes: 28 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,42 @@ on:

jobs:
release:
runs-on: macos-14
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: gradle/actions/setup-gradle@v3
# - uses: actions/setup-python@v5
# with:
# python-version: '3.12'
- run: ./gradlew publishToMavenCentral
env:
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }}
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v2
- name: Create release
uses: ncipollo/release-action@v1
with:
body: ${{ steps.extract-release-notes.outputs.release_notes }}
- name: Dokka
uses: gradle/actions/setup-gradle@v3
with:
arguments: dokkaHtml :website:wasmJsBrowserDistribution
- run: ./prepare_docs.sh
- name: Build mkdocs
run: |
pip install mkdocs-material
mkdocs build
- name: Deploy docs to website
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: site
# - name: Extract release notes
# id: extract-release-notes
# uses: ffurrer2/extract-release-notes@v2
# - name: Create release
# uses: ncipollo/release-action@v1
# with:
# body: ${{ steps.extract-release-notes.outputs.release_notes }}
# - name: Dokka
# uses: gradle/actions/setup-gradle@v3
# with:
# arguments: dokkaHtml :website:wasmJsBrowserDistribution
# - run: ./prepare_docs.sh
# - name: Build mkdocs
# run: |
# pip install mkdocs-material
# mkdocs build
# - name: Deploy docs to website
# uses: JamesIves/github-pages-deploy-action@v4
# with:
# branch: gh-pages
# folder: site
env:
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=false -Dkotlin.incremental=false -Dorg.gradle.project.kotlin.incremental.multiplatform=false -Dorg.gradle.project.kotlin.native.disableCompilerDaemon=true -Dorg.gradle.jvmargs="-Dfile.encoding=UTF-8"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ site/
docs/js/gradient.js
docs/js/converter.js
kotlin-js-store/
.kotlin/
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## Unreleased
### Changed
- Update Kotlin to 2.0.0

## 3.5.0
### Added
Expand Down
4 changes: 1 addition & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ plugins {
alias(libs.plugins.dokka).apply(false)
alias(libs.plugins.publish).apply(false)
alias(libs.plugins.jetbrainsCompose).apply(false)
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.kotlinBinaryCompatibilityValidator)
}

Expand Down Expand Up @@ -42,9 +43,6 @@ subprojects {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}
tasks.withType<JavaCompile>().configureEach {
options.release.set(8)
}

plugins.withType<com.android.build.gradle.BasePlugin>().configureEach {
configure<BaseExtension> {
Expand Down
2 changes: 1 addition & 1 deletion extensions/colormath-ext-jetpack-compose/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.vanniktech.maven.publish.tasks.JavadocJar
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension

plugins {
id("com.android.library")
Expand Down Expand Up @@ -38,7 +39,6 @@ kotlin {
}
}

@Suppress("UnstableApiUsage")
android {
namespace = "com.github.ajalt.colormath.extensions.android.composecolor"
compileSdk = 33
Expand Down
15 changes: 8 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
kotlin = "1.9.21"
compose = "1.6.0"
compose-plugin = "1.6.0"
kotlin = "2.0.0"
compose = "1.6.10"
compose-plugin = "1.6.10"

[libraries]

Expand All @@ -10,9 +10,9 @@ androidx-annotation = "androidx.annotation:annotation:1.7.0"
compose-ui-graphics = { module = "org.jetbrains.compose.ui:ui-graphics", version.ref = "compose" }

# used in tests
kotest = "io.kotest:kotest-assertions-core:5.8.0"
kotest = "io.kotest:kotest-assertions-core:5.9.0"
junit = "junit:junit:4.13.2"
robolectric = "org.robolectric:robolectric:4.10"
robolectric = "org.robolectric:robolectric:4.12.2"

# used in samples
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
Expand All @@ -21,11 +21,12 @@ compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview"

[plugins]
dokka = "org.jetbrains.dokka:1.9.20"
publish = "com.vanniktech.maven.publish:0.27.0"
publish = "com.vanniktech.maven.publish:0.28.0"
kotlinBinaryCompatibilityValidator = "org.jetbrains.kotlinx.binary-compatibility-validator:0.14.0"

# used in extensions
android-library = "com.android.library:7.4.0"
android-library = "com.android.library:8.4.0"

# used in samples
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 1 addition & 4 deletions website/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
plugins {
kotlin("multiplatform")
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.compose.compiler)
}

kotlin {
Expand Down Expand Up @@ -37,7 +38,3 @@ kotlin {
}
}
}

compose.experimental {
web.application {}
}

0 comments on commit 498efc3

Please sign in to comment.