Skip to content

Commit dd2535d

Browse files
authored
Merge pull request bitrise-steplib#16 from bitrise-steplib/add-gradle_kts-test
Add gradle kts test
2 parents 428918d + c0bf94b commit dd2535d

File tree

15 files changed

+236
-50
lines changed

15 files changed

+236
-50
lines changed

Gopkg.lock

+26-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

100755100644
+11-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1+
2+
[[constraint]]
3+
branch = "master"
4+
name = "github.com/bitrise-io/go-android"
5+
16
[[constraint]]
2-
name = "github.com/bitrise-io/go-utils"
37
branch = "master"
8+
name = "github.com/bitrise-io/go-steputils"
9+
10+
[[constraint]]
11+
branch = "master"
12+
name = "github.com/bitrise-io/go-utils"
413

514
[[constraint]]
6-
name = "github.com/bitrise-tools/go-steputils"
715
branch = "master"
16+
name = "github.com/kballard/go-shellquote"
817

918
[prune]
1019
go-tests = true

bitrise.yml

+89-12
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
format_version: 5
1+
format_version: 7
22
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
33

44
app:
55
envs:
6-
- BITRISE_STEP_GIT_CLONE_URL: https://github.com/bitrise-steplib/bitrise-step-android-unit-test.git
7-
- MY_STEPLIB_REPO_FORK_GIT_URL: $MY_STEPLIB_REPO_FORK_GIT_URL
8-
- SAMPLE_REPO_GIT_CLONE_URL: https://github.com/bitrise-samples/android-multiple-test-results-sample.git
6+
- SAMPLE_REPO_GIT_CLONE_URL: https://github.com/bitrise-io/android-multiple-test-results-sample.git
7+
- SAMPLE_REPO_KOTLIN_GRADLE_URL: https://github.com/bitrise-io/android-gradle-kotlin-dsl.git
8+
- ORIG_BITRISE_SOURCE_DIR: $BITRISE_SOURCE_DIR
99

1010
workflows:
1111
test:
@@ -15,19 +15,23 @@ workflows:
1515
- go-tests
1616
after_run:
1717
- test-in-src-dir
18+
- test-in-src-dir-module-variant
1819
- test-in-root-tmp-dir
19-
- check-artifacts
20+
- test-gradle-kts
2021
- check-testaddon-export
2122

2223
test-in-src-dir:
2324
title: Test android project & mono repo projects in source dir
2425
steps:
26+
- change-workdir:
27+
title: cd $ORIG_BITRISE_SOURCE_DIR
28+
inputs:
29+
- path: $ORIG_BITRISE_SOURCE_DIR
2530
- script:
2631
inputs:
27-
- content: rm -rf _tmp
32+
- content: rm -rf $ORIG_BITRISE_SOURCE_DIR/_tmp
2833
- change-workdir:
29-
title: cd $BITRISE_SOURCE_DIR/_tmp
30-
run_if: true
34+
title: cd $ORIG_BITRISE_SOURCE_DIR/_tmp
3135
inputs:
3236
- path: ./_tmp
3337
- is_create_path: true
@@ -38,12 +42,38 @@ workflows:
3842
inputs:
3943
- gradlew_path: ./gradlew
4044
- path::./:
41-
title: Test simple android project
45+
title: Android Unit Test (monorepo projects in source dir)
46+
after-run:
47+
- check-artifacts
48+
49+
test-in-src-dir-module-variant:
50+
title: Test mono repo projects in source dir, module and variant set
51+
steps:
52+
- change-workdir:
53+
title: cd $ORIG_BITRISE_SOURCE_DIR
54+
inputs:
55+
- path: $ORIG_BITRISE_SOURCE_DIR
56+
- script:
57+
inputs:
58+
- content: rm -rf $ORIG_BITRISE_SOURCE_DIR/_tmp
59+
- change-workdir:
60+
title: cd $ORIG_BITRISE_SOURCE_DIR/_tmp
61+
inputs:
62+
- path: ./_tmp
63+
- is_create_path: true
64+
- script:
65+
inputs:
66+
- content: git clone -b no-failures $SAMPLE_REPO_GIT_CLONE_URL .
67+
- install-missing-android-tools:
68+
inputs:
69+
- gradlew_path: ./gradlew
4270
- path::./:
43-
title: Test simple android project with module and variant set
71+
title: Android Unit Test (monorepo in source dir, with module and variant set)
4472
inputs:
4573
- module: app
4674
- variant: Debug
75+
after-run:
76+
- check-artifacts
4777

4878
test-in-root-tmp-dir:
4979
title: Test android project & mono repo projects in /tmp dir
@@ -64,7 +94,36 @@ workflows:
6494
inputs:
6595
- gradlew_path: ./gradlew
6696
- path::./:
67-
title: Test simple repo
97+
title: Android Unit Test (android project & mono repo projects in /tmp dir)
98+
after-run:
99+
- check-artifacts
100+
101+
test-gradle-kts:
102+
title: Test android project with build.gradle.kts
103+
steps:
104+
- change-workdir:
105+
title: cd $ORIG_BITRISE_SOURCE_DIR
106+
inputs:
107+
- path: $ORIG_BITRISE_SOURCE_DIR
108+
- script:
109+
inputs:
110+
- content: rm -rf $ORIG_BITRISE_SOURCE_DIR/_tmp
111+
- change-workdir:
112+
title: cd $ORIG_BITRISE_SOURCE_DIR/_tmp
113+
inputs:
114+
- path: ./_tmp
115+
- is_create_path: true
116+
- script:
117+
inputs:
118+
- content: git clone $SAMPLE_REPO_KOTLIN_GRADLE_URL .
119+
- install-missing-android-tools:
120+
inputs:
121+
- gradlew_path: ./gradlew
122+
- path::./:
123+
title: Android Unit Test (android project with build.gradle.kts)
124+
after-run:
125+
- check-artifacts
126+
68127

69128
check-artifacts:
70129
steps:
@@ -105,6 +164,24 @@ workflows:
105164
106165
check-testaddon-export:
107166
steps:
167+
- change-workdir:
168+
title: cd $ORIG_BITRISE_SOURCE_DIR
169+
inputs:
170+
- path: $ORIG_BITRISE_SOURCE_DIR
171+
- script:
172+
inputs:
173+
- content: rm -rf $ORIG_BITRISE_SOURCE_DIR/_tmp
174+
- change-workdir:
175+
title: cd $ORIG_BITRISE_SOURCE_DIR/_tmp
176+
inputs:
177+
- path: ./_tmp
178+
- is_create_path: true
179+
- script:
180+
inputs:
181+
- content: git clone -b no-failures $SAMPLE_REPO_GIT_CLONE_URL .
182+
- install-missing-android-tools:
183+
inputs:
184+
- gradlew_path: ./gradlew
108185
- script:
109186
title: purge previous build artifacts
110187
inputs:
@@ -134,7 +211,7 @@ workflows:
134211
135212
# check result xml existense
136213
if [ ! $(find ${BITRISE_TEST_DEPLOY_DIR} -regex ".*/app-debug/TEST.*.xml" | grep -c .) -eq 2 ]; then
137-
echo "ERROR: ${BITRISE_TEST_RESULT_DIR}/app-debug does not contain all test result XMLs."
214+
echo "ERROR: ${BITRISE_TEST_DEPLOY_DIR} does not contain all test result XMLs."
138215
exit 1
139216
fi
140217

cache/cache.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import (
88
"path/filepath"
99
"strings"
1010

11+
"github.com/bitrise-io/go-steputils/cache"
1112
"github.com/bitrise-io/go-utils/fileutil"
1213
"github.com/bitrise-io/go-utils/log"
1314
"github.com/bitrise-io/go-utils/pathutil"
14-
"github.com/bitrise-tools/go-steputils/cache"
1515
)
1616

1717
// Level ...

main.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import (
77
"strings"
88
"time"
99

10+
"github.com/bitrise-io/go-android/gradle"
11+
"github.com/bitrise-io/go-steputils/stepconf"
1012
"github.com/bitrise-io/go-utils/log"
1113
"github.com/bitrise-io/go-utils/pathutil"
1214
"github.com/bitrise-io/go-utils/sliceutil"
1315
"github.com/bitrise-steplib/bitrise-step-android-unit-test/cache"
1416
"github.com/bitrise-steplib/bitrise-step-android-unit-test/testaddon"
15-
"github.com/bitrise-tools/go-android/gradle"
16-
"github.com/bitrise-tools/go-steputils/stepconf"
1717
shellquote "github.com/kballard/go-shellquote"
1818
)
1919

@@ -223,7 +223,7 @@ func main() {
223223
log.Warnf("Failed to export test results for test addon: cannot get export directory for artifact (%s): %s", err)
224224
continue
225225
}
226-
226+
227227
if err := testaddon.ExportArtifact(artifact.Path, baseDir, uniqueDir); err != nil {
228228
log.Warnf("Failed to export test results for test addon: %s", err)
229229
}
@@ -232,7 +232,6 @@ func main() {
232232
}
233233
}
234234

235-
236235
if testErr != nil {
237236
os.Exit(1)
238237
}
@@ -243,4 +242,4 @@ func main() {
243242
log.Warnf("%s", warning)
244243
}
245244
log.Donef(" Done")
246-
}
245+
}

vendor/github.com/bitrise-tools/go-steputils/cache/cache.go vendor/github.com/bitrise-io/go-steputils/cache/cache.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/bitrise-io/go-utils/log/internal_logger.go

+76
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)