3
3
* SPDX-License-Identifier: Apache-2.0
4
4
*/
5
5
6
+
7
+ import com.amazon.apl.android.EnumGenerator
6
8
import org.apache.tools.ant.taskdefs.condition.Os
7
9
8
10
apply plugin : ' com.android.library'
9
11
apply plugin : ' jacoco'
10
12
apply plugin : ' maven-publish'
13
+ apply plugin : com.amazon.apl.android.APLPlugin
11
14
12
15
jacoco {
13
16
toolVersion = ' 0.8.8'
@@ -46,14 +49,18 @@ task jacocoTestReport(type: JacocoReport, dependsOn: ['test']) {
46
49
" jacoco/*.exec" ,
47
50
" outputs/code_coverage/debugAndroidTest/connected/*coverage.ec"
48
51
]))
52
+ reports {
53
+ xml. required = true
54
+ html. required = true
55
+ }
49
56
}
50
57
51
58
/**
52
59
* Task to generate coverage report for automationapp after
53
60
* APLComplianceTests have completed.
54
61
*/
55
62
task jacocoAutomationTestReport (type : JacocoReport ) {
56
- def emulator_proc = " adb pull /storage/emulated /0/coverage-data .exec $buildDir /outputs/coverage/coverage-data .exec" . execute()
63
+ def emulator_proc = " adb pull /data/user /0/com.amazon.apl.automation/cache/ coverage.exec $buildDir /outputs/coverage.exec" . execute()
57
64
doFirst {
58
65
emulator_proc. waitForProcessOutput(System . out, System . err)
59
66
}
@@ -73,7 +80,6 @@ task jacocoAutomationTestReport(type: JacocoReport) {
73
80
' **/*Test*.*' ,
74
81
75
82
// Exclude Android and Androidx Support libraries
76
- ' **/android/**' ,
77
83
' **/androidx/**' ,
78
84
' **/com/android/**' ,
79
85
' **com/google/**'
@@ -86,8 +92,12 @@ task jacocoAutomationTestReport(type: JacocoReport) {
86
92
classDirectories. from(files([debugFilter]))
87
93
executionData. from(fileTree(dir : " $buildDir " , includes : [
88
94
" jacoco/*.exec" ,
89
- " outputs/coverage/coverage-data .exec"
95
+ " outputs/coverage.exec"
90
96
]))
97
+ reports {
98
+ xml. required = true
99
+ html. required = true
100
+ }
91
101
}
92
102
93
103
ext {
@@ -128,7 +138,7 @@ android {
128
138
main {
129
139
// Changes the directory for Java sources. The default directory is
130
140
// 'src/main/java'.
131
- java. srcDirs = [' src/main/java' , ' ../coreengine/src/main/java ' ]
141
+ java. srcDirs = [' src/main/java' ]
132
142
}
133
143
}
134
144
publishing {
@@ -244,7 +254,7 @@ dependencies {
244
254
implementation ' androidx.appcompat:appcompat:1.2.0'
245
255
implementation ' com.github.bumptech.glide:glide:4.11.0'
246
256
implementation ' org.java-websocket:Java-WebSocket:1.5.2'
247
- compileOnly project( ' :coreengine' )
257
+ compileOnly ' com.amazon.apl.android :coreengine:latest.integration '
248
258
compileOnly project(' :alexaextjni' )
249
259
implementation project(' :common' )
250
260
implementation(project(' :discovery' )) { transitive = false }
@@ -264,8 +274,8 @@ dependencies {
264
274
androidTestImplementation ' androidx.test:runner:1.4.0'
265
275
androidTestImplementation ' androidx.test:rules:1.4.0'
266
276
androidTestImplementation ' androidx.test.uiautomator:uiautomator:2.2.0'
267
- androidTestImplementation ' com.linkedin.dexmaker:dexmaker:2.25.0 '
268
- androidTestImplementation ' com.linkedin.dexmaker:dexmaker-mockito:2.25.0 '
277
+ androidTestImplementation ' com.linkedin.dexmaker:dexmaker:2.28.3 '
278
+ androidTestImplementation ' com.linkedin.dexmaker:dexmaker-mockito:2.28.3 '
269
279
androidTestImplementation project(" :commonTest" )
270
280
androidTestImplementation ' com.squareup.leakcanary:leakcanary-android-instrumentation:2.9.1'
271
281
androidTestImplementation ' com.squareup.leakcanary:leakcanary-object-watcher-android:2.9.1'
@@ -276,12 +286,6 @@ dependencies {
276
286
annotationProcessor ' org.projectlombok:lombok:1.18.30'
277
287
}
278
288
279
- task buildHostJNI (type : com.amazon.apl.android.CMakeTask ) {
280
- cmakeArgs aplAndroidCmakeArgs
281
- makeTargets ' apl-jni'
282
- dependsOn ' :coreengine:buildHostJNI' ,' :alexaextjni:buildHostJNI'
283
- }
284
-
285
289
tasks. whenTaskAdded { theTask ->
286
290
if (theTask. name. startsWith(" test" )) {
287
291
theTask. outputs. upToDateWhen { false }
@@ -294,14 +298,6 @@ project.afterEvaluate {
294
298
println " Android SDK Directory: " + android. sdkDirectory. path
295
299
println " Android NDK Directory: " + android. ndkDirectory. path
296
300
297
- // We need to make sure the host jni library is built before any debug or release unit testing.
298
- tasks. preDebugUnitTestBuild. dependsOn(buildHostJNI)
299
- tasks. preReleaseUnitTestBuild. dependsOn(buildHostJNI)
300
- tasks. buildHostJNI. dependsOn(' :coreengine:buildHostJNI' )
301
- tasks. buildHostJNI. dependsOn(' :alexaextjni:buildHostJNI' )
302
- tasks. buildHostJNI. dependsOn(' :discovery:buildHostJNI' )
303
- tasks. buildHostJNI. dependsOn(' :common:buildHostJNI' )
304
-
305
301
tasks. test. finalizedBy(jacocoTestReport)
306
302
}
307
303
@@ -346,7 +342,7 @@ task release(dependsOn: ['build', 'publish']) {
346
342
}
347
343
348
344
copy {
349
- from ' build/reports'
345
+ from ' build/reports/jacoco/jacocoTestReport '
350
346
into ' ../build/apl/reports/'
351
347
rename ' jacocoTestReport.xml' , ' coverage.xml'
352
348
}
@@ -378,3 +374,80 @@ tasks.whenTaskAdded {
378
374
task. enabled = false
379
375
}
380
376
}
377
+
378
+ task generateEnums (type : EnumGenerator ) {
379
+ importedEnums " AnimationQuality" ,
380
+ " AudioPlayerEventType" ,
381
+ " AudioTrack" ,
382
+ " BlendMode" ,
383
+ " ComponentType" ,
384
+ " ContainerDirection" ,
385
+ " DimensionType" ,
386
+ " Display" ,
387
+ " DisplayState" ,
388
+ " EventAudioTrack" ,
389
+ " EventControlMediaCommand" ,
390
+ " EventDirection" ,
391
+ " EventHighlightMode" ,
392
+ " EventMediaType" ,
393
+ " EventProperty" ,
394
+ " EventReason" ,
395
+ " EventScrollAlign" ,
396
+ " EventType" ,
397
+ " ExtensionComponentResourceState" ,
398
+ " FilterProperty" ,
399
+ " FilterType" ,
400
+ " FlexboxAlign" ,
401
+ " FlexboxJustifyContent" ,
402
+ " FocusDirection" ,
403
+ " FontStyle" ,
404
+ " GradientProperty" ,
405
+ " GradientSpreadMethod" ,
406
+ " GradientType" ,
407
+ " GradientUnits" ,
408
+ " GraphicElementType" ,
409
+ " GraphicFilterProperty" ,
410
+ " GraphicFilterType" ,
411
+ " GraphicLayoutDirection" ,
412
+ " GraphicLineCap" ,
413
+ " GraphicLineJoin" ,
414
+ " GraphicPropertyKey" ,
415
+ " GraphicScale" ,
416
+ " GraphicScale" ,
417
+ " GraphicTextAnchor" ,
418
+ " ImageAlign" ,
419
+ " ImageCount" ,
420
+ " ImageScale" ,
421
+ " KeyHandlerType" ,
422
+ " KeyboardType" ,
423
+ " LayoutDirection" ,
424
+ " MediaPlayerEventType" ,
425
+ " Navigation" ,
426
+ " NoiseFilterKind" ,
427
+ " PointerEventType" ,
428
+ " PointerType" ,
429
+ " Position" ,
430
+ " PropertyKey" ,
431
+ " Role" ,
432
+ " RootProperty" ,
433
+ " ScreenMode" ,
434
+ " ScreenShape" ,
435
+ " ScrollDirection" ,
436
+ " Snap" ,
437
+ " SpeechMarkType" ,
438
+ " SpanAttributeName" ,
439
+ " SpanType" ,
440
+ " SubmitKeyType" ,
441
+ " TextAlign" ,
442
+ " TextAlignVertical" ,
443
+ " TextTrackType" ,
444
+ " TokenType" ,
445
+ " TrackState" ,
446
+ " UpdateType" ,
447
+ " VectorGraphicAlign" ,
448
+ " VectorGraphicScale" ,
449
+ " VideoScale" ,
450
+ " ViewportMode"
451
+ }
452
+
453
+ tasks. preBuild. dependsOn(generateEnums)
0 commit comments