From beb0db6e72621e2d28d8ddec11670bdaa395f27c Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Thu, 8 Apr 2021 09:23:31 +1000 Subject: [PATCH] Fix gradle Jacoco issues Fixes #16323 --- .../java/io/quarkus/jacoco/deployment/JacocoProcessor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test-framework/jacoco/deployment/src/main/java/io/quarkus/jacoco/deployment/JacocoProcessor.java b/test-framework/jacoco/deployment/src/main/java/io/quarkus/jacoco/deployment/JacocoProcessor.java index e859e1a44566f..c6f4632447d43 100644 --- a/test-framework/jacoco/deployment/src/main/java/io/quarkus/jacoco/deployment/JacocoProcessor.java +++ b/test-framework/jacoco/deployment/src/main/java/io/quarkus/jacoco/deployment/JacocoProcessor.java @@ -109,8 +109,11 @@ public byte[] apply(String className, byte[] bytes) { } } } else if (BuildToolHelper.isGradleProject(targetdir.toPath())) { - QuarkusModel model = BuildToolHelper.enableGradleAppModelForTest(targetdir.toPath()); + //this seems counter productive, but we want the dev mode model and not the test model + //as the test model will include the test classes that we don't want in the report + QuarkusModel model = BuildToolHelper.enableGradleAppModelForDevMode(targetdir.toPath()); for (WorkspaceModule i : model.getWorkspace().getAllModules()) { + info.savedData.add(new File(i.getBuildDir(), config.dataFile).getAbsolutePath()); for (File src : i.getSourceSourceSet().getSourceDirectories()) { sources.add(src.getAbsolutePath()); }