-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
97e57ff
commit a8ee428
Showing
25 changed files
with
81 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ build/ | |
out/ | ||
.gradle/ | ||
local.properties | ||
flank-debug.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package flank.common | ||
|
||
fun isCI() = System.getenv("CI") != null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
common/src/main/kotlin/flank/common/config/FlankProperties.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package flank.common.config | ||
|
||
import flank.common.flankCommonRootPathString | ||
import flank.common.isCI | ||
import java.nio.file.Paths | ||
import java.util.Properties | ||
|
||
const val ZENHUB_REPO_ID = "zenhub.repo-id" | ||
const val FLANK_REPO = "repo.flank" | ||
const val GCLOUD_REPO = "repo.gcloud_cli" | ||
const val ARTIFACTS_REPO = "repo.test-artifacts" | ||
const val IT_WORKFLOW_FILE = "integration.workflow-filename" | ||
const val IT_USER = "integration.issue-poster" | ||
const val SDK_WORKFLOW = "sdk-check.workflow-filename" | ||
const val SDK_USER = "sdk-check.issue-poster" | ||
|
||
private val defaults = Properties().apply { | ||
setProperty(ZENHUB_REPO_ID, "84221974") | ||
setProperty(FLANK_REPO, "Flank/flank") | ||
setProperty(GCLOUD_REPO, "Flank/gcloud_cli") | ||
setProperty(ARTIFACTS_REPO, "Flank/test_artifacts") | ||
setProperty(IT_WORKFLOW_FILE, "full_suite_integration_tests.yml") | ||
setProperty(IT_USER, "github-actions[bot]") | ||
setProperty(SDK_WORKFLOW, "update_dependencies_and_client.yml") | ||
setProperty(SDK_USER, "github-actions[bot]") | ||
} | ||
|
||
class SafeProperties(defaults: Properties) : Properties(defaults) { | ||
override fun get(key: Any?) = (key as String).run { | ||
requireNotNull(if (shouldUseDefaults()) defaults.getProperty(key) else getProperty(key)) | ||
} | ||
} | ||
|
||
// default properties should be used in CI and during tests | ||
private fun shouldUseDefaults() = isCI() || isTest() | ||
|
||
private fun isTest() = System.getProperty("testScript") != null | ||
|
||
val flankProjectProperties = SafeProperties(defaults).also { prop -> | ||
with(Paths.get("$flankCommonRootPathString/flank-debug.properties").toFile()) { | ||
if (exists()) prop.load(inputStream()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,3 @@ out/ | |
buildSrc/.gradle/ | ||
buildSrc/build | ||
local.properties | ||
flank-scripts.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
52 changes: 10 additions & 42 deletions
52
flank-scripts/src/main/kotlin/flank/scripts/config/FlankScriptsConfigs.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ripts/src/main/kotlin/flank/scripts/contribution/ideaktlint/IdeaKtlintCodeStyleCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
flank-scripts/src/main/kotlin/flank/scripts/shell/BuildFlank.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
flank-scripts/src/main/kotlin/flank/scripts/shell/firebase/apiclient/UpdateApiJsonCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
flank-scripts/src/main/kotlin/flank/scripts/shell/ios/SetupIosEnvCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
flank-scripts/src/main/kotlin/flank/scripts/shell/ios/UniversalFramework.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
flank-scripts/src/main/kotlin/flank/scripts/shell/ops/BuildAndroid.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
flank-scripts/src/main/kotlin/flank/scripts/shell/ops/BuildIosIPA.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
flank-scripts/src/main/kotlin/flank/scripts/shell/ops/BuildIosTestArtifacts.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
flank-scripts/src/main/kotlin/flank/scripts/shell/ops/GoOpsCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters