@@ -6,14 +6,14 @@ package dev.icerock.gradle.tasks
66
77import dev.icerock.gradle.CocoaPodInfo
88import dev.icerock.gradle.CocoapodsConfig
9+ import dev.icerock.gradle.LogOutputStream
910import org.gradle.api.DefaultTask
11+ import org.gradle.api.logging.LogLevel
1012import org.gradle.api.tasks.Input
1113import org.gradle.api.tasks.InputDirectory
1214import org.gradle.api.tasks.Internal
1315import org.gradle.api.tasks.OutputDirectory
1416import org.gradle.api.tasks.TaskAction
15- import dev.icerock.gradle.LogOutputStream
16- import org.gradle.api.logging.LogLevel
1717import java.io.File
1818
1919open class CompileCocoaPod : DefaultTask () {
@@ -49,7 +49,9 @@ open class CompileCocoaPod : DefaultTask() {
4949 val configuration: String
5050 get() = config.buildConfiguration
5151
52- private val outputDir: File get() = File (project.buildDir, " cocoapods" )
52+ private val cocoapodsDir: File get() = File (project.buildDir, " cocoapods" )
53+ private val outputDir: File get() = File (cocoapodsDir, compileArch)
54+ private val derivedData: File get() = File (cocoapodsDir, " DerivedData" )
5355
5456 @get:OutputDirectory
5557 val frameworksDir: File
@@ -58,17 +60,17 @@ open class CompileCocoaPod : DefaultTask() {
5860 @TaskAction
5961 fun compile () {
6062 val podsProjectPath = podsProject.absolutePath
61- val podBuildDir = outputDir.absolutePath
62- val derivedData = File (outputDir, " DerivedData " ) .absolutePath
63+ val outputPath = outputDir.absolutePath
64+ val derivedDataPath = derivedData .absolutePath
6365 val cmdLine = arrayOf(
6466 " xcodebuild" ,
6567 " -project" , podsProjectPath,
6668 " -scheme" , scheme,
6769 " -sdk" , compileSdk,
6870 " -arch" , compileArch,
6971 " -configuration" , configuration,
70- " -derivedDataPath" , derivedData ,
71- " SYMROOT=$podBuildDir " ,
72+ " -derivedDataPath" , derivedDataPath ,
73+ " SYMROOT=$outputPath " ,
7274 " DEPLOYMENT_LOCATION=YES" ,
7375 " SKIP_INSTALL=YES" ,
7476 " build"
0 commit comments