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, id: String,
projectName: String, projectName: String,
bundleIdPrefix: String, bundleIdPrefix: String,
teamId: String? = null, getTeamId: () -> String? = { null },
taskInstallXcodeGen: TaskProvider<*>, taskInstallXcodeGen: TaskProvider<*>,
): TaskProvider<AbstractComposeIosTask> = tasks.composeIosTask<AbstractComposeIosTask>("iosGenerateXcodeProject$id") { ): TaskProvider<AbstractComposeIosTask> = tasks.composeIosTask<AbstractComposeIosTask>("iosGenerateXcodeProject$id") {
dependsOn(taskInstallXcodeGen) dependsOn(taskInstallXcodeGen)
@ -26,7 +26,7 @@ internal fun Project.configureTaskToGenerateXcodeProject(
options: options:
bundleIdPrefix: $bundleIdPrefix bundleIdPrefix: $bundleIdPrefix
settings: settings:
${if (teamId != null) "DEVELOPMENT_TEAM: \"$teamId\"" else ""} ${if (getTeamId() != null) "DEVELOPMENT_TEAM: \"${getTeamId()}\"" else ""}
CODE_SIGN_IDENTITY: "iPhone Developer" CODE_SIGN_IDENTITY: "iPhone Developer"
CODE_SIGN_STYLE: Automatic CODE_SIGN_STYLE: Automatic
MARKETING_VERSION: "1.0" 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, id = id,
projectName = projectName, projectName = projectName,
bundleIdPrefix = bundleIdPrefix, bundleIdPrefix = bundleIdPrefix,
teamId = deploy.teamId ?: getLocalProperty(TEAM_ID_PROPERTY_KEY) getTeamId = {
deploy.teamId ?: getLocalProperty(TEAM_ID_PROPERTY_KEY)
?: error( ?: error(
buildString { buildString {
appendLine("In local.properties (${localPropertiesFile.absolutePath})") appendLine("In local.properties (${localPropertiesFile.absolutePath})")
@ -36,7 +37,8 @@ fun Project.registerConnectedDeviceTasks(
appendLine("$TEAM_ID_PROPERTY_KEY=***") appendLine("$TEAM_ID_PROPERTY_KEY=***")
appendLine("Or set teamId in deploy with id: $id") appendLine("Or set teamId in deploy with id: $id")
} }
), )
},
taskInstallXcodeGen = taskInstallXcodeGen, taskInstallXcodeGen = taskInstallXcodeGen,
) )

Loading…
Cancel
Save