File tree 4 files changed +47
-1
lines changed
src/main/kotlin/io/github/petertrr
4 files changed +47
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import io.gitlab.arturbosch.detekt.Detekt
4
4
import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest
5
5
6
6
plugins {
7
- alias(libs.plugins. kotlin. multiplatform)
7
+ kotlin( " multiplatform" )
8
8
alias(libs.plugins.detekt)
9
9
jacoco
10
10
}
Original file line number Diff line number Diff line change @@ -11,4 +11,5 @@ dependencies {
11
11
implementation(" org.ajoberstar.reckon:reckon-gradle:0.13.1" )
12
12
implementation(" org.jetbrains.dokka:dokka-gradle-plugin:1.6.0" )
13
13
implementation(" io.github.gradle-nexus:publish-plugin:1.1.0" )
14
+ implementation(" org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10" )
14
15
}
Original file line number Diff line number Diff line change
1
+ package io.github.petertrr
2
+
3
+ import org.gradle.api.Project
4
+ import org.gradle.api.tasks.compile.JavaCompile
5
+ import org.gradle.jvm.tasks.Jar
6
+ import org.gradle.jvm.toolchain.JavaLanguageVersion
7
+ import org.gradle.jvm.toolchain.JavaToolchainService
8
+ import org.gradle.kotlin.dsl.attributes
9
+ import org.gradle.kotlin.dsl.create
10
+ import org.gradle.kotlin.dsl.getByType
11
+ import org.gradle.kotlin.dsl.named
12
+
13
+ fun Project.createModuleInfoCompilation () = tasks.create<JavaCompile >(" compileJavaModuleInfo" ) {
14
+ // val compileKotlinJvm = tasks.getByName<KotlinCompile>("compileKotlinJvm")
15
+ val sourceDir = file(" src/jvm9Main" )
16
+ // val targetDir = compileKotlinJvm.destinationDir.resolve("../java9/")
17
+
18
+ // Use a Java 11 compiler for the module info.
19
+ javaCompiler.set(project.extensions.getByType<JavaToolchainService >().compilerFor {
20
+ languageVersion.set(JavaLanguageVersion .of(11 ))
21
+ })
22
+
23
+ // dependsOn(compileKotlinJvm)
24
+ source(sourceDir)
25
+
26
+
27
+
28
+
29
+
30
+ // Configure the JAR task so that it will include the compiled module-info class file.
31
+ tasks.named<Jar >(" jvmJar" ) {
32
+ dependsOn(this @create)
33
+ manifest {
34
+ attributes(" Multi-Release" to true )
35
+ }
36
+ // from(targetDir) {
37
+ // into("META-INF/versions/9/")
38
+ // }
39
+ }
40
+ }
Original file line number Diff line number Diff line change
1
+ module io .github .petertrr .kotlin -multiplatform -diff {
2
+ requires transitive kotlin .stdlib ;
3
+
4
+ exports io .github .petertrr .diffutils ;
5
+ }
You can’t perform that action at this time.
0 commit comments