diff --git a/androidcomponents/androidcomponents.go b/androidcomponents/androidcomponents.go index ce14138..18c128b 100644 --- a/androidcomponents/androidcomponents.go +++ b/androidcomponents/androidcomponents.go @@ -117,12 +117,12 @@ func Ensure(androidSdk *sdk.Model, gradlewPath string) error { func (i installer) getDependencyCases() map[string]func(match string) error { return map[string]func(match string) error{ - `(Observed package id 'ndk-bundle' in inconsistent location)`: i.ndkInconsistentLocation, - `(NDK not configured)`: i.ndkNotConfigured, + `(Observed package id 'ndk-bundle' in inconsistent location)`: i.ndkInconsistentLocation, + `(NDK not configured)`: i.ndkNotConfigured, `failed to find target with hash string 'android-(.*)'\s*`: i.target, `failed to find Build Tools revision ([0-9.]*)\s*`: i.buildTool, - `Could not find (com\.android\.support\..*)\.`: i.extrasLib, - `Could not find any version that matches (com\.android\.support.*)\.`: i.extrasLib, + `Could not find (com\.android\.support:.*)\.`: i.extrasLib, + `Could not find any version that matches (com\.android\.support:*)\.`: i.extrasLib, } } diff --git a/bitrise.yml b/bitrise.yml index f4f3124..1e87a7b 100755 --- a/bitrise.yml +++ b/bitrise.yml @@ -1,12 +1,10 @@ -format_version: "2" +format_version: "8" default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git app: envs: - - STEP_VERSION: "2.2.0" - # define these in your .bitrise.secrets.yml - - SAMPLE_APP_URL: https://github.com/bitrise-samples/sample-apps-android-sdk22.git + - SAMPLE_APP_URL: https://github.com/bitrise-io/sample-apps-android-sdk22.git - BRANCH: master workflows: @@ -53,6 +51,8 @@ workflows: - golint: - errcheck: - go-test: + before_run: + - audit-this-step after_run: - test_ndk - test_old_gradle @@ -61,11 +61,11 @@ workflows: - test_android-sdk22-subdir - test_react_native - test_ndk_install - + - test_support_library test_ndk: envs: - - SAMPLE_APP_URL: https://github.com/bitrise-samples/android-ndk-sample-project.git + - SAMPLE_APP_URL: https://github.com/bitrise-io/android-ndk-sample-project.git - BRANCH: master - GRADLE_BUILD_FILE_PATH: ./build.gradle - GRADLEW_PATH: ./gradlew @@ -111,7 +111,7 @@ workflows: test_react_native: envs: - - SAMPLE_APP_URL: https://github.com/bitrise-samples/ChainReactApp.git + - SAMPLE_APP_URL: https://github.com/bitrise-io/ChainReactApp.git - BRANCH: master - GRADLE_BUILD_FILE_PATH: android/build.gradle - GRADLEW_PATH: android/gradlew @@ -154,7 +154,7 @@ workflows: test_ndk_install: envs: - - SAMPLE_APP_URL: https://github.com/bitrise-samples/android-ndk-sample-project.git + - SAMPLE_APP_URL: https://github.com/bitrise-io/android-ndk-sample-project.git - BRANCH: master - GRADLE_BUILD_FILE_PATH: build.gradle - GRADLEW_PATH: ./gradlew @@ -205,7 +205,44 @@ workflows: test_android-sdk21-tools-21.0.1: envs: - - SAMPLE_APP_URL: https://github.com/bitrise-samples/android-sdk21-tools-21.0.1.git + - SAMPLE_APP_URL: https://github.com/bitrise-io/android-sdk21-tools-21.0.1.git + - BRANCH: master + - GRADLE_BUILD_FILE_PATH: build.gradle + - GRADLEW_PATH: ./gradlew + steps: + - script: + inputs: + - content: |- + #!/usr/bin/env bash + set -e + rm -rf ./_tmp + - change-workdir: + title: Switch working dir to test / _tmp dir + run_if: true + inputs: + - path: ./_tmp + - is_create_path: true + - script: + inputs: + - content: |- + #!/usr/bin/env bash + if [[ -z "${SAMPLE_APP_URL}" ]]; then + echo "error: there is no SAMPLE_APP_URL env var specified" + exit 1 + elif [[ -z "${COMMIT}" && -z "${BRANCH}" ]]; then + echo "error: can't checkout: there is no BRANCH or COMMIT env var specified" + exit 1 + fi + git init + git remote add origin "${SAMPLE_APP_URL}" + git fetch || exit 1 + [[ -n "${COMMIT}" ]] && git checkout "${COMMIT}" || git checkout "${BRANCH}" + - path::./: + title: Step test + + test_support_library: + envs: + - SAMPLE_APP_URL: https://github.com/bitrise-io/sample-apps-android-x.git - BRANCH: master - GRADLE_BUILD_FILE_PATH: build.gradle - GRADLEW_PATH: ./gradlew @@ -216,6 +253,11 @@ workflows: #!/usr/bin/env bash set -e rm -rf ./_tmp + - script: + inputs: + - content: |- + #!/usr/bin/env bash + sdkmanager --uninstall "extras;android;m2repository" - change-workdir: title: Switch working dir to test / _tmp dir run_if: true @@ -242,7 +284,7 @@ workflows: test_old_gradle: envs: - - SAMPLE_APP_URL: https://github.com/bitrise-samples/2048-android.git + - SAMPLE_APP_URL: https://github.com/bitrise-io/2048-android.git - BRANCH: master - GRADLE_BUILD_FILE_PATH: build.gradle - GRADLEW_PATH: ./gradlew @@ -279,7 +321,7 @@ workflows: test_android-sdk20: envs: - - SAMPLE_APP_URL: https://github.com/bitrise-samples/sample-apps-android-sdk20.git + - SAMPLE_APP_URL: https://github.com/bitrise-io/sample-apps-android-sdk20.git - BRANCH: master - GRADLE_BUILD_FILE_PATH: build.gradle - GRADLEW_PATH: ./gradlew @@ -316,7 +358,7 @@ workflows: test_android-sdk22-subdir: envs: - - SAMPLE_APP_URL: https://github.com/bitrise-samples/sample-apps-android-sdk22-subdir.git + - SAMPLE_APP_URL: https://github.com/bitrise-io/sample-apps-android-sdk22-subdir.git - BRANCH: master - GRADLE_BUILD_FILE_PATH: src/build.gradle - GRADLEW_PATH: src/gradlew @@ -365,20 +407,6 @@ workflows: go get -u -v github.com/golang/dep/cmd/dep dep ensure -update -v - # ---------------------------------------------------------------- - # --- workflows to create Release - create-release: - steps: - - script: - title: - inputs: - - content: | - #!/usr/bin/env bash - set -e - - export CI=true - releaseman create --version $STEP_VERSION - # ---------------------------------------------------------------- # --- workflows to Share this step into a Step Library audit-this-step: @@ -389,43 +417,3 @@ workflows: #!/usr/bin/env bash set -ex stepman audit --step-yml ./step.yml - - share-this-step: - envs: - # if you want to share this step into a StepLib - - MY_STEPLIB_REPO_FORK_GIT_URL: $MY_STEPLIB_REPO_FORK_GIT_URL - - STEP_ID_IN_STEPLIB: install-missing-android-tools - - STEP_GIT_VERION_TAG_TO_SHARE: $STEP_VERSION - - STEP_GIT_CLONE_URL: https://github.com/bitrise-steplib/steps-install-missing-android-tools.git - description: |- - If this is the first time you try to share a Step you should - first call: $ bitrise share - - This will print you a guide, and information about how Step sharing - works. Please read it at least once! - - As noted in the Step sharing guide you'll have to fork the - StepLib you want to share this step into. Once you're done with forking - the repository you should set your own fork's git clone URL - in the `.bitrise.secrets.yml` file, or here in the `envs` section, - as the value of the `MY_STEPLIB_REPO_FORK_GIT_URL` environment. - - You're now ready to share this Step, just make sure that - the `STEP_ID_IN_STEPLIB` and `STEP_GIT_VERION_TAG_TO_SHARE` - environments are set to the desired values! - - To share this Step into a StepLib you can just run: $ bitrise run share-this-step - - Once it finishes the only thing left is to actually create a Pull Request, - the way described in the guide printed at the end of the process. - before_run: - - audit-this-step - steps: - - script: - inputs: - - content: |- - #!/usr/bin/env bash - set -ex - bitrise share start -c ${MY_STEPLIB_REPO_FORK_GIT_URL} - bitrise share create --stepid ${STEP_ID_IN_STEPLIB} --tag ${STEP_GIT_VERION_TAG_TO_SHARE} --git ${STEP_GIT_CLONE_URL} - bitrise share finish diff --git a/main.go b/main.go index 797fd8d..4a352d0 100644 --- a/main.go +++ b/main.go @@ -138,7 +138,7 @@ func updateNDK(revision string) error { return err } - if err := updateNDKPathIfNeeded(ndkHome); err != nil { + if err := ensureNDKPath(ndkHome); err != nil { return err } @@ -159,7 +159,7 @@ func updateNDK(revision string) error { return nil } -func updateNDKPathIfNeeded(ndkHome string) error { +func ensureNDKPath(ndkHome string) error { log.Printf("searching for platforms dir in %s", ndkHome) var foundPDPath string if err := filepath.Walk(ndkHome, func(currentPath string, info os.FileInfo, err error) error {