https://kotlinlang.org logo
#gradle
Title
n

nuhkoca

09/25/2022, 1:49 AM
Hello, is
JaCoCo
report location changed in
Gradle 7.5.1
? It used to be created in
jacoco
in
build
folder but after
Gradle
upgrade, I can’t locate it.
v

Vampire

09/25/2022, 12:08 PM
If it used to be created there, then because you configured it and if it is not created there anymore, you changed that. The location was and still is
jacoco
in
reports
in build directory.
n

nuhkoca

09/25/2022, 12:58 PM
my bad, it is the executable file actually it’ used to be created in
$buildDir/jacoco/testDebugUnitTest.exec
before but now it’s located in
$buildDir/outputs/unit_test_code_coverage/debugUnitTest/testDebugUnitTest.exec
I just did upgrade Gradle from
7.4.2
to
7.5.1
v

Vampire

09/25/2022, 1:47 PM
Nope, still the same:
Copy code
task.setDestinationFile(buildDirectory.map(buildDir -> new File(buildDir, "jacoco/" + task.getName() + ".exec")))
I guess you also updated some plugin that reconfigures JaCoCo now and didn't before.
n

nuhkoca

09/25/2022, 7:12 PM
No, I only updated
Gradle
and
AGP
. BTW how do you see below, I’d like to check, as well?
Copy code
task.setDestinationFile(buildDirectory.map(buildDir -> new File(buildDir, "jacoco/" + task.getName() + ".exec")))
v

Vampire

09/25/2022, 9:03 PM
In the Gradle source code.
Why do you say no and then prove otherwise?
AGP is a plugin. Maybe in the new version it reconfigures that.
If your problem is, that you hard-coded the path somewhere and it is now not found anymore, then that's just showing that it is bad practice to hard-code paths and you should instead query or wire it from the respective extension or task property.
42 Views