Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Nov 27, 2024
1 parent aa7327d commit b4e4e49
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,16 @@ public static Provider<Options> createOptions(Project project) {

return createOptions(
project,
KotlinPluginUtils.getKotlinPluginVersion(project),
KotlinPluginUtils.getKotlinMetadataVersion()
KotlinPluginUtils.getKotlinPluginVersion(project)
);
}

private static Provider<Options> createOptions(Project project, String kotlinVersion, String kotlinMetadataVersion) {
private static Provider<Options> createOptions(Project project, String kotlinVersion) {
// Create a detached config to resolve the kotlin std lib for the provided version.
Configuration detachedConfiguration = project.getConfigurations().detachedConfiguration(
project.getDependencies().create("org.jetbrains.kotlin:kotlin-stdlib:" + kotlinVersion),
// Load kotlinx-metadata-jvm like this to work around: https://github.com/gradle/gradle/issues/14727
project.getDependencies().create("org.jetbrains.kotlinx:kotlinx-metadata-jvm:" + kotlinMetadataVersion)
project.getDependencies().create("org.jetbrains.kotlin:kotlin-metadata-jvm:" + kotlinVersion)
);

return TYPE.create(project, options -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.io.UncheckedIOException;
import java.util.Properties;

import kotlin.metadata.jvm.KotlinClassMetadata;
import org.gradle.api.Project;

public class KotlinPluginUtils {
Expand All @@ -56,8 +55,4 @@ private static String loadPropertyFromResources(Class<?> kotlinPluginClass, Stri

return props.getProperty(property);
}

public static String getKotlinMetadataVersion() {
return KotlinClassMetadata.class.getPackage().getImplementationVersion().split("-")[0];
}
}
8 changes: 4 additions & 4 deletions src/test/resources/projects/kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions

plugins {
kotlin("jvm") version "1.9.22"
kotlin("plugin.serialization") version "1.9.22"
kotlin("jvm") version "2.0.21"
kotlin("plugin.serialization") version "2.0.21"
id("fabric-loom")
`maven-publish`
}
Expand All @@ -31,8 +31,8 @@ version = "0.0.1"
dependencies {
minecraft(group = "com.mojang", name = "minecraft", version = "1.16.5")
mappings(group = "net.fabricmc", name = "yarn", version = "1.16.5+build.5", classifier = "v2")
modImplementation("net.fabricmc:fabric-loader:0.12.12")
modImplementation(group = "net.fabricmc", name = "fabric-language-kotlin", version = "1.10.17+kotlin.1.9.22")
modImplementation("net.fabricmc:fabric-loader:0.16.9")
modImplementation(group = "net.fabricmc", name = "fabric-language-kotlin", version = "1.12.3+kotlin.2.0.21")
}

publishing {
Expand Down

0 comments on commit b4e4e49

Please sign in to comment.