Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: petertrr/kotlin-multiplatform-diff
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: petertrr/kotlin-multiplatform-diff
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: feature/module-info
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Feb 6, 2022

  1. Copy the full SHA
    c6dc167 View commit details
Showing with 47 additions and 1 deletion.
  1. +1 −1 build.gradle.kts
  2. +1 −0 buildSrc/build.gradle.kts
  3. +40 −0 buildSrc/src/main/kotlin/io/github/petertrr/ModuleInfoConfiguratuin.kt
  4. +5 −0 core/src/jvmMain/module-info.java
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest

plugins {
alias(libs.plugins.kotlin.multiplatform)
kotlin("multiplatform")
alias(libs.plugins.detekt)
jacoco
}
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -11,4 +11,5 @@ dependencies {
implementation("org.ajoberstar.reckon:reckon-gradle:0.13.1")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.6.0")
implementation("io.github.gradle-nexus:publish-plugin:1.1.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package io.github.petertrr

import org.gradle.api.Project
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.jvm.tasks.Jar
import org.gradle.jvm.toolchain.JavaLanguageVersion
import org.gradle.jvm.toolchain.JavaToolchainService
import org.gradle.kotlin.dsl.attributes
import org.gradle.kotlin.dsl.create
import org.gradle.kotlin.dsl.getByType
import org.gradle.kotlin.dsl.named

fun Project.createModuleInfoCompilation() = tasks.create<JavaCompile>("compileJavaModuleInfo") {
// val compileKotlinJvm = tasks.getByName<KotlinCompile>("compileKotlinJvm")
val sourceDir = file("src/jvm9Main")
// val targetDir = compileKotlinJvm.destinationDir.resolve("../java9/")

// Use a Java 11 compiler for the module info.
javaCompiler.set(project.extensions.getByType<JavaToolchainService>().compilerFor {
languageVersion.set(JavaLanguageVersion.of(11))
})

// dependsOn(compileKotlinJvm)
source(sourceDir)





// Configure the JAR task so that it will include the compiled module-info class file.
tasks.named<Jar>("jvmJar") {
dependsOn(this@create)
manifest {
attributes("Multi-Release" to true)
}
// from(targetDir) {
// into("META-INF/versions/9/")
// }
}
}
5 changes: 5 additions & 0 deletions core/src/jvmMain/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module io.github.petertrr.kotlin-multiplatform-diff {
requires transitive kotlin.stdlib;

exports io.github.petertrr.diffutils;
}