Skip to content

Commit

Permalink
compose gradle plugin, lazy initialization of teamId for iOS deploy (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dima-avdeev-jb authored Jun 20, 2022
1 parent 8faecbb commit 85a7e6c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@ fun Project.registerConnectedDeviceTasks(
id = id,
projectName = projectName,
bundleIdPrefix = bundleIdPrefix,
teamId = deploy.teamId ?: getLocalProperty(TEAM_ID_PROPERTY_KEY)
?: error(
buildString {
appendLine("In local.properties (${localPropertiesFile.absolutePath})")
appendLine("Add property")
appendLine("$TEAM_ID_PROPERTY_KEY=***")
appendLine("Or set teamId in deploy with id: $id")
}
),
getTeamId = {
deploy.teamId ?: getLocalProperty(TEAM_ID_PROPERTY_KEY)
?: error(
buildString {
appendLine("In local.properties (${localPropertiesFile.absolutePath})")
appendLine("Add property")
appendLine("$TEAM_ID_PROPERTY_KEY=***")
appendLine("Or set teamId in deploy with id: $id")
}
)
},
taskInstallXcodeGen = taskInstallXcodeGen,
)

Expand Down

0 comments on commit 85a7e6c

Please sign in to comment.