Sam
03/25/2020, 3:20 PMSam
03/25/2020, 3:22 PMval iOSTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget =
if (System.getenv("SDK_NAME")?.startsWith("iphoneos") == true)
::iosArm64
else
::iosX64
iOSTarget("ios") {
binaries {
framework {
baseName = "Roll20Core"
freeCompilerArgs = arrayListOf("-Xobjc-generics")
embedBitcode("bitcode")
}
}
}
The pack for xcode task is:
val packForXcode by tasks.creating(Sync::class) {
val targetDir = File(buildDir, "xcode-frameworks")
/// selecting the right configuration for the iOS
/// framework depending on the environment
/// variables set by Xcode build
val mode = (project.findProperty("XCODE_CONFIGURATION")?.toString()?.toUpperCase() ?: "DEBUG").split("_").first()
val framework = kotlin.targets.getByName<KotlinNativeTarget>("ios").binaries.getFramework(mode)
inputs.property("mode", mode)
dependsOn(framework.linkTask)
from({ framework.outputDirectory })
into(targetDir)
doLast {
val gradlew = File(targetDir, "gradlew")
gradlew.writeText(
"#!/bin/bash\n"
+ "export 'JAVA_HOME=${System.getProperty("java.home")}'\n"
+ "cd '${rootProject.rootDir}'\n"
+ "./gradlew \$@\n"
)
gradlew.setExecutable(true)
}
}
Magnus Nilsson
04/27/2020, 12:36 PMThomas
04/27/2020, 12:40 PMMagnus Nilsson
04/27/2020, 12:45 PM...Script-F7D1D3BA22B249CD00E4E352.sh: line 3: ./gradlew: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
. Was that the wrong Gradle clean?Thomas
04/27/2020, 12:54 PMThomas
04/27/2020, 12:56 PMMagnus Nilsson
04/27/2020, 1:34 PMSam
04/27/2020, 3:11 PM