Browse Source

compose gradle plugin, lazy initialization of teamId for iOS deploy (#2132)

pull/2140/head
dima.avdeev 3 years ago committed by GitHub
parent
commit
85a7e6ced7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/uikit/internal/configureTaskToGenerateXcodeProject.kt
  2. 6
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/uikit/internal/registerConnectedDeviceTasks.kt

4
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/uikit/internal/configureTaskToGenerateXcodeProject.kt

@ -13,7 +13,7 @@ internal fun Project.configureTaskToGenerateXcodeProject(
id: String,
projectName: String,
bundleIdPrefix: String,
teamId: String? = null,
getTeamId: () -> String? = { null },
taskInstallXcodeGen: TaskProvider<*>,
): TaskProvider<AbstractComposeIosTask> = tasks.composeIosTask<AbstractComposeIosTask>("iosGenerateXcodeProject$id") {
dependsOn(taskInstallXcodeGen)
@ -26,7 +26,7 @@ internal fun Project.configureTaskToGenerateXcodeProject(
options:
bundleIdPrefix: $bundleIdPrefix
settings:
${if (teamId != null) "DEVELOPMENT_TEAM: \"$teamId\"" else ""}
${if (getTeamId() != null) "DEVELOPMENT_TEAM: \"${getTeamId()}\"" else ""}
CODE_SIGN_IDENTITY: "iPhone Developer"
CODE_SIGN_STYLE: Automatic
MARKETING_VERSION: "1.0"

6
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/uikit/internal/registerConnectedDeviceTasks.kt

@ -28,7 +28,8 @@ fun Project.registerConnectedDeviceTasks(
id = id,
projectName = projectName,
bundleIdPrefix = bundleIdPrefix,
teamId = deploy.teamId ?: getLocalProperty(TEAM_ID_PROPERTY_KEY)
getTeamId = {
deploy.teamId ?: getLocalProperty(TEAM_ID_PROPERTY_KEY)
?: error(
buildString {
appendLine("In local.properties (${localPropertiesFile.absolutePath})")
@ -36,7 +37,8 @@ fun Project.registerConnectedDeviceTasks(
appendLine("$TEAM_ID_PROPERTY_KEY=***")
appendLine("Or set teamId in deploy with id: $id")
}
),
)
},
taskInstallXcodeGen = taskInstallXcodeGen,
)

Loading…
Cancel
Save