@@ -4,7 +4,8 @@ apply plugin: "io.freefair.android-javadoc-jar"
44apply plugin : " io.freefair.android-sources-jar"
55
66android {
7- compileSdkVersion rootProject. ext. compileSdkVersion
7+ namespace ' com.parse'
8+ compileSdk rootProject. ext. compileSdkVersion
89
910 defaultConfig {
1011 minSdkVersion rootProject. ext. minSdkVersion
@@ -15,6 +16,18 @@ android {
1516 testOptions {
1617 unitTests {
1718 includeAndroidResources = true
19+
20+ all {
21+ // Configure JaCoCo options
22+ jacoco {
23+ includeNoLocationClasses = true
24+ excludes. add(" jdk.internal.*" )
25+ }
26+ // Configure test logging
27+ testLogging {
28+ events(" failed" )
29+ }
30+ }
1831 }
1932 }
2033
@@ -25,20 +38,24 @@ android {
2538 buildTypes {
2639 debug {
2740 testCoverageEnabled = true
28- buildConfigField(" String" ," PARSE_VERSION" ," \" ${ version} \" " )
41+ buildConfigField(" String" , " PARSE_VERSION" , " \" ${ version} \" " )
2942 }
3043 release {
3144 minifyEnabled false
3245 testCoverageEnabled = false
3346 proguardFiles getDefaultProguardFile(" proguard-android.txt" ), " proguard-rules.pro"
34- buildConfigField(" String" ," PARSE_VERSION" ," \" ${ version} \" " )
47+ buildConfigField(" String" , " PARSE_VERSION" , " \" ${ version} \" " )
3548 }
3649 }
3750
3851 compileOptions {
3952 sourceCompatibility JavaVersion . VERSION_1_8
4053 targetCompatibility JavaVersion . VERSION_1_8
4154 }
55+
56+ buildFeatures {
57+ buildConfig true
58+ }
4259}
4360
4461ext {
@@ -65,38 +82,23 @@ afterEvaluate {
6582 publishing {
6683 publications {
6784 release(MavenPublication ) {
68- from components. release
85+ from components. findByName( ' release' )
6986 }
7087 }
7188 }
7289}
7390
7491// endregion
7592
76- // region Code Coverage
77-
78- apply plugin : " com.dicedmelon.gradle.jacoco-android"
79-
80- jacoco {
81- toolVersion = rootProject. ext. jacocoVersion
82- }
83-
84- tasks. withType(Test ) {
85- jacoco. includeNoLocationClasses = true
86- jacoco. excludes = [' jdk.internal.*' ]
87- testLogging {
88- events " failed"
93+ tasks. withType(JacocoReport ). configureEach {
94+ jacoco. toolVersion = rootProject. ext. jacocoVersion
95+ reports {
96+ csv. required. set(false )
97+ html. required. set(true )
98+ xml. required. set(true )
8999 }
90100}
91101
92- tasks. withType(Test ) {
102+ tasks. withType(Test ). configureEach {
93103 useJUnitPlatform()
94104}
95-
96- jacocoAndroidUnitTestReport {
97- csv. enabled false
98- html. enabled true
99- xml. enabled true
100- }
101-
102- // endregion
0 commit comments