Skip to content

Commit a53bfa8

Browse files
committed
fix ios fat framework
1 parent 16a8650 commit a53bfa8

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

build.gradle.kts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,17 +232,23 @@ abstract class PlatformFatFramework: DefaultTask() {
232232
abstract val platform: Property<String>
233233

234234
@get:InputFiles
235-
val inputFrameworks get(): ConfigurableFileCollection = project.objects.fileCollection()
235+
val inputFrameworks = project.objects.fileCollection()
236236

237237
@get:InputFiles
238-
val inputFrameworkDSYMs get(): ConfigurableFileCollection = project.objects.fileCollection()
238+
val inputFrameworkDSYMs = project.objects.fileCollection()
239239

240240
@Internal
241241
val platformOutputDir: Provider<Directory> = platform.map { project.layout.buildDirectory.dir("platform-fat-framework/${it}").get() }
242242

243243
@get:OutputDirectory
244244
val outputDir = project.objects.directoryProperty().convention(platformOutputDir)
245245

246+
@get:OutputDirectories
247+
val outputFiles: Provider<Array<File>> = platformOutputDir.map {arrayOf(
248+
it.asFile.toPath().resolve(inputFrameworks.files.first().name).toFile(),
249+
it.asFile.toPath().resolve(inputFrameworkDSYMs.files.first().name).toFile()
250+
)}
251+
246252
private fun copyFramework() {
247253
val file = inputFrameworks.files.first()
248254
project.copy {
@@ -252,7 +258,7 @@ abstract class PlatformFatFramework: DefaultTask() {
252258
}
253259

254260
private fun copyFrameworkDSYM() {
255-
val file = inputFrameworkDSYMs.files.first()
261+
val file = inputFrameworkDSYMs.first()
256262
project.copy {
257263
from(file)
258264
into(outputDir.get().asFile.toPath().resolve(file.name))
@@ -267,7 +273,7 @@ abstract class PlatformFatFramework: DefaultTask() {
267273
val out = outputDir.get().asFile.toPath()
268274
.resolve(inputFrameworks.files.first().name+"/libpebblecommon").toString()
269275
project.exec {
270-
commandLine ((arrayOf("lipo", "-create") + inputs) + arrayOf("-output", out))
276+
commandLine ("lipo", "-create", *inputs.toTypedArray(), "-output", out)
271277
}
272278
}
273279

@@ -279,7 +285,7 @@ abstract class PlatformFatFramework: DefaultTask() {
279285
val out = outputDir.get().asFile.toPath()
280286
.resolve(inputFrameworkDSYMs.files.first().name+"/Contents/Resources/DWARF/libpebblecommon").toString()
281287
project.exec {
282-
commandLine ((arrayOf("lipo", "-create") + inputs) + arrayOf("-output", out))
288+
commandLine ("lipo", "-create", *inputs.toTypedArray(), "-output", out)
283289
}
284290
}
285291

0 commit comments

Comments
 (0)