Add isStatic to the Framework. Static frameworks should not be copied to the application directory during xcode build.
This commit is contained in:
committed by
Pavel Punegov
parent
2a13a1158b
commit
6d7004bf68
@@ -4113,6 +4113,7 @@ Task frameworkTest(String name, Closure<FrameworkTest> configurator) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extraOpts fr.bitcode ? "-Xembed-bitcode" : "-Xembed-bitcode-marker"
|
extraOpts fr.bitcode ? "-Xembed-bitcode" : "-Xembed-bitcode-marker"
|
||||||
|
extraOpts fr.isStatic ? "-Xstatic-framework" : ""
|
||||||
extraOpts fr.opts
|
extraOpts fr.opts
|
||||||
extraOpts project.globalTestArgs
|
extraOpts project.globalTestArgs
|
||||||
|
|
||||||
@@ -4199,7 +4200,7 @@ if (isAppleTarget(project)) {
|
|||||||
bitcode = false
|
bitcode = false
|
||||||
artifact = frameworkArtifactName
|
artifact = frameworkArtifactName
|
||||||
library = libraryName
|
library = libraryName
|
||||||
opts = ['-Xstatic-framework']
|
isStatic = true
|
||||||
}
|
}
|
||||||
swiftSources = ['objcexport']
|
swiftSources = ['objcexport']
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -501,10 +501,11 @@ fun KonanTestExecutable.configureXcodeBuild() {
|
|||||||
// Create a Frameworks folder inside the build dir.
|
// Create a Frameworks folder inside the build dir.
|
||||||
it += "mkdir -p \"\$TARGET_BUILD_DIR/\$FRAMEWORKS_FOLDER_PATH\""
|
it += "mkdir -p \"\$TARGET_BUILD_DIR/\$FRAMEWORKS_FOLDER_PATH\""
|
||||||
// Copy each framework to the Frameworks dir.
|
// Copy each framework to the Frameworks dir.
|
||||||
it += frameworks.map { framework ->
|
it += frameworks.filter { framework -> !framework.isStatic }
|
||||||
val artifact = framework.artifact
|
.map { framework ->
|
||||||
"cp -r \"$testOutput/${this.name}/${project.testTarget.name}/$artifact.framework\" " +
|
val artifact = framework.artifact
|
||||||
"\"\$TARGET_BUILD_DIR/\$FRAMEWORKS_FOLDER_PATH/$artifact.framework\""
|
"cp -r \"$testOutput/${this.name}/${project.testTarget.name}/$artifact.framework\" " +
|
||||||
|
"\"\$TARGET_BUILD_DIR/\$FRAMEWORKS_FOLDER_PATH/$artifact.framework\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.joinToString(separator = "\\n") { it.replace("\"", "\\\"") }
|
}.joinToString(separator = "\\n") { it.replace("\"", "\\\"") }
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ open class FrameworkTest : DefaultTask(), KonanTestExecutable {
|
|||||||
* @param name is the framework name,
|
* @param name is the framework name,
|
||||||
* @param sources framework sources,
|
* @param sources framework sources,
|
||||||
* @param bitcode bitcode embedding in the framework,
|
* @param bitcode bitcode embedding in the framework,
|
||||||
|
* @param isStatic determines that framework is static
|
||||||
* @param artifact the name of the resulting artifact,
|
* @param artifact the name of the resulting artifact,
|
||||||
* @param library library dependency name,
|
* @param library library dependency name,
|
||||||
* @param opts additional options for the compiler.
|
* @param opts additional options for the compiler.
|
||||||
@@ -54,6 +55,7 @@ open class FrameworkTest : DefaultTask(), KonanTestExecutable {
|
|||||||
val name: String,
|
val name: String,
|
||||||
var sources: List<String> = emptyList(),
|
var sources: List<String> = emptyList(),
|
||||||
var bitcode: Boolean = false,
|
var bitcode: Boolean = false,
|
||||||
|
var isStatic: Boolean = false,
|
||||||
var artifact: String = name,
|
var artifact: String = name,
|
||||||
var library: String? = null,
|
var library: String? = null,
|
||||||
var opts: List<String> = emptyList()
|
var opts: List<String> = emptyList()
|
||||||
|
|||||||
Reference in New Issue
Block a user