nestserau
01/30/2019, 2:10 PMmain
to a custom name of mine. But how should I adjust the packForXCode
task? I don’t understand. Can someone guide me? That’s my iOS target:
final def iosTarget = System.getenv('SDK_NAME')?.startsWith("iphoneos") ? presets.iosArm64 : presets.iosX64
fromPreset(iosTarget, 'ios') {
binaries {
framework {
baseName = 'reports'
}
}
}
svyatoslav.scherbina
01/30/2019, 2:22 PMBut how should I adjust theWhy do you find this necessary?task?packForXCode
nestserau
01/30/2019, 2:25 PMpackForXCode
in its default form, I get:
* What went wrong:
Could not determine the dependencies of task ':packForXCode'.
> Task with path 'linkMainDebugFrameworkIos' not found in root project 'reports'.
And that is true. The only tasks I get are linkDebugFrameworkIos
and linkReleaseFrameworkIos
.yshrsmz
01/30/2019, 3:02 PMnestserau
01/30/2019, 3:23 PMyshrsmz
01/30/2019, 3:41 PMnestserau
01/30/2019, 3:45 PMyshrsmz
01/30/2019, 3:47 PMnestserau
01/30/2019, 3:55 PMpackForXCode
task:
task packForXCode(type: Sync) {
final File frameworkDir = new File(buildDir, "xcode-frameworks")
final String mode = project.findProperty("XCODE_CONFIGURATION")?.toUpperCase() ?: 'DEBUG'
inputs.property "mode", mode
def binary = kotlin.targets.ios.compilations.main.target.binaries.findFramework("", mode)
dependsOn binary.linkTask
from { binary.outputFile.parent }
into frameworkDir
doLast {
new File(frameworkDir, 'gradlew').with {
text = "#!/bin/bash\nexport 'JAVA_HOME=${System.getProperty("java.home")}'\ncd '${rootProject.rootDir}'\n./gradlew \$@\n"
setExecutable(true)
}
}
}
drofwarcs
01/30/2019, 4:30 PMdef binary = kotlin.targets.ios.compilations.main.target.binaries.findFramework("", mode)
to kotlinnestserau
01/30/2019, 4:32 PMyshrsmz
01/30/2019, 4:39 PMios
is dynamically defined namedrofwarcs
01/30/2019, 5:04 PMval nativeTarget = kotlin.targets["ios"] as KotlinNativeTarget
val srcFile = nativeTarget.binaries.getFramework(buildType).outputFile
was the closest thing I can get to build, but not sure if that works and it looks very verbose