-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jacoco Problem with Gradle Transform Task #105
Comments
transform plugin code:
} |
jacoco code: apply plugin: 'jacoco' android { task jacocoVideoCoverageReport(type: JacocoReport) {
} |
Hi, I use jacoco and ScopedArtifacts.Scope.ALL to do some transform work in my project.
The gradle tool version is 8.0
My project structure is as follows:
app
module a
module b
app includes module a and module b
in app I use ScopedArtifacts.Scope.ALL to write a gradle plugin
there is the code :
and I use jacoco in module A and module B too
there is the jacoco code:
now there comes the problem the jacoco task is execute before transform task
After the jacoco task is finished, the transform task will get the input dir and input jar( module A class.jar module B class.jar)
but when I print the path of input jar , I found that the input jar is still the original jar file without jacoco Instrumentation code.
example:
after jacoco task
the input jar
@get:InputFiles abstract val allJars: ListProperty<RegularFile>
class path in the plugin is
Module A/build/intermediates/runtime_library_class_jar/class.jar(without jacoco Instrumentation code)
Module B /build/intermediates/runtime_library_class_jar/class.jar(without jacoco Instrumentation code)
That means jacoco didn't work in my project due to the using of transform task by code mentioned above, because the transform task still use the original class jar ( module A class.jar without jacoco Instrumentation code and module B class.jar without jacoco Instrumentation code) to general the final class.jar that will finally saved in app/build/intermediates/classes/all/class.jar.
So how can I do to get the right class.jar of module A and module B that include jacoco Instrumentation code
and in gradle 7.0
I found that
Module A/build/intermediates/runtime_library_class_jar/class.jar
Module B /build/intermediates/runtime_library_class_jar/class.jar
include the jacoco Instrumentation code
but in gradle 8.0 it's not
The text was updated successfully, but these errors were encountered: