Commit 18a2c42 1 parent c90794f commit 18a2c42 Copy full SHA for 18a2c42
File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import kotlinx.validation.ApiValidationExtension
6
6
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithTests
7
7
import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType
8
8
import org.jetbrains.kotlin.gradle.plugin.mpp.TestExecutable
9
+ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
9
10
10
11
plugins {
11
12
kotlin(" multiplatform" )
@@ -189,14 +190,27 @@ kotlin {
189
190
}
190
191
191
192
tasks {
193
+ val compileModuleInfo by registering(JavaCompile ::class ) {
194
+ classpath = objects.fileCollection()
195
+ .from(configurations.named(" jvmCompileClasspath" ))
196
+ val compileKotlinJvm = named<KotlinCompile >(" compileKotlinJvm" )
197
+ dependsOn(compileKotlinJvm)
198
+ options.compilerArgumentProviders.plusAssign(CommandLineArgumentProvider {
199
+ listOf (" --patch-module" , " okio=${compileKotlinJvm.get().destinationDirectory.get().asFile.absolutePath} " )
200
+ })
201
+ destinationDirectory = layout.buildDirectory.dir(" classes/java/moduleInfo" )
202
+ options.release = 11
203
+ source(layout.projectDirectory.dir(" src/jvmMain/java" ))
204
+ }
205
+
192
206
val jvmJar by getting(Jar ::class ) {
193
207
// BundleTaskConvention() crashes unless there's a 'main' source set.
194
208
sourceSets.create(SourceSet .MAIN_SOURCE_SET_NAME )
209
+ from(compileModuleInfo)
195
210
val bndConvention = BundleTaskConvention (this )
196
211
bndConvention.setBnd(
197
212
"""
198
213
Export-Package: okio
199
- Automatic-Module-Name: okio
200
214
Bundle-SymbolicName: com.squareup.okio
201
215
""" ,
202
216
)
Original file line number Diff line number Diff line change
1
+ module okio {
2
+ requires java .logging ;
3
+ requires kotlin .stdlib ;
4
+
5
+ exports okio ;
6
+ }
You can’t perform that action at this time.
0 commit comments