diff --git a/README.md b/README.md index 829342fd..fe6f5a7d 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,15 @@ on how to do that, including how to develop and test locally and the versioning ## Release Notes -### 6.2.0-SNAPSHOT +### 6.3.0-SNAPSHOT *Released*: TBD (Earliest compatible LabKey version: 25.2) +### 6.2.0 +*Released*: 23 April, 2025 +(Earliest compatible LabKey version: 25.2) +- Allow `PickDb` task to set server context path via `labkey.contextpath` property + ### 6.1.0 *Released*: 10 January, 2025 (Earliest compatible LabKey version: 25.2) diff --git a/build.gradle b/build.gradle index b0ca5afb..d61bc1b0 100644 --- a/build.gradle +++ b/build.gradle @@ -42,7 +42,7 @@ dependencies { } group = 'org.labkey.build' -project.version = "6.2.0-SNAPSHOT" +project.version = "6.3.0-SNAPSHOT" gradlePlugin { plugins { diff --git a/src/main/groovy/org/labkey/gradle/plugin/extension/TeamCityExtension.groovy b/src/main/groovy/org/labkey/gradle/plugin/extension/TeamCityExtension.groovy index 0f27bf3c..6e551975 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/extension/TeamCityExtension.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/extension/TeamCityExtension.groovy @@ -178,6 +178,11 @@ class TeamCityExtension return getTeamCityProperty(project, "labkey.server", "http://localhost") } + static String getLabKeyContextPath(Project project) + { + return getTeamCityProperty(project, "labkey.contextpath", null) + } + static String getLabKeyServerPort(Project project) { return getTeamCityProperty(project, 'tomcat.port', null) diff --git a/src/main/groovy/org/labkey/gradle/task/DoThenSetup.groovy b/src/main/groovy/org/labkey/gradle/task/DoThenSetup.groovy index 6d18fc7c..51799759 100644 --- a/src/main/groovy/org/labkey/gradle/task/DoThenSetup.groovy +++ b/src/main/groovy/org/labkey/gradle/task/DoThenSetup.groovy @@ -60,6 +60,11 @@ class DoThenSetup extends DefaultTask "serverPort", project.hasProperty("useSsl") ? "8443" : "8080")) + configProperties.setProperty("contextPath", tcPropOrDefault(project, + TeamCityExtension::getLabKeyContextPath, + "contextPath", + "")) + configProperties.setProperty("shutdownPort", tcPropOrDefault(project, TeamCityExtension::getLabKeyServerShutdownPort, "shutdownPort", @@ -102,6 +107,10 @@ class DoThenSetup extends DefaultTask { line = line.replace("#context.", "context.") } + if (configProperties.containsKey("contextPath") && line.contains("=@@contextPath")) + { + line = line.replace("#context.", "context.") + } if (line.startsWith("#")) { return line // Don't apply replacements to comments }