• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1plugins {
2    id 'com.android.application' version '7.2.1' apply false
3    id 'com.android.library' version '7.2.1' apply false
4}
5
6task clean(type: Delete) {
7    delete layout.buildDirectory
8    if (findProject('native-poc') != null) {
9        delete project('native-poc').layout.projectDirectory.dir('.cxx')
10    }
11}
12
13ext.copyArtifacts = { nativeDir ->
14    copy {
15        from project('sts-test').layout.buildDirectory.file('testcases')
16
17        if (findProject('native-poc') != null) {
18            from project('native-poc').layout.buildDirectory.file(nativeDir)
19        }
20
21        into layout.buildDirectory.dir('android-sts/testcases')
22    }
23
24    // TODO: figure out variants
25    if (findProject('test-app') != null) {
26        copy {
27            from project('test-app').layout.buildDirectory.file('outputs/apk/debug')
28            rename '(.*).apk', 'sts_test_app_package.apk'
29            include '**/*.apk'
30            into layout.buildDirectory.dir('android-sts/testcases')
31        }
32    }
33
34    // To add another Android apk to the test, copy the block above and rename
35    // the project name to your submodule as well as the APK output filename.
36    // Remember to use that APK file name in your `sts-test`.
37
38    copy {
39        from project('sts-test').layout.projectDirectory.file('libs')
40        into layout.buildDirectory.dir('android-sts/tools')
41    }
42    copy {
43        from project('sts-test').layout.projectDirectory.dir('jdk')
44        into layout.buildDirectory.dir('android-sts/jdk')
45    }
46}
47
48task assembleStsARM {
49    dependsOn ':sts-test:copyHostSideTest'
50
51    if (findProject('native-poc') != null) {
52        dependsOn ':native-poc:copyarmeabi-v7a'
53        dependsOn ':native-poc:copyarm64-v8a'
54    }
55
56    if (findProject('test-app') != null) {
57        dependsOn ':test-app:assemble'
58    }
59
60    // To add another Android apk to the test, copy the block above and rename
61    // the project name to your new submodule
62
63    doLast {
64        copyArtifacts('testcases_arm')
65    }
66}
67
68task assembleStsx86 {
69    dependsOn ':sts-test:copyHostSideTest'
70
71    if (findProject('native-poc') != null) {
72        dependsOn ':native-poc:copyx86'
73        dependsOn ':native-poc:copyx86_64'
74    }
75
76    if (findProject('test-app') != null) {
77        dependsOn ':test-app:assemble'
78    }
79
80    // To add another Android apk to the test, copy the block above and rename
81    // the project name to your new submodule
82
83    doLast {
84        copyArtifacts('testcases_x86')
85    }
86}
87
88task zipForSubmission(type: Zip) {
89    from('.') {
90        exclude "**/build"
91        exclude '.gradle'
92        exclude 'test-app/libs'
93        exclude 'sts-test/libs'
94        exclude 'sts-test/jdk'
95        exclude 'sts-test/utils'
96        exclude "**/.cxx"
97    }
98    from project('sts-test').layout.projectDirectory.file('libs/version.txt')
99    archiveFileName.set("codesubmission.zip")
100    destinationDirectory.set(layout.buildDirectory)
101}
102