Skip to content

Commit deb0da1

Browse files
Update to Gradle 9 and make more progress toward configuration cache compatibility (#234)
1 parent ebd0585 commit deb0da1

50 files changed

Lines changed: 1035 additions & 904 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,29 @@ on how to do that, including how to develop and test locally and the versioning
1313

1414
## Release Notes
1515

16-
### TBD
17-
*Released*: TBD
18-
(Earliest compatible LabKeyversion: 25.2)
16+
### 7.0.0
17+
*Released*: 22 September 2025
18+
(Earliest compatible LabKey version: 25.10)
1919
- Update `PurgeArtifacts` task to be compatible with configuration cache and to work with input files so archived projects can be kept up to date
2020
- Update dependency versions
21+
- Update DoThenSetup and its relatives to be compatible with configuration cache
22+
- Update DeployApp for better configuration cache compatibility
23+
- Replace usages of project.javaexc with JavaExc task types or injected ExecOperations
24+
- Update CompressClientLibs, StopLabKey to work better with configuration cache
25+
- Remove `listNodeModules` task defined by `NpmRun` plugin
26+
- Remove `cleanOut` task defined by `FileModule` plugin
27+
- Remove `cleanAndDeploy` task from `ServerDeploy` plugin
28+
- Update `CopyAndInstallRPackage` Task class to use injected FileSystem instead of `project.copy`
29+
- Update `GzipAction` task to use task logger and ant builder objects
30+
- Update `StopLabKey` and `StartLabKey` with appropriate dependencies to mirror the deprecated `StopTomcat` and `StartTomcat`
31+
- Remove deprecated `getServerDeployDirectory` from `ServerDeployExtension`
32+
- Remove `createNlpConfig` task from `TeamCity` plugin since that module is no longer in use
33+
- Remove `setup` task from `ServerDeploy` plugin.
34+
- Update `DeployDistribution` and `StageDistribution` for configuration cache compatibility
35+
- Some updates for `ModuleDistribution` for better configuration cache compatibility
36+
- Update `PropertiesUtils` to remove code for supporting `labkey.xml`
37+
- Relocate the `.restartTriggerFile` to prevent creation of empty `build/deploy/modules` directory for embedded distribution deployment
38+
- Fix `bootstrap` task so it will update `application.properties`
2139

2240
### 6.3.0
2341
*Released*: 3 July 2025

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ repositories {
3030
dependencies {
3131
implementation gradleApi()
3232
implementation localGroovy()
33+
implementation "org.apache.groovy:groovy-sql:${groovySqlVersion}"
3334
api "org.apache.commons:commons-lang3:${commonsLang3Version}"
3435
api "org.apache.commons:commons-text:${commonsTextVersion}"
3536
api "commons-io:commons-io:${commonsIoVersion}"
@@ -42,7 +43,7 @@ dependencies {
4243
}
4344

4445
group = 'org.labkey.build'
45-
project.version = "6.4.0-SNAPSHOT"
46+
project.version = "7.1.0-SNAPSHOT"
4647

4748
gradlePlugin {
4849
plugins {

gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
artifactory_contextUrl=https://labkey.jfrog.io/artifactory
22

3-
artifactoryPluginVersion=5.2.5
3+
artifactoryPluginVersion=6.0.0
44

55
commonsIoVersion=2.20.0
66
commonsLang3Version=3.18.0
@@ -9,6 +9,8 @@ commonsTextVersion=1.14.0
99
grgitGradleVersion=5.3.2
1010
graphqlJavaVersion=24.2
1111

12+
groovySqlVersion=4.0.27
13+
1214
httpclientVersion=5.5
1315
httpcoreVersion=5.3.4
1416

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/main/groovy/org/labkey/gradle/plugin/Antlr.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import org.labkey.gradle.util.GroupNames
2626

2727
/**
2828
* Used to compile antlr grammars into Java classes using the antlr executable.
29+
* TODO: This could be converted to using the Antlr plugin https://docs.gradle.org/9.1.0/userguide/antlr_plugin.html
2930
*/
3031
class Antlr implements Plugin<Project>
3132
{

src/main/groovy/org/labkey/gradle/plugin/ApplyLicenses.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ class ApplyLicenses implements Plugin<Project>
9696
}
9797

9898
project.tasks.register('verifyLicensePatch') {
99-
dependsOn(patchApiTask)
100-
doLast {
99+
it.group = GroupNames.TEST
100+
it.dependsOn(patchApiTask)
101+
it.doLast {
101102
[project.configurations.extJs3Commercial, project.configurations.extJs4Commercial].forEach {
102103
def commercialLicense = project.zipTree(it.singleFile).matching {
103104
include '*/license.txt'
@@ -110,6 +111,7 @@ class ApplyLicenses implements Plugin<Project>
110111
}
111112
}
112113
}
114+
it.notCompatibleWithConfigurationCache("Needs to inject ArtifactOperations for zipTree usage")
113115
}
114116
}
115117
}

src/main/groovy/org/labkey/gradle/plugin/ClientLibraries.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class ClientLibraries
5151
task.dependsOn(project.tasks.processResources)
5252
task.dependsOn(project.project(minProjectPath).tasks.named("npmInstall"))
5353
task.xmlFiles = getLibXmlFiles(project)
54+
task.notCompatibleWithConfigurationCache("Class ClientLibsCompress needs more input and output properties declared")
5455
}
5556

5657
project.evaluationDependsOn(minProjectPath)

src/main/groovy/org/labkey/gradle/plugin/Database.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class Database implements Plugin<Project>
5252
task.group = GroupNames.DATABASE
5353
task.description = "Switch to SQL Server configuration"
5454
task.dbType = "mssql"
55+
task.driverFiles.setFrom(project.configurations.driver)
5556
}
5657
}
5758

@@ -62,6 +63,7 @@ class Database implements Plugin<Project>
6263
task.group = GroupNames.DATABASE
6364
task.description = "Switch to SQL Server configuration using jTDS driver"
6465
task.dbType = "jtds"
66+
task.driverFiles.setFrom(project.configurations.driver)
6567
}
6668
}
6769

@@ -71,6 +73,9 @@ class Database implements Plugin<Project>
7173
Bootstrap task ->
7274
task.group = GroupNames.DATABASE
7375
task.description = "Switch to bootstrap database properties as defined in current db.config file"
76+
task.driverFiles.setFrom(project.configurations.driver)
77+
task.dbPropertiesChanged = true
78+
task.outputs.upToDateWhen({ return false })
7479
}
7580
}
7681
}

src/main/groovy/org/labkey/gradle/plugin/Distribution.groovy

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,11 @@ import org.gradle.api.artifacts.ModuleDependency
2323
import org.gradle.api.artifacts.ProjectDependency
2424
import org.gradle.api.file.DeleteSpec
2525
import org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency
26-
import org.gradle.api.publish.maven.MavenPublication
2726
import org.gradle.api.tasks.Delete
2827
import org.labkey.gradle.plugin.extension.DistributionExtension
29-
import org.labkey.gradle.plugin.extension.LabKeyExtension
3028
import org.labkey.gradle.plugin.extension.TeamCityExtension
31-
import org.labkey.gradle.task.ModuleDistribution
3229
import org.labkey.gradle.util.BuildUtils
3330
import org.labkey.gradle.util.GroupNames
34-
import org.labkey.gradle.util.PomFileHelper
3531
import org.labkey.gradle.util.TaskUtils
3632

3733
class Distribution implements Plugin<Project>
@@ -62,10 +58,6 @@ class Distribution implements Plugin<Project>
6258
addDependencies(project)
6359
addTasks(project)
6460
addTaskDependencies(project)
65-
66-
// commented out until we start publishing distribution artifacts, and then we'll examine the publications more closely
67-
// if (BuildUtils.shouldPublishDistribution(project))
68-
// addArtifacts(project)
6961
}
7062

7163
private void addConfigurations(Project project)
@@ -169,74 +161,6 @@ class Distribution implements Plugin<Project>
169161
project.dependencies.add("distribution", dep)
170162
}
171163
}
172-
173-
private void addArtifacts(Project project)
174-
{
175-
project.apply plugin: 'maven-publish'
176-
177-
// TODO this is really only an approximation of what's needed. We don't currently publish distribution artifacts
178-
// to artifactory
179-
project.afterEvaluate {
180-
String artifactId = getArtifactId(project)
181-
Properties pomProperties = LabKeyExtension.getApiPomProperties(artifactId, project.dist.description, project)
182-
project.publishing {
183-
publications {
184-
distributions(MavenPublication) { pub ->
185-
pub.artifactId(artifactId)
186-
project.tasks.each {
187-
if (it instanceof ModuleDistribution)
188-
{
189-
it.outputs.files.each {File file ->
190-
pub.artifact(file)
191-
{
192-
String fileName = file.getName()
193-
if (fileName.endsWith("gz"))
194-
extension "tar.gz"
195-
if (fileName.contains("-src."))
196-
classifier "src"
197-
}
198-
}
199-
}
200-
}
201-
pom {
202-
name = project.name
203-
description = pomProperties.getProperty("Description")
204-
url = PomFileHelper.LABKEY_ORG_URL
205-
developers PomFileHelper.getLabKeyTeamDevelopers()
206-
// TODO this should probably not always be Apache license
207-
// licenses pomUtil.getLicense()
208-
organization PomFileHelper.getLabKeyOrganization()
209-
// scm PomFileHelper.getLabKeyScm()
210-
// doesn't seem like these pom files will have any dependencies
211-
}
212-
}
213-
}
214-
215-
project.artifactoryPublish {
216-
project.tasks.each {
217-
if (it instanceof ModuleDistribution)
218-
{
219-
dependsOn it
220-
}
221-
}
222-
publications('distributions')
223-
}
224-
}
225-
}
226-
}
227-
228-
static String getArtifactId(Project project)
229-
{
230-
if (project.dist.artifactId != null)
231-
return project.dist.artifactId
232-
else
233-
{
234-
return TaskUtils.getOptionalTask(project, "distribution")
235-
.filter(task -> task.get() instanceof ModuleDistribution)
236-
.map(task -> ((ModuleDistribution)task.get()).getArtifactId())
237-
.orElse(project.name)
238-
}
239-
}
240164
}
241165

242166

0 commit comments

Comments
 (0)