Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b177ba1
Add issue reference
labkey-susanh Oct 31, 2024
ba326c3
Use "named" instead of "findByName" for configuration avoidance
labkey-susanh Oct 31, 2024
efb1aac
Remove `checkModuleTasks` task and update `stageModules` to not use d…
labkey-susanh Oct 31, 2024
90cf71f
Create `StageModules` task class that is (more?) compatible with conf…
labkey-susanh Oct 31, 2024
b09a619
Relocate onlyIf configuration for writeDependenciesList task
labkey-susanh Oct 31, 2024
e3889be
Make jsp2Java compatible with configuration cache
labkey-susanh Oct 31, 2024
6d94c03
separate task for CopyToExplodedLib
labkey-susanh Oct 31, 2024
49ab1db
Mark populateExplodedLib as incompatible with configuration cache for…
labkey-susanh Oct 31, 2024
8920807
nodeModulesDir -> nodProjectDir for latest release of node plugin
labkey-susanh Oct 31, 2024
dc646c5
Make `ServerSideJS` task compatible with configuration cache
labkey-susanh Nov 1, 2024
f844234
Gradle v8.10.2
labkey-susanh Nov 1, 2024
2b5ce21
All built modules should be in the builtModules config
labkey-susanh Nov 1, 2024
8ac4033
Closer to configuration cache compatibility for `DeployApp`
labkey-susanh Nov 1, 2024
12bdf68
Remove unused method
labkey-susanh Nov 1, 2024
9b3fde6
Add notes on in compatibility
labkey-susanh Nov 1, 2024
f4da38b
Remove `StagingExtension`and update `PickDb` with injected FSOperations
labkey-susanh Nov 1, 2024
756f936
Method renaming and resolve reference to removed extension properties
labkey-susanh Nov 1, 2024
5e86ac6
One more reference to staging extension
labkey-susanh Nov 1, 2024
16eb09a
Utility methods for better readability
labkey-susanh Nov 4, 2024
8c74fb9
Remove comment
labkey-susanh Nov 4, 2024
0ed8e44
Remove commented out code for experimenting with node/npm install
labkey-susanh Nov 4, 2024
2a48f81
Use try with resources
labkey-susanh Nov 4, 2024
a1ade56
void method is not an input
labkey-susanh Nov 4, 2024
2c3b80a
Use BuildUtils for restartTrigger update instead of base class
labkey-susanh Nov 5, 2024
b1ec953
Add TODOs
labkey-susanh Nov 5, 2024
eda0b24
prepare for merge to develop
labkey-susanh Nov 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,25 @@ on how to do that, including how to develop and test locally and the versioning

## Release Notes

### 4.3.0-SNAPSHOT
### 5.1.0-SNAPSHOT
*Released*: TBD
(Earliest compatible LabKey version: 24.11)

### 5.0.0
*Released*: 5 November 2024
(Earliest compatible LabKey version: 24.11)
- Stop adding the standalone `VERSION` file to distribution archives; the `distribution.properties` file now
contains the `version` and `buildUrl` properties that `EmbeddedExtractor.java` reads.
- Remove `checkModuleTasks` tasks, added to get us through a transition from plugins being declared more centrally
- Update `stageModules` to remove use of deprecated `fileCollection` method and make compatible with configuration cache
- Remove `StagingExtension`
- Make `jsp2Java` compatible with configuration cache
- Update property in node plugin configuration for latest version
- Mark `copyExternalLibs` task as not compatible with configuration cache for now
- Update `ServerSideJS` task for configuration cache compatibility
- Update `DeployApp` and relatives for better configuration cache compatibility
- Update `PickDb` task for better configuration cache compatibility
- Upgrade to Gradle 8.10.2

### 4.2.0
*Released*: 11 October 2024
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependencies {
}

group 'org.labkey.build'
project.version = "4.3.0-SNAPSHOT"
project.version = "5.1.0-SNAPSHOT"

gradlePlugin {
plugins {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
45 changes: 27 additions & 18 deletions src/main/groovy/org/labkey/gradle/plugin/FileModule.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import org.gradle.api.GradleException
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.UnknownDomainObjectException
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.file.CopySpec
Expand Down Expand Up @@ -197,7 +199,7 @@ class FileModule implements Plugin<Project>
project.copy { CopySpec copy ->
copy.from moduleTask
copy.from project.configurations.modules
copy.into project.staging.modulesDir
copy.into "${BuildUtils.getRootBuildDirPath(project)}/$ServerDeploy.STAGING_MODULES_DIR"
copy.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
}
project.copy { CopySpec copy ->
Expand Down Expand Up @@ -303,7 +305,8 @@ class FileModule implements Plugin<Project>
// staging has only the .modules files
if (includeStaging)
{
File stagingDir = new File((String) project.staging.modulesDir)

File stagingDir = BuildUtils.getRootBuildDirFile(project, ServerDeploy.STAGING_MODULES_DIR)
if (stagingDir.isDirectory())
{
files.addAll(stagingDir.listFiles(new FilenameFilter() {
Expand Down Expand Up @@ -431,24 +434,30 @@ class FileModule implements Plugin<Project>
// This is done after the project is evaluated otherwise the dependencies for the modules configuration will not have been added yet.
project.afterEvaluate({
BuildUtils.addLabKeyDependency(project: serverProject, config: 'modules', depProjectPath: project.path, depProjectConfig: 'published', depExtension: 'module')
if (project.configurations.findByName("modules") != null)
project.configurations.modules.dependencies.each {
Dependency dep ->
if (dep instanceof ProjectDependency)
{
ProjectDependency projectDep = (ProjectDependency) dep
if (shouldDoBuild(projectDep.dependencyProject, false)) {
BuildUtils.addLabKeyDependency(project: serverProject, config: 'modules', depProjectPath: projectDep.dependencyProject.getPath(), depProjectConfig: 'published', depExtension: 'module')
}
else {
serverProject.dependencies.add("modules", BuildUtils.getLabKeyArtifactName(project, projectDep.dependencyProject.getPath(), projectDep.version, "module"))
}
}
else
{
serverProject.dependencies.add("modules", dep)
BuildUtils.addLabKeyDependency(project: serverProject, config: 'builtModules', depProjectPath: project.path, depProjectConfig: 'published', depExtension: 'module')
try {
project.configurations.named("modules") {
Configuration config -> {
config.dependencies.each {
Dependency dep ->
if (dep instanceof ProjectDependency) {
ProjectDependency projectDep = (ProjectDependency) dep
if (shouldDoBuild(projectDep.dependencyProject, false)) {
BuildUtils.addLabKeyDependency(project: serverProject, config: 'modules', depProjectPath: projectDep.dependencyProject.getPath(), depProjectConfig: 'published', depExtension: 'module')
BuildUtils.addLabKeyDependency(project: serverProject, config: 'builtModules', depProjectPath: projectDep.dependencyProject.getPath(), depProjectConfig: 'published', depExtension: 'module')
} else {
serverProject.dependencies.add("modules", BuildUtils.getLabKeyArtifactName(project, projectDep.dependencyProject.getPath(), projectDep.version, "module"))
serverProject.dependencies.add("downloadedModules", BuildUtils.getLabKeyArtifactName(project, projectDep.dependencyProject.getPath(), projectDep.version, "module"))
}
} else {
serverProject.dependencies.add("modules", dep)
serverProject.dependencies.add("downloadedModules", dep)
}
}
}
}

} catch (UnknownDomainObjectException ignore) { }
})
}

Expand Down
9 changes: 3 additions & 6 deletions src/main/groovy/org/labkey/gradle/plugin/JavaModule.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,9 @@ class JavaModule implements Plugin<Project>
copy.from task
})
}
populateLib.configure {
it.doFirst {
File explodedLibDir = new File(project.labkey.explodedModuleLibDir)
if (explodedLibDir.exists())
explodedLibDir.delete()
}

project.tasks.named('populateExplodedLib') {
notCompatibleWithConfigurationCache("Need to figure out how to make the inputs from the optional tasks work.")
}

project.tasks.named('module').configure {dependsOn(populateLib)}
Expand Down
4 changes: 0 additions & 4 deletions src/main/groovy/org/labkey/gradle/plugin/Jsp.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ class Jsp implements Plugin<Project>
task.dependsOn('jar')
}

project.tasks.named('jsp2Java') {
notCompatibleWithConfigurationCache("ant.jasper doesn't seem completely compatible")
}

project.tasks.named('compileJspJava').configure {
Task task ->
task.dependsOn project.tasks.jsp2Java
Expand Down
4 changes: 0 additions & 4 deletions src/main/groovy/org/labkey/gradle/plugin/LabKey.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package org.labkey.gradle.plugin
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.labkey.gradle.plugin.extension.LabKeyExtension
import org.labkey.gradle.plugin.extension.StagingExtension
import org.labkey.gradle.util.ModuleFinder
import org.labkey.gradle.util.BuildUtils

Expand Down Expand Up @@ -56,9 +55,6 @@ class LabKey implements Plugin<Project>

LabKeyExtension labKeyExt = project.extensions.create("labkey", LabKeyExtension)
labKeyExt.setDirectories(project)

StagingExtension stagingExt = project.extensions.create("staging", StagingExtension)
stagingExt.setDirectories(project)
}

// These configurations are used for deploying the app. We declare them here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ class ModuleResources
Provider<Set<ResolvedArtifactResult>> artifacts = config.getIncoming().getArtifacts().getResolvedArtifacts();
task.getArtifactIds().set(artifacts.map(new WriteDependenciesFile.IdExtractor()))
}
task.externalDependencies.set(project.extensions.findByType(ModuleExtension.class).getExternalDependencies())
def externals = project.extensions.findByType(ModuleExtension.class).getExternalDependencies()
task.externalDependencies.set(externals)
task.onlyIf {
return !externals.isEmpty()
}
} catch (UnknownDomainObjectException ignore) {

}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/groovy/org/labkey/gradle/plugin/NpmRun.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class NpmRun implements Plugin<Project>
download = project.hasProperty('nodeVersion') && project.hasProperty('npmVersion')

// Set the work directory where node_modules should be located
nodeModulesDir = project.file("${project.projectDir}")
nodeProjectDir = project.file("${project.projectDir}")

npmInstallCommand = project.hasProperty('npmInstallCommand') ? project.npmInstallCommand : 'ci'
}
Expand Down
Loading