diff --git a/.gitignore b/.gitignore index 73238e2747..61c44cc559 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,7 @@ distributions/ labkey-api-*/ labkey-ui-components/ remoteapi/ -server/modules/ +server/modules/ server/testAutomation/ tools/ clientAPIs/* @@ -47,7 +47,9 @@ clientAPIs/* .idea/runConfigurations/LabKey_Dev.xml .idea/runConfigurations/LabKey_Production.xml .idea/runConfigurations/LabKeyEmbedded_Dev.xml +.idea/runConfigurations/LabKeyEmbedded_Dev_JaCoCo.xml .idea/runConfigurations/Spring_Boot_LabKey_Embedded_Tomcat_Dev.xml +.idea/runConfigurations/Spring_Boot_LabKey_Embedded_Tomcat_Dev__JaCoCo_.xml .idea/gradle.xml .idea/compiler.xml .idea/misc.xml diff --git a/.idea/runConfigurations/templates/LabKeyEmbedded_Dev_JaCoCo.xml b/.idea/runConfigurations/templates/LabKeyEmbedded_Dev_JaCoCo.xml new file mode 100644 index 0000000000..66a2b76169 --- /dev/null +++ b/.idea/runConfigurations/templates/LabKeyEmbedded_Dev_JaCoCo.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/build.gradle b/build.gradle index 80b347005e..bda2ef8b80 100644 --- a/build.gradle +++ b/build.gradle @@ -519,7 +519,7 @@ subprojects { } }) } - + project.tasks.register("allDepInsight", DependencyInsightReportTask) { DependencyInsightReportTask t -> t.group = "Help" @@ -610,6 +610,23 @@ project.tasks.register("ijRunConfigurationsSetup", Copy) { return line.replace("PATH_SEPARATOR", File.pathSeparator) }) copy.mustRunAfter(project.tasks.ijCodeSetup) + copy.dependsOn("ijJacocoAgent") +} + +project.configurations.register("jacocoAgent") { + description = "JaCoCo agent used by the \"(JaCoCo)\" IntelliJ run configuration" + canBeConsumed = false + transitive = false +} +project.dependencies.add("jacocoAgent", "org.jacoco:org.jacoco.agent:${jacocoVersion}:runtime") + +project.tasks.register("ijJacocoAgent", Copy) { + Copy copy -> + copy.group = GroupNames.INIT + copy.description = "Copy the JaCoCo agent to build/jacoco/jacocoagent.jar for the \"(JaCoCo)\" run configuration; rerun after a root clean" + copy.from(project.configurations.named("jacocoAgent")) + copy.into(project.layout.buildDirectory.dir("jacoco")) + copy.rename({ String name -> "jacocoagent.jar" }) } project.tasks.register("ijCodeSetup", Copy) { diff --git a/gradle.properties b/gradle.properties index f3c6af030d..2d5d5e4060 100644 --- a/gradle.properties +++ b/gradle.properties @@ -215,6 +215,9 @@ jacksonAnnotationsVersion=2.21 # Spring Boot brings in a transitive dependency on Jackson 3.x. It has changed package names and can coexist with Jackson 2.x. jackson3Version=3.1.8 +# Agent for the "(JaCoCo)" IntelliJ run configuration; see the ijJacocoAgent task +jacocoVersion=0.8.15 + # The Jakarta Activation API version that Angus Activation implements. Keep in sync with angusActivationVersion (above). jakartaActivationApiVersion=2.1.4