Skip to content

Commit

Permalink
Merge pull request #63 from ForteScarlet/update-deps
Browse files Browse the repository at this point in the history
Update Kotlin to 2.0.20
  • Loading branch information
ForteScarlet authored Aug 23, 2024
2 parents 5716659 + d10713c commit ce2507f
Show file tree
Hide file tree
Showing 12 changed files with 158 additions and 139 deletions.
1 change: 1 addition & 0 deletions .changelog/v2.0.20-0.9.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Kotlin version: `v2.0.20`
4 changes: 3 additions & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ dependencies {
// see https://github.com/gradle-nexus/publish-plugin
api("io.github.gradle-nexus:publish-plugin:$nexusPublishPlugin")

api("com.github.jengelman.gradle.plugins:shadow:6.1.0")
// api("com.github.jengelman.gradle.plugins:shadow:8.3.0")
// https://gradleup.com/shadow/
api("com.gradleup.shadow:shadow-gradle-plugin:8.3.0")

implementation("love.forte.gradle.common:gradle-common-core:$gradleCommon")
implementation("love.forte.gradle.common:gradle-common-kotlin-multiplatform:$gradleCommon")
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/IProject.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object IProject : ProjectDetail() {
const val HOMEPAGE = "https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin"

// Remember the libs.versions.toml!
val ktVersion = "2.0.20-Beta1"
val ktVersion = "2.0.20"
val pluginVersion = "0.9.2"

override val version: String = "$ktVersion-$pluginVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import love.forte.plugin.suspendtrans.utils.*
import org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
import org.jetbrains.kotlin.backend.wasm.ir2wasm.getSourceLocation
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSourceLocation
import org.jetbrains.kotlin.descriptors.CallableDescriptor
import org.jetbrains.kotlin.ir.IrStatement
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
Expand All @@ -20,7 +23,10 @@ import org.jetbrains.kotlin.ir.expressions.impl.IrFunctionExpressionImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrTypeOperatorCallImpl
import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol
import org.jetbrains.kotlin.ir.types.*
import org.jetbrains.kotlin.ir.util.*
import org.jetbrains.kotlin.ir.util.file
import org.jetbrains.kotlin.ir.util.isAnnotationWithEqualFqName
import org.jetbrains.kotlin.ir.util.kotlinFqName
import org.jetbrains.kotlin.ir.util.primaryConstructor
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.wasm.ir.source.location.SourceLocation
Expand Down Expand Up @@ -224,7 +230,7 @@ class SuspendTransformTransformer(
if (reporter != null) {
// WARN? DEBUG? IGNORE?
reporter.report(
IrMessageLogger.Severity.INFO,
CompilerMessageSeverity.INFO,
message,
function.reportLocation()
)
Expand All @@ -240,7 +246,7 @@ class SuspendTransformTransformer(
val originFunction = originFunctions.first()

reporter?.report(
IrMessageLogger.Severity.INFO,
CompilerMessageSeverity.INFO,
"Generate body for function " +
kotlin.runCatching { function.kotlinFqName.asString() }.getOrElse { function.name.asString() } +
" by origin function " +
Expand All @@ -265,15 +271,16 @@ class SuspendTransformTransformer(
}
}

private fun IrFunction.reportLocation(): IrMessageLogger.Location? {
private fun IrFunction.reportLocation(): CompilerMessageSourceLocation? {
return when (val sourceLocation =
// getSourceLocation(runCatching { fileEntry }.getOrNull())) {
getSourceLocation(file)) {
is SourceLocation.Location -> {
IrMessageLogger.Location(
filePath = sourceLocation.file,
CompilerMessageLocation.create(
path = sourceLocation.file,
line = sourceLocation.line,
column = sourceLocation.column
column = sourceLocation.column,
lineContent = null
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FILE fqName:<root> fileName:/Main.kt
CLASS ANNOTATION_CLASS name:OneOptAnno modality:OPEN visibility:public superTypes:[kotlin.Annotation]
annotations:
RequiresOptIn(message = <null>, level = GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:ERROR' type=kotlin.RequiresOptIn.Level)
RequiresOptIn(message = <null>, level = GET_ENUM 'ENUM_ENTRY name:ERROR' type=kotlin.RequiresOptIn.Level)
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.OneOptAnno
CONSTRUCTOR visibility:public <> () returnType:<root>.OneOptAnno [primary]
BLOCK_BODY
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kotlinx-coroutines = "1.8.0"
kotlinx-serialization = "1.7.1"
google-auto-service = "1.0.1"
# Remember the `IProject.ktVersion`!
kotlin = "2.0.20-Beta1"
kotlin = "2.0.20"
compose = "1.5.4"
compose-compiler = "1.5.6"
compose-plugin = "1.6.0-beta01"
Expand Down
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
#distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://mirrors.cloud.tencent.com/gradle//gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit ce2507f

Please sign in to comment.