Skip to content

Commit

Permalink
Update versions
Browse files Browse the repository at this point in the history
  • Loading branch information
serras committed Dec 20, 2023
1 parent 0d53fd6 commit 60839f7
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 60 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3.0.2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v3.5.0
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
distribution: 'temurin'
java-version: 17

- name: build
uses: gradle/gradle-build-action@v2.3.0
uses: gradle/gradle-build-action@v2
with:
arguments: --full-stacktrace build

- name: Upload reports
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v4
with:
name: 'reports-${{ matrix.os }}'
path: '**/build/reports/**'
Expand All @@ -51,26 +51,26 @@ jobs:
timeout-minutes: 60

steps:
- uses: actions/checkout@v3.0.2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v3.5.0
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
distribution: 'temurin'
java-version: 17

- name: Format
uses: gradle/gradle-build-action@v2.2.0
uses: gradle/gradle-build-action@v2
with:
arguments: ktlintFormat

- name: Stop Gradle daemons
run: ./gradlew --stop

- name: "Commit formatted files"
uses: stefanzweifel/git-auto-commit-action@v4.15.0
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Format files using ktlint
file_pattern: "**/*.kt"
Expand All @@ -80,29 +80,29 @@ jobs:
timeout-minutes: 60

steps:
- uses: actions/checkout@v3.0.2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v3.5.0
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
distribution: 'temurin'
java-version: 17

- name: Checkout
run: rm -rf docs

- name: Format
uses: gradle/gradle-build-action@v2.2.0
uses: gradle/gradle-build-action@v2
with:
arguments: :mutable-utils:dokkaHtml

- name: Stop Gradle daemons
run: ./gradlew --stop

- name: "Commit formatted files"
uses: stefanzweifel/git-auto-commit-action@v4.15.0
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update documentation
file_pattern: "docs/*"
15 changes: 9 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'adopt'
distribution: 'temurin'
java-version: 17

- name: Validate Gradle wrapper
uses: gradle/[email protected]
uses: gradle/wrapper-validation-action@v1

- name: Publish package
uses: gradle/gradle-build-action@v2.3.0
uses: gradle/gradle-build-action@v2
with:
arguments: publish
env:
Expand Down
21 changes: 2 additions & 19 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ plugins {
}

val gradleJvmTarget = "11"
val gradleKotlinTarget = "1.8"

val kotlinVersion = "1.8.10"

dependencies {
implementation(platform(libs.kotlin.bom))
Expand All @@ -21,23 +18,9 @@ dependencies {
implementation(libs.gradlePlugin.dokka)
}


tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = gradleJvmTarget
apiVersion = gradleKotlinTarget
languageVersion = gradleKotlinTarget
}
}


kotlin {
jvmToolchain {
java {
toolchain {
(this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(gradleJvmTarget))
}
}


kotlinDslPluginOptions {
jvmTarget.set(gradleJvmTarget)
}
24 changes: 12 additions & 12 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[versions]
kotlin = "1.8.10"
dokka = "1.8.10"
kspVersion = "1.8.10-1.0.9"
kotlinPoet = "1.12.0"
kotlinCompileTesting = "1.5.0"
kotest = "5.5.5"
classgraph = "4.8.157"
commonsIo = "2.11.0"
ktlint = "11.3.1"
junit = "5.9.2"
kotlin = "1.9.21"
dokka = "1.9.10"
kspVersion = "1.9.21-1.0.16"
kotlinPoet = "1.15.3"
kotlinCompileTesting = "0.4.0"
kotest = "5.8.0"
classgraph = "4.8.165"
commonsIo = "2.15.1"
ktlint = "12.0.3"
junit = "5.10.1"

[libraries]
kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "kotlin" }
Expand All @@ -17,8 +17,8 @@ kotlin-stdlibJDK8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8" }
kotlinPoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinPoet" }
kotlinPoet-ksp = { module = "com.squareup:kotlinpoet-ksp", version.ref = "kotlinPoet" }
ksp = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "kspVersion" }
kotlinCompileTesting = { module = "com.github.tschuchortdev:kotlin-compile-testing", version.ref = "kotlinCompileTesting" }
kotlinCompileTestingKsp = { module = "com.github.tschuchortdev:kotlin-compile-testing-ksp", version.ref = "kotlinCompileTesting" }
kotlinCompileTesting = { module = "dev.zacsweers.kctfork:core", version.ref = "kotlinCompileTesting" }
kotlinCompileTestingKsp = { module = "dev.zacsweers.kctfork:ksp", version.ref = "kotlinCompileTesting" }
kotest-assertions-core = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }
classgraph = { module = "io.github.classgraph:classgraph", version.ref = "classgraph" }
apache-commons-io = { module = "commons-io:commons-io", version.ref = "commonsIo" }
Expand Down
4 changes: 2 additions & 2 deletions 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-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.google.devtools.ksp.symbol.KSDeclaration
import com.google.devtools.ksp.symbol.KSPropertyDeclaration
import com.google.devtools.ksp.symbol.KSType
import com.google.devtools.ksp.symbol.KSTypeAlias
import com.google.devtools.ksp.symbol.KSTypeParameter
import com.google.devtools.ksp.symbol.KSTypeReference
import com.google.devtools.ksp.symbol.Visibility
import com.squareup.kotlinpoet.ClassName
Expand Down Expand Up @@ -93,6 +94,7 @@ internal class ClassCompileScope(
get() = parameterizedWhenNotEmpty(typeVariableNames.map { it.makeInvariant() })

override fun KSType.hasMutableCopy(): Boolean {
if (declaration is KSTypeParameter) return false
val closestDecl = declaration.closestClassDeclaration()
return closestDecl != null && closestDecl in mutableCandidates
}
Expand Down
1 change: 1 addition & 0 deletions utils/compiletesting/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ dependencies {
)
}
implementation(libs.kotlinCompileTestingKsp)
implementation(libs.ksp)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
@file:OptIn(ExperimentalCompilerApi::class)

package at.kopyk.compiletesting

import com.google.devtools.ksp.processing.SymbolProcessorProvider
import com.tschuchort.compiletesting.CompilationResult
import com.tschuchort.compiletesting.KotlinCompilation
import com.tschuchort.compiletesting.KotlinCompilation.ExitCode.OK
import com.tschuchort.compiletesting.SourceFile
Expand All @@ -13,6 +16,7 @@ import java.io.File
import java.net.URLClassLoader
import java.nio.file.Files
import java.nio.file.Paths
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi

private const val SOURCE_FILENAME = "Source.kt"

Expand Down Expand Up @@ -54,7 +58,7 @@ public fun String.evals(
// =======================================

internal data class FullCompilationResult(
val mainResult: KotlinCompilation.Result,
val mainResult: CompilationResult,
val additionalMessages: String?
) {
val exitCode = mainResult.exitCode
Expand All @@ -65,10 +69,10 @@ internal data class FullCompilationResult(
}
}

private fun KotlinCompilation.Result.pass1Result() =
private fun CompilationResult.pass1Result() =
FullCompilationResult(this, null)

private fun KotlinCompilation.Result.pass2Result(additionalMessages: String) =
private fun CompilationResult.pass2Result(additionalMessages: String) =
FullCompilationResult(this, additionalMessages)

internal fun compile(
Expand Down

0 comments on commit 60839f7

Please sign in to comment.