Skip to content

Commit

Permalink
added two test cases (#40)
Browse files Browse the repository at this point in the history
* added two test cases

* added warning

* added log
  • Loading branch information
trapacska authored Jun 11, 2019
1 parent 13c55ee commit 07f6eb9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
18 changes: 18 additions & 0 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,24 @@ workflows:
- keystore_password: $BITRISEIO_ANDROID_KEYSTORE_PASSWORD_4
- keystore_alias: $BITRISEIO_ANDROID_KEYSTORE_ALIAS_4
- private_key_password: $BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD_4
- path::./:
is_skippable: true
title: Step Test - android studio generated keystore (jks) + custom artifact name
inputs:
- keystore_url: $BITRISEIO_ANDROID_KEYSTORE_4_URL
- keystore_password: $BITRISEIO_ANDROID_KEYSTORE_PASSWORD_4
- keystore_alias: $BITRISEIO_ANDROID_KEYSTORE_ALIAS_4
- private_key_password: $BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD_4
- output_name: "test-artifact-name"
- path::./:
is_skippable: true
title: Step Test - android studio generated keystore (jks) + custom artifact name second time to see collisions if any
inputs:
- keystore_url: $BITRISEIO_ANDROID_KEYSTORE_4_URL
- keystore_password: $BITRISEIO_ANDROID_KEYSTORE_PASSWORD_4
- keystore_alias: $BITRISEIO_ANDROID_KEYSTORE_ALIAS_4
- private_key_password: $BITRISEIO_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD_4
- output_name: "test-artifact-name"

_go_tests:
steps:
Expand Down
11 changes: 9 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,12 @@ func main() {
log.Infof("signing %d Build Artifacts", len(buildArtifactPaths))
fmt.Println()

if len(buildArtifactPaths) > 1 && configs.OutputName != "" {
log.Warnf("output_name is set and more than one artifact found, disabling artifact renaming as it would result in overwriting exported artifacts")
fmt.Println()
configs.OutputName = ""
}

for i, buildArtifactPath := range buildArtifactPaths {
artifactExt := path.Ext(buildArtifactPath)
log.Donef("%d/%d signing %s", i+1, len(buildArtifactPaths), buildArtifactPath)
Expand Down Expand Up @@ -433,8 +439,9 @@ func main() {

log.Infof("Zipalign Build Artifact")
signedArtifactName := fmt.Sprintf("%s-bitrise-signed%s", buildArtifactBasename, artifactExt)
if configs.OutputName != "" {
signedArtifactName = fmt.Sprintf("%s%s", configs.OutputName, artifactExt)
if artifactName := fmt.Sprintf("%s%s", configs.OutputName, artifactExt); configs.OutputName != "" {
log.Printf("- Exporting (%s) as: %s", signedArtifactName, artifactName)
signedArtifactName = artifactName
}
fullPath := filepath.Join(buildArtifactDir, signedArtifactName)

Expand Down

0 comments on commit 07f6eb9

Please sign in to comment.