Adds empty tests as workaround for AGP bug

Change-Id: I2fce55bfaf204e85ff326a5ce5cb31599b916dbb
ja/coverage_agp
Jose Alcérreca 9 months ago
parent 9ac5e28d13
commit adae7850bb

@ -25,10 +25,10 @@ class AndroidApplicationJacocoConventionPlugin : Plugin<Project> {
val androidExtension = extensions.getByType<BaseAppModuleExtension>()
androidExtension.buildTypes.configureEach {
// The jacoco plugin is applied automatically when any of these are set
enableAndroidTestCoverage = true
enableUnitTestCoverage = true
}
}
}
}

@ -15,7 +15,6 @@
*/
import com.android.build.api.dsl.LibraryExtension
import com.android.build.api.variant.LibraryAndroidComponentsExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.getByType
@ -23,17 +22,14 @@ import org.gradle.kotlin.dsl.getByType
class AndroidLibraryJacocoConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
val androidExtension: LibraryExtension = extensions.getByType<LibraryExtension>()
val androidExtension = extensions.getByType<LibraryExtension>()
androidExtension.buildTypes.configureEach {
// The jacoco plugin is applied automatically when any of these are set
enableAndroidTestCoverage = true
enableUnitTestCoverage = true
}
val extension = extensions.getByType<LibraryAndroidComponentsExtension>()
}
}
}

@ -0,0 +1,25 @@
/*
* Copyright 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.junit.Test
/**
* Workaround for https://issuetracker.google.com/329869184
*/
class EmptyTest {
@Test
fun test1() { }
}

@ -0,0 +1,25 @@
/*
* Copyright 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.junit.Test
/**
* Workaround for https://issuetracker.google.com/329869184
*/
class EmptyTest {
@Test
fun test1() { }
}

@ -0,0 +1,25 @@
/*
* Copyright 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.junit.Test
/**
* Workaround for https://issuetracker.google.com/329869184
*/
class EmptyTest {
@Test
fun test1() { }
}
Loading…
Cancel
Save