Skip to content

Commit

Permalink
Merge pull request #13 from bitrise-steplib/update
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
godrei authored Jul 29, 2016
2 parents 2ded0df + 7da0378 commit 4231ba8
Show file tree
Hide file tree
Showing 15 changed files with 250 additions and 208 deletions.
118 changes: 39 additions & 79 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ workflows:
test:
title: Bitrise Init Test
description: Bitrise Init Test
envs:
- CLONE_INTO_DIR: _tmp
steps:
- script:
title: "Scann test: ios-no-shared-schemes"
Expand All @@ -23,17 +25,11 @@ workflows:
rm -rf ./_tmp
SAMPLE_APP_REPOSITORY_URL=https://github.com/bitrise-samples/ios-no-shared-schemes.git
git clone $SAMPLE_APP_REPOSITORY_URL ./_tmp/sample-repo
- change-workdir:
title: Switch working dir to ./_tmp
run_if: true
inputs:
- path: ./_tmp/sample-repo
- is_create_path: true
git clone $SAMPLE_APP_REPOSITORY_URL $CLONE_INTO_DIR
- path::./:
title: Step Test
inputs:
- scan_dir: ./
- scan_dir: $CLONE_INTO_DIR
- output_dir: ../result
- scan_result_submit_url: $BITRISE_SCAN_RESULT_POST_URL
- scan_result_submit_api_token: $BITRISE_APP_API_TOKEN
Expand All @@ -44,19 +40,13 @@ workflows:
#!/bin/bash
set -x
rm -rf ./_tmp
rm -rf $CLONE_INTO_DIR
SAMPLE_APP_REPOSITORY_URL=https://github.com/bitrise-io/sample-apps-ios-simple-objc.git
git clone $SAMPLE_APP_REPOSITORY_URL ./_tmp/sample-repo
- change-workdir:
title: Switch working dir to ./_tmp
run_if: true
inputs:
- path: ./_tmp/sample-repo
- is_create_path: true
git clone $SAMPLE_APP_REPOSITORY_URL $CLONE_INTO_DIR
- path::./:
title: Step Test
inputs:
- scan_dir: ./
- scan_dir: $CLONE_INTO_DIR
- output_dir: ../result
- scan_result_submit_url: $BITRISE_SCAN_RESULT_POST_URL
- scan_result_submit_api_token: $BITRISE_APP_API_TOKEN
Expand All @@ -67,19 +57,13 @@ workflows:
#!/bin/bash
set -x
rm -rf ./_tmp
rm -rf $CLONE_INTO_DIR
SAMPLE_APP_REPOSITORY_URL=https://github.com/bitrise-samples/sample-apps-android-sdk22.git
git clone $SAMPLE_APP_REPOSITORY_URL ./_tmp/sample-repo
- change-workdir:
title: Switch working dir to ./_tmp
run_if: true
inputs:
- path: ./_tmp/sample-repo
- is_create_path: true
- path::./:
title: Step Test
inputs:
- scan_dir: ./
- scan_dir: $CLONE_INTO_DIR
- output_dir: ../result
- scan_result_submit_url: $BITRISE_SCAN_RESULT_POST_URL
- scan_result_submit_api_token: $BITRISE_APP_API_TOKEN
Expand All @@ -90,19 +74,13 @@ workflows:
#!/bin/bash
set -x
rm -rf ./_tmp
rm -rf $CLONE_INTO_DIR
SAMPLE_APP_REPOSITORY_URL=https://github.com/bitrise-samples/xamarin-sample-app.git
git clone $SAMPLE_APP_REPOSITORY_URL ./_tmp/sample-repo
- change-workdir:
title: Switch working dir to ./_tmp
run_if: true
inputs:
- path: ./_tmp/sample-repo
- is_create_path: true
git clone $SAMPLE_APP_REPOSITORY_URL $CLONE_INTO_DIR
- path::./:
title: Step Test
inputs:
- scan_dir: ./
- scan_dir: $CLONE_INTO_DIR
- output_dir: ../result
- scan_result_submit_url: $BITRISE_SCAN_RESULT_POST_URL
- scan_result_submit_api_token: $BITRISE_APP_API_TOKEN
Expand All @@ -113,53 +91,47 @@ workflows:
#!/bin/bash
set -x
rm -rf ./_tmp
rm -rf $CLONE_INTO_DIR
SAMPLE_APP_REPOSITORY_URL=https://github.com/bitrise-io/sample-apps-ios-watchkit.git
git clone $SAMPLE_APP_REPOSITORY_URL ./_tmp/sample-repo
- change-workdir:
title: Switch working dir to ./_tmp
run_if: true
- path::./:
title: Step Test
inputs:
- scan_dir: $CLONE_INTO_DIR
- output_dir: ../result
- scan_result_submit_url: $BITRISE_SCAN_RESULT_POST_URL
- scan_result_submit_api_token: $BITRISE_APP_API_TOKEN
- script:
title: "Scanner test: fastlane"
inputs:
- path: ./_tmp/sample-repo
- is_create_path: true
- content: |-
#!/bin/bash
set -x
rm -rf $CLONE_INTO_DIR
SAMPLE_APP_REPOSITORY_URL=https://github.com/bitrise-samples/fastlane.git
git clone $SAMPLE_APP_REPOSITORY_URL $CLONE_INTO_DIR
- path::./:
title: Step Test
inputs:
- scan_dir: ./
- scan_dir: $CLONE_INTO_DIR
- output_dir: ../result
- scan_result_submit_url: $BITRISE_SCAN_RESULT_POST_URL
- scan_result_submit_api_token: $BITRISE_APP_API_TOKEN
# - script:
# title: "Scann test: android-sdk22-no-gradlew"
# inputs:
# - content: |-
# #!/bin/bash
# set -x
#
# rm -rf ./_tmp
# SAMPLE_APP_REPOSITORY_URL=https://github.com/bitrise-samples/android-sdk22-no-gradlew.git
# git clone $SAMPLE_APP_REPOSITORY_URL ./_tmp/sample-repo
# $SCANNER_BIN --ci config --dir ./_tmp/sample-repo --output-dir ./_tmp/output --format json
- script:
title: "Scann test: sample-apps-xamarin-ios"
inputs:
- content: |-
#!/bin/bash
set -x
rm -rf ./_tmp
rm -rf $CLONE_INTO_DIR
SAMPLE_APP_REPOSITORY_URL=https://github.com/bitrise-io/sample-apps-xamarin-ios.git
git clone $SAMPLE_APP_REPOSITORY_URL ./_tmp/sample-repo
- change-workdir:
title: Switch working dir to ./_tmp
run_if: true
inputs:
- path: ./_tmp/sample-repo
- is_create_path: true
git clone $SAMPLE_APP_REPOSITORY_URL $CLONE_INTO_DIR
- path::./:
title: Step Test
inputs:
- scan_dir: ./
- scan_dir: $CLONE_INTO_DIR
- output_dir: ../result
- scan_result_submit_url: $BITRISE_SCAN_RESULT_POST_URL
- scan_result_submit_api_token: $BITRISE_APP_API_TOKEN
Expand All @@ -170,19 +142,13 @@ workflows:
#!/bin/bash
set -x
rm -rf ./_tmp
rm -rf $CLONE_INTO_DIR
SAMPLE_APP_REPOSITORY_URL=https://github.com/bitrise-samples/android-non-executable-gradlew.git
git clone $SAMPLE_APP_REPOSITORY_URL ./_tmp/sample-repo
- change-workdir:
title: Switch working dir to ./_tmp
run_if: true
inputs:
- path: ./_tmp/sample-repo
- is_create_path: true
git clone $SAMPLE_APP_REPOSITORY_URL $CLONE_INTO_DIR
- path::./:
title: Step Test
inputs:
- scan_dir: ./
- scan_dir: $CLONE_INTO_DIR
- output_dir: ../result
- scan_result_submit_url: $BITRISE_SCAN_RESULT_POST_URL
- scan_result_submit_api_token: $BITRISE_APP_API_TOKEN
Expand All @@ -193,19 +159,13 @@ workflows:
#!/bin/bash
set -x
rm -rf ./_tmp
rm -rf $CLONE_INTO_DIR
SAMPLE_APP_REPOSITORY_URL=https://github.com/bitrise-io/sample-apps-xamarin-android.git
git clone $SAMPLE_APP_REPOSITORY_URL ./_tmp/sample-repo
- change-workdir:
title: Switch working dir to ./_tmp
run_if: true
inputs:
- path: ./_tmp/sample-repo
- is_create_path: true
git clone $SAMPLE_APP_REPOSITORY_URL $CLONE_INTO_DIR
- path::./:
title: Step Test
inputs:
- scan_dir: ./
- scan_dir: $CLONE_INTO_DIR
- output_dir: ../result
- scan_result_submit_url: $BITRISE_SCAN_RESULT_POST_URL
- scan_result_submit_api_token: $BITRISE_APP_API_TOKEN
Expand Down
2 changes: 1 addition & 1 deletion deplock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"dep_locks": [
{
"url": "https://github.com/bitrise-core/bitrise-init.git",
"revision": "6ea3593dd0ffb50b69518e684af98ae87a28caf6"
"revision": "fd5850437e18db75178693eabe0b489e35fa0ac5"
}
]
}
15 changes: 13 additions & 2 deletions go/src/github.com/bitrise-core/bitrise-init/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
## Changelog (Current version: 0.9.9)
## Changelog (Current version: 0.9.11)

-----------------

### 0.9.11 (2016 Jul 29)

* [1bad745] prepare for 0.9.11
* [1d56f71] typo fix

### 0.9.10 (2016 Jul 29)

* [ca94c8c] prepare for 0.9.10
* [f541e09] fastalne test, logging updates (#37)
* [0253f44] logging updates, godep update (#36)

### 0.9.9 (2016 Jul 28)

* [e68da49] prepare for 0.9.9
Expand Down Expand Up @@ -98,4 +109,4 @@

-----------------

Updated: 2016 Jul 28
Updated: 2016 Jul 29

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions go/src/github.com/bitrise-core/bitrise-init/bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,17 @@ workflows:
SAMPLE_APP_REPOSITORY_URL=https://github.com/bitrise-io/sample-apps-ios-watchkit.git
git clone $SAMPLE_APP_REPOSITORY_URL ./_tmp/sample-repo
$SCANNER_BIN --ci config --dir ./_tmp/sample-repo --output-dir ./_tmp/output --format json
# - script:
# title: "Scanner test: android-sdk22-no-gradlew"
# inputs:
# - content: |-
# #!/bin/bash
# set -x
#
# rm -rf ./_tmp
# SAMPLE_APP_REPOSITORY_URL=https://github.com/bitrise-samples/android-sdk22-no-gradlew.git
# git clone $SAMPLE_APP_REPOSITORY_URL ./_tmp/sample-repo
# $SCANNER_BIN --ci config --dir ./_tmp/sample-repo --output-dir ./_tmp/output --format json
- script:
title: "Scanner test: fastlane"
inputs:
- content: |-
#!/bin/bash
set -x
rm -rf ./_tmp
SAMPLE_APP_REPOSITORY_URL=https://github.com/bitrise-samples/fastlane.git
git clone $SAMPLE_APP_REPOSITORY_URL ./_tmp/sample-repo
$SCANNER_BIN --ci config --dir ./_tmp/sample-repo --output-dir ./_tmp/output --format json
- script:
title: "Scanner test: sample-apps-xamarin-ios"
inputs:
Expand Down Expand Up @@ -212,7 +212,7 @@ workflows:
2, Export RELEASE_VERSION
3, Create binaries
envs:
- RELEASE_VERSION: 0.9.9
- RELEASE_VERSION: 0.9.11
after_run:
- _export_release_version
- create_binaries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,48 +157,48 @@ func (scanner *Scanner) DetectPlatform() (bool, error) {
}
scanner.GradleFiles = gradleFiles

log.InfofDetails("%d build.gradle file(s) detected:", len(gradleFiles))
log.Details("%d build.gradle file(s) detected", len(gradleFiles))
for _, file := range gradleFiles {
log.InfofDetails(" - %s", file)
log.Details("- %s", file)
}

if len(gradleFiles) == 0 {
log.InfofDetails("platform not detected")
log.Details("platform not detected")
return false, nil
}

log.InfofReceipt("platform detected")
log.Done("Platform detected")

return true, nil
}

// Options ...
func (scanner *Scanner) Options() (models.OptionModel, models.Warnings, error) {
// Search for gradlew_path input
log.InfoSection("Searching for gradlew files")
log.Info("Searching for gradlew files")

warnings := models.Warnings{}
gradlewFiles := filterGradlewFiles(scanner.FileList)

log.InfofDetails("%d gradlew file(s) detected:", len(gradlewFiles))
log.Details("%d gradlew file(s) detected", len(gradlewFiles))
for _, file := range gradlewFiles {
log.InfofDetails(" - %s", file)
log.Details("- %s", file)
}

rootGradlewPath := ""
if len(gradlewFiles) > 0 {
rootGradlewPath = gradlewFiles[0]
scanner.HasGradlewFile = true

log.InfofDetails("root gradlew path: %s", rootGradlewPath)
log.Details("root gradlew path: %s", rootGradlewPath)
} else {
log.Warnf("No gradlew file found")
log.Warn("No gradlew file found")
warnings = append(warnings, "no gradlew file found")
}

gradleBin := "gradle"
if scanner.HasGradlewFile {
log.InfofDetails("adding executable permission to gradlew file")
log.Details("adding executable permission to gradlew file")

err := os.Chmod(rootGradlewPath, 0770)
if err != nil {
Expand All @@ -208,17 +208,20 @@ func (scanner *Scanner) Options() (models.OptionModel, models.Warnings, error) {
gradleBin = rootGradlewPath
}

log.InfofReceipt("gradle bin to use by inspect: %s", gradleBin)
log.Details("gradle bin to use: %s", gradleBin)

// Inspect Gradle files
gradleFileOption := models.NewOptionModel(gradleFileTitle, gradleFileEnvKey)

for _, gradleFile := range scanner.GradleFiles {
log.InfofSection("Gradle file: %s", gradleFile)
log.Info("Inspecting gradle file: %s", gradleFile)

configs := defaultGradleTasks

log.InfofReceipt("gradle tasks: %v", configs)
log.Details("%d gradle task(s) found", len(configs))
for _, config := range configs {
log.Details("- %s", config)
}

gradleTaskOption := models.NewOptionModel(gradleTaskTitle, gradleTaskEnvKey)
for _, config := range configs {
Expand Down
Loading

0 comments on commit 4231ba8

Please sign in to comment.