Commonization of CocoaPods libraries
#KT-41631
This commit is contained in:
committed by
Space
parent
73bb6d5d34
commit
1654824467
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
<option name="executionName" />
|
<option name="executionName" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
<option name="externalSystemIdString" value="GRADLE" />
|
<option name="externalSystemIdString" value="GRADLE" />
|
||||||
<option name="scriptParameters" value="--tests "org.jetbrains.kotlin.gradle.CommonizerHierarchicalIT" --tests "org.jetbrains.kotlin.gradle.CommonizerIT" --tests "org.jetbrains.kotlin.commonizer.**"" />
|
<option name="scriptParameters" value="--tests "org.jetbrains.kotlin.gradle.CommonizerHierarchicalIT" --tests "org.jetbrains.kotlin.gradle.CommonizerIT" --tests "org.jetbrains.kotlin.commonizer.**" --tests "org.jetbrains.kotlin.gradle.native.CocoaPodsIT.testCinteropCommonization*"" />
|
||||||
<option name="taskDescriptions">
|
<option name="taskDescriptions">
|
||||||
<list />
|
<list />
|
||||||
</option>
|
</option>
|
||||||
|
|||||||
+26
@@ -62,6 +62,7 @@ class CocoaPodsIT : BaseGradleIT() {
|
|||||||
private val templateProjectName = "native-cocoapods-template"
|
private val templateProjectName = "native-cocoapods-template"
|
||||||
private val groovyTemplateProjectName = "native-cocoapods-template-groovy"
|
private val groovyTemplateProjectName = "native-cocoapods-template-groovy"
|
||||||
private val cocoapodsTestsProjectName = "native-cocoapods-tests"
|
private val cocoapodsTestsProjectName = "native-cocoapods-tests"
|
||||||
|
private val cocoapodsCommonizationProjectName = "native-cocoapods-commonization"
|
||||||
|
|
||||||
private val dummyTaskName = ":$DUMMY_FRAMEWORK_TASK_NAME"
|
private val dummyTaskName = ":$DUMMY_FRAMEWORK_TASK_NAME"
|
||||||
private val podspecTaskName = ":$POD_SPEC_TASK_NAME"
|
private val podspecTaskName = ":$POD_SPEC_TASK_NAME"
|
||||||
@@ -903,6 +904,31 @@ class CocoaPodsIT : BaseGradleIT() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testCinteropCommonizationOff() {
|
||||||
|
project = getProjectByName(cocoapodsCommonizationProjectName)
|
||||||
|
hooks.addHook {
|
||||||
|
assertTasksExecuted(":commonizeNativeDistribution")
|
||||||
|
assertTasksNotExecuted(":cinteropAFNetworkingIosArm64")
|
||||||
|
assertTasksNotExecuted(":cinteropAFNetworkingIosX64")
|
||||||
|
assertTasksNotExecuted(":commonizeCInterop")
|
||||||
|
}
|
||||||
|
project.testWithWrapper(":commonize")
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testCinteropCommonizationOn() {
|
||||||
|
project = getProjectByName(cocoapodsCommonizationProjectName)
|
||||||
|
project.gradleProperties().appendLine("kotlin.mpp.enableCInteropCommonization=true")
|
||||||
|
hooks.addHook {
|
||||||
|
assertTasksExecuted(":commonizeNativeDistribution")
|
||||||
|
assertTasksExecuted(":cinteropAFNetworkingIosArm64")
|
||||||
|
assertTasksExecuted(":cinteropAFNetworkingIosX64")
|
||||||
|
assertTasksExecuted(":commonizeCInterop")
|
||||||
|
}
|
||||||
|
project.testWithWrapper(":compileIosMainKotlinMetadata")
|
||||||
|
}
|
||||||
|
|
||||||
// paths
|
// paths
|
||||||
|
|
||||||
private fun CompiledProject.url() = externalSources().resolve("url")
|
private fun CompiledProject.url() = externalSources().resolve("url")
|
||||||
|
|||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
plugins {
|
||||||
|
id("org.jetbrains.kotlin.multiplatform").version("<pluginMarkerVersion>")
|
||||||
|
id("org.jetbrains.kotlin.native.cocoapods").version("<pluginMarkerVersion>")
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "org.jetbrains.kotlin.sample.native"
|
||||||
|
version = "1.0"
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
ios()
|
||||||
|
cocoapods {
|
||||||
|
homepage = "https://github.com/JetBrains/kotlin"
|
||||||
|
summary = "CocoaPods test library"
|
||||||
|
ios.deploymentTarget = "13.5"
|
||||||
|
pod("AFNetworking")
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
kotlin.code.style=official
|
||||||
|
org.gradle.debug=false
|
||||||
|
|
||||||
|
kotlin.mpp.enableGranularSourceSetsMetadata=true
|
||||||
|
kotlin.native.enableDependencyPropagation=false
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
gradlePluginPortal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rootProject.name = "cocoapods"
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
package testProject.`new-mpp-cocoapods-template`.src.iosMain.kotlin
|
||||||
|
|
||||||
|
import cocoapods.AFNetworking.*
|
||||||
|
|
||||||
|
fun foo() : Boolean {
|
||||||
|
val manager = AFURLSessionManager()
|
||||||
|
return manager != null
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user