summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortobrun <tobrun.van.nuland@gmail.com>2018-09-04 15:26:13 +0200
committerTobrun <tobrun@mapbox.com>2018-09-05 12:36:49 +0200
commite5bc05e650a718c948c9fdb7a53c6a233188c95b (patch)
tree8ccd9fb21dcb7a5592544b961b741fea0388836a
parente082af18795ac04642053bf8cf8a44031f4d7245 (diff)
downloadqtlocation-mapboxgl-e5bc05e650a718c948c9fdb7a53c6a233188c95b.tar.gz
[android] - allow kotlin sanity activity test generation
-rw-r--r--platform/android/scripts/generate-test-code.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/platform/android/scripts/generate-test-code.js b/platform/android/scripts/generate-test-code.js
index e27de7e40b..64b38e5ace 100644
--- a/platform/android/scripts/generate-test-code.js
+++ b/platform/android/scripts/generate-test-code.js
@@ -36,8 +36,14 @@ for(const subPackage of subPackages) {
}
for (const activity of activities) {
- // strip .java from input file
- const activityName = activity.slice(0, -5);
+ var activityName;
+ if (activity.slice(-5) === '.java') {
+ // .java file
+ activityName = activity.slice(0, -5);
+ } else {
+ // .kt file
+ activityName = activity.slice(0, -3);
+ }
// create path for test file
const filePath = testBasePath+"/"+subPackage+"/"+activityName+'Test.java';