Gradle plugin: remove old native binary APIs
This patch removes APIs for native binary configuring introduced in 1.3.0 and deprecated in 1.3.30. Issue #KT-31229 Fixed
This commit is contained in:
-27
@@ -205,33 +205,6 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
build("clean", "assemble", "--rerun-tasks") {
|
||||
checkAppBuild()
|
||||
}
|
||||
|
||||
// Check that binary getters initially introduced in 1.3 work.
|
||||
build("checkBinaryGetters") {
|
||||
assertTrue(output.contains("Wasm binary file: main.wasm"))
|
||||
assertTrue(output.contains("Wasm link task: linkMainReleaseExecutableWasm32"))
|
||||
assertTrue(output.contains("Wasm link task name: linkMainReleaseExecutableWasm32"))
|
||||
|
||||
val testFiles = listOf(
|
||||
"MacOS" to "test.kexe",
|
||||
"Windows" to "test.exe",
|
||||
"Linux" to "test.kexe"
|
||||
)
|
||||
|
||||
val testLinkTasks = listOf(
|
||||
"MacOS" to "linkTestDebugExecutableMacos64",
|
||||
"Windows" to "linkTestDebugExecutableMingw64",
|
||||
"Linux" to "linkTestDebugExecutableLinux64"
|
||||
)
|
||||
|
||||
testFiles.forEach { (platform, file) ->
|
||||
assertTrue(output.contains("$platform test file: $file"), "Cannot get test binary for platform $platform")
|
||||
}
|
||||
|
||||
testLinkTasks.forEach { (platform, task) ->
|
||||
assertTrue(output.contains("$platform test link task: $task"), "Cannot get test link task for platform $platform")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
with(oldStyleAppProject) {
|
||||
|
||||
+6
-22
@@ -24,13 +24,14 @@ kotlin {
|
||||
val macos64 = macosX64("macos64")
|
||||
|
||||
configure(listOf(wasm32, linux64, mingw64, macos64)) {
|
||||
compilations.getByName("main") {
|
||||
outputKinds.add(EXECUTABLE)
|
||||
entryPoint = "com.example.app.native.main"
|
||||
binaries.executable("main") {
|
||||
entryPoint = "com.example.app.native.main"
|
||||
}
|
||||
|
||||
binaries.all {
|
||||
// Check that linker options are correctly passed to the compiler.
|
||||
linkerOpts = mutableListOf("-L.")
|
||||
}
|
||||
compilations["test"].linkerOpts = mutableListOf("-L.")
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
@@ -60,23 +61,6 @@ kotlin {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.create("checkBinaryGetters") {
|
||||
doLast {
|
||||
println("Wasm binary file: ${wasm32.compilations.getByName("main").getBinary("EXECUTABLE", "RELEASE").name}")
|
||||
println("Wasm link task: ${wasm32.compilations.getByName("main").getLinkTask("EXECUTABLE", "RELEASE").name}")
|
||||
println("Wasm link task name: ${wasm32.compilations.getByName("main").linkTaskName("EXECUTABLE", "RELEASE")}")
|
||||
|
||||
println("Windows test file: ${mingw64.compilations.getByName("test").getBinary("EXECUTABLE", "DEBUG").name}")
|
||||
println("Windows test link task: ${mingw64.compilations.getByName("test").getLinkTask("EXECUTABLE", "DEBUG").name}")
|
||||
|
||||
println("MacOS test file: ${macos64.compilations.getByName("test").getBinary("EXECUTABLE", "DEBUG").name}")
|
||||
println("MacOS test link task: ${macos64.compilations.getByName("test").getLinkTask("EXECUTABLE", "DEBUG").name}")
|
||||
|
||||
println("Linux test file: ${linux64.compilations.getByName("test").getBinary("EXECUTABLE", "DEBUG").name}")
|
||||
println("Linux test link task: ${linux64.compilations.getByName("test").getLinkTask("EXECUTABLE", "DEBUG").name}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.create("resolveRuntimeDependencies", DefaultTask::class.java) {
|
||||
|
||||
+8
-22
@@ -64,11 +64,14 @@ kotlin {
|
||||
fromPreset(presets.macosX64, 'macos64')
|
||||
|
||||
configure([wasm32, linux64, mingw64, macos64]) {
|
||||
compilations.main.outputKinds += org.jetbrains.kotlin.gradle.plugin.mpp.NativeOutputKind.EXECUTABLE
|
||||
compilations.main.entryPoint = "com.example.app.native.main"
|
||||
// Check that linker options are correctly passed to the compiler.
|
||||
compilations.main.linkerOpts = ['-L.']
|
||||
compilations.test.linkerOpts = ['-L.']
|
||||
binaries.executable("main") {
|
||||
entryPoint = "com.example.app.native.main"
|
||||
}
|
||||
|
||||
binaries.all {
|
||||
// Check that linker options are correctly passed to the compiler.
|
||||
linkerOpts = ['-L.']
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,20 +83,3 @@ task resolveRuntimeDependencies(type: DefaultTask) {
|
||||
configurations[configName].resolve()
|
||||
}
|
||||
}
|
||||
|
||||
task checkBinaryGetters {
|
||||
doLast {
|
||||
println("Wasm binary file: ${kotlin.targets.wasm32.compilations.main.getBinary("EXECUTABLE", "RELEASE").name}")
|
||||
println("Wasm link task: ${kotlin.targets.wasm32.compilations.main.getLinkTask("EXECUTABLE", "RELEASE").name}")
|
||||
println("Wasm link task name: ${kotlin.targets.wasm32.compilations.main.linkTaskName("EXECUTABLE", "RELEASE")}")
|
||||
|
||||
println("Windows test file: ${kotlin.targets.mingw64.compilations.test.getBinary("EXECUTABLE", "DEBUG").name}")
|
||||
println("Windows test link task: ${kotlin.targets.mingw64.compilations.test.getLinkTask("EXECUTABLE", "DEBUG").name}")
|
||||
|
||||
println("MacOS test file: ${kotlin.targets.macos64.compilations.test.getBinary("EXECUTABLE", "DEBUG").name}")
|
||||
println("MacOS test link task: ${kotlin.targets.macos64.compilations.test.getLinkTask("EXECUTABLE", "DEBUG").name}")
|
||||
|
||||
println("Linux test file: ${kotlin.targets.linux64.compilations.test.getBinary("EXECUTABLE", "DEBUG").name}")
|
||||
println("Linux test link task: ${kotlin.targets.linux64.compilations.test.getLinkTask("EXECUTABLE", "DEBUG").name}")
|
||||
}
|
||||
}
|
||||
-4
@@ -45,9 +45,5 @@ kotlin {
|
||||
fromPreset(presets.mingwX64, 'mingw64')
|
||||
// Test building a 32-bit Windows binary.
|
||||
fromPreset(presets.mingwX86, 'mingw86')
|
||||
|
||||
configure([macos64, linux64, mingw64, mingw86]) {
|
||||
compilations.main.outputKinds ['EXECUTABLE']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-2
@@ -22,14 +22,17 @@ repositories {
|
||||
kotlin {
|
||||
targets {
|
||||
fromPreset(presets.macosX64, 'macos64') {
|
||||
compilations.main.outputKinds = [FRAMEWORK]
|
||||
binaries.framework("main")
|
||||
}
|
||||
|
||||
fromPreset(presets.linuxX64, 'linux64')
|
||||
fromPreset(presets.mingwX64, 'mingw64')
|
||||
|
||||
configure([linux64, mingw64, macos64]) {
|
||||
compilations.main.outputKinds += [DYNAMIC, STATIC]
|
||||
binaries {
|
||||
sharedLib("main")
|
||||
staticLib("main")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user