diff --git a/README.md b/README.md index 67854d63..d2a6c15a 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,23 @@ on how to do that, including how to develop and test locally and the versioning ## Release Notes -### 5.1.0-SNAPSHOT +### 6.1.0-SNAPSHOT *Released*: TBD (Earliest compatible LabKey version: 24.11) +- + +### 6.0.0 +*Released*: 27 December 2024 +(Earliest compatible LabKey version: 24.11) +- Remove usage of deprecated `dependencyProject` +- Remove configuration of Yarn tasks and properties +- Fix directory for `deployModule` task +- Add optional properties `useServerNode` and `useOwnNode` for configuring `NpmRun` (incubating) + - If neither property is defined, each module using `npm` downloads its own copy of `node` and `npm` in the default `.gradle` directory for the module + - If `useServerNode` is defined, the download directory is specified as `/.node` + - When `useServerNode` is defined, a module that defines `useOwnNode` will revert to the default behavior + - This is an incubating feature that requires more testing and troubleshooting to determine if it is always a viable option +- Remove `RestartTriggerTask` (for now). Its output declarations cause issues with the `DeployDistribution` task (at least) ### 5.0.0 *Released*: 5 November 2024 diff --git a/build.gradle b/build.gradle index 9f87c84e..d0cd1f4b 100644 --- a/build.gradle +++ b/build.gradle @@ -41,8 +41,8 @@ dependencies { api "org.ajoberstar.grgit:grgit-gradle:${grgitGradleVersion}" } -group 'org.labkey.build' -project.version = "5.1.0-SNAPSHOT" +group = 'org.labkey.build' +project.version = "6.1.0-SNAPSHOT" gradlePlugin { plugins { @@ -169,7 +169,7 @@ if (hasProperty('artifactory_user') && hasProperty('artifactory_password')) repositories { if (project.version.contains("SNAPSHOT")) { maven { - url "${artifactory_contextUrl}/plugins-snapshot-local" + url = "${artifactory_contextUrl}/plugins-snapshot-local" credentials { username = artifactory_user password = artifactory_password @@ -182,7 +182,7 @@ if (hasProperty('artifactory_user') && hasProperty('artifactory_password')) } else { maven { - url "${artifactory_contextUrl}/plugins-release" + url = "${artifactory_contextUrl}/plugins-release" credentials { username = artifactory_user password = artifactory_password diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index df97d72b..cea7a793 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/groovy/org/labkey/gradle/plugin/Distribution.groovy b/src/main/groovy/org/labkey/gradle/plugin/Distribution.groovy index ad8d3475..a7fe0d96 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/Distribution.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/Distribution.groovy @@ -138,7 +138,7 @@ class Distribution implements Plugin if (it instanceof DefaultProjectDependency) { DefaultProjectDependency dep = (DefaultProjectDependency) it - TaskUtils.addOptionalTaskDependency(dep.dependencyProject, distTask, "module") + TaskUtils.addOptionalTaskDependency(project.project(dep.getPath()), distTask, "module") } } } diff --git a/src/main/groovy/org/labkey/gradle/plugin/FileModule.groovy b/src/main/groovy/org/labkey/gradle/plugin/FileModule.groovy index 8fc32eaf..17d6e70e 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/FileModule.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/FileModule.groovy @@ -442,12 +442,12 @@ class FileModule implements Plugin 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') + if (shouldDoBuild(project.project(projectDep.getPath()), false)) { + BuildUtils.addLabKeyDependency(project: serverProject, config: 'modules', depProjectPath: projectDep.getPath(), depProjectConfig: 'published', depExtension: 'module') + BuildUtils.addLabKeyDependency(project: serverProject, config: 'builtModules', depProjectPath: projectDep.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")) + serverProject.dependencies.add("modules", BuildUtils.getLabKeyArtifactName(project, projectDep.getPath(), projectDep.version, "module")) + serverProject.dependencies.add("downloadedModules", BuildUtils.getLabKeyArtifactName(project, projectDep.getPath(), projectDep.version, "module")) } } else { serverProject.dependencies.add("modules", dep) diff --git a/src/main/groovy/org/labkey/gradle/plugin/NpmRun.groovy b/src/main/groovy/org/labkey/gradle/plugin/NpmRun.groovy index 2f813558..f5b23932 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/NpmRun.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/NpmRun.groovy @@ -78,17 +78,22 @@ class NpmRun implements Plugin // Version of npm to use. npmVersion = project.npmVersion - if (project.hasProperty('yarnVersion')) - // Version of Yarn to use. - yarnVersion = project.yarnVersion - // Base URL for fetching node distributions (change if you have a mirror). if (project.hasProperty('nodeRepo')) distBaseUrl = project.nodeRepo + if (BuildUtils.useServerNode(project)) { + // The directory where Node.js is unpacked (when download is true) + workDir = project.file("${project.rootProject.projectDir}/.node") + + // The directory where npm is installed (when a specific version is defined) + npmWorkDir = project.file("${project.rootProject.projectDir}/.node") + } + // If true, it will download node using above parameters. // If false, it will try to use globally installed node. - download = project.hasProperty('nodeVersion') && project.hasProperty('npmVersion') + download = (BuildUtils.useOwnNode(project) || project.path.equals(BuildUtils.getServerProjectPath(project.gradle))) + && project.hasProperty('nodeVersion') && project.hasProperty('npmVersion') // Set the work directory where node_modules should be located nodeProjectDir = project.file("${project.projectDir}") @@ -97,52 +102,6 @@ class NpmRun implements Plugin } } - private static void addYarnTasks(Project project) - { - project.tasks.register("yarnRunClean") - {Task task -> - task.group = GroupNames.YARN - task.description = "Runs 'yarn run ${project.npmRun.clean}'" - task.dependsOn "yarn_run_${project.npmRun.clean}" - } - TaskUtils.configureTaskIfPresent(project, 'clean', { dependsOn(project.tasks.yarnRunClean) }) - - def yarnRunBuildProd = project.tasks.register("yarnRunBuildProd") - {Task task -> - task.group = GroupNames.YARN - task.description = "Runs 'yarn run ${project.npmRun.buildProd}'" - task.dependsOn "yarn_install" - task.dependsOn "yarn_run_${project.npmRun.buildProd}" - task.mustRunAfter "yarn_install" - } - configureBuildTask(project.tasks.named('yarnRunBuildProd')) - configureBuildTask(project.tasks.named("yarn_run_${project.npmRun.buildProd}")) - - def yarnRunBuild = project.tasks.register("yarnRunBuild") - {Task task -> - task.group = GroupNames.YARN - task.description ="Runs 'yarn run ${project.npmRun.buildDev}'" - task.dependsOn "yarn_install" - task.dependsOn "yarn_run_${project.npmRun.buildDev}" - task.mustRunAfter "yarn_install" - } - configureBuildTask(project.tasks.named('yarnRunBuild')) - configureBuildTask(project.tasks.named("yarn_run_${project.npmRun.buildDev}")) - - def runCommand = LabKeyExtension.isDevMode(project) ? yarnRunBuild : yarnRunBuildProd - TaskUtils.configureTaskIfPresent(project, "module", { dependsOn(runCommand) }) - TaskUtils.configureTaskIfPresent(project, "processResources", { dependsOn(runCommand) }) - TaskUtils.configureTaskIfPresent(project, "processModuleResources", { dependsOn(runCommand) }) - TaskUtils.configureTaskIfPresent(project, "processWebappResources", { dependsOn(runCommand) }) - - project.tasks.named("yarn_install").configure {Task task -> - task.inputs.file project.file(NPM_PROJECT_FILE) - if (project.file(NPM_PROJECT_LOCK_FILE).exists()) - task.inputs.file project.file(NPM_PROJECT_LOCK_FILE) - } - project.tasks.named("yarn_install").configure {outputs.upToDateWhen { project.file(NODE_MODULES_DIR).exists() } } - } - private static void addNpmTasks(Project project) { project.tasks.register("npmRunClean") @@ -170,10 +129,22 @@ class NpmRun implements Plugin task.description ="Runs 'npm run ${project.npmRun.buildDev}'" task.dependsOn "npm_run_${project.npmRun.buildDev}" task.mustRunAfter "npmInstall" + task.doFirst({ + task.logger.info("npmWorkDir ${project.node.npmWorkDir.get()}") + task.logger.info("workDir ${project.node.workDir.get()}") + task.logger.info("resolvedNodeDir ${project.node.resolvedNodeDir.get()}") + }) } configureBuildTask(project.tasks.named('npmRunBuild')) configureBuildTask(project.tasks.named("npm_run_${project.npmRun.buildDev}")) + if (BuildUtils.useServerNode(project) && project.path !== BuildUtils.getServerProject(project).path) { + project.tasks.named('npmSetup').configure + { + Task task -> + task.dependsOn(BuildUtils.getServerProject(project).tasks.npmSetup) + } + } project.tasks.named('npmInstall').configure {Task task -> @@ -183,6 +154,9 @@ class NpmRun implements Plugin // Specify legacy peer dependency mode for npm v7+ task.args = ["--legacy-peer-deps"] task.outputs.upToDateWhen { project.file(NODE_MODULES_DIR).exists() } + if (BuildUtils.useServerNode(project)) { + task.dependsOn(BuildUtils.getServerProject(project).tasks.npmSetup) + } } def runCommand = LabKeyExtension.isDevMode(project) && !project.hasProperty('useNpmProd') ? npmRunBuild : npmRunBuildProd @@ -192,19 +166,11 @@ class NpmRun implements Plugin TaskUtils.configureTaskIfPresent(project, "processWebappResources", { dependsOn(runCommand) }) } - static boolean useYarn(Project project) - { - return project.hasProperty("yarnVersion") && !project.file(NPM_PROJECT_LOCK_FILE).exists() - } - private static void addTasks(Project project) { if (project.file(NPM_PROJECT_FILE).exists()) { - if (useYarn(project)) - addYarnTasks(project) - else - addNpmTasks(project) + addNpmTasks(project) project.tasks.register("cleanNodeModules", Delete) { Delete task -> @@ -214,10 +180,7 @@ class NpmRun implements Plugin if (project.file(NODE_MODULES_DIR).exists()) delete.delete(project.file(NODE_MODULES_DIR)) }) - if (useYarn(project)) - task.mustRunAfter(project.tasks.yarnRunClean) - else - task.mustRunAfter(project.tasks.npmRunClean) + task.mustRunAfter(project.tasks.npmRunClean) } } @@ -229,7 +192,7 @@ class NpmRun implements Plugin List nodeProjects = [] project.allprojects({Project p -> if (p.getPlugins().hasPlugin(NpmRun.class)) - nodeProjects.add("${p.path} (${useYarn(p) ? 'yarn' : 'npm'})") + nodeProjects.add(p.path) }) if (nodeProjects.size() == 0) println("No projects found containing ${NPM_PROJECT_FILE}") diff --git a/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy b/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy index 958b11ed..a99a121b 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy @@ -42,10 +42,11 @@ import java.nio.file.Paths class ServerDeploy implements Plugin { public static final String DEPLOY_DIR = "deploy" - public static final String MODULES_DIR = "${DEPLOY_DIR}/modules" - public static final String WEBAPP_DIR = "${DEPLOY_DIR}/labkeyWebapp" - public static final String PIPELINE_DIR = "${DEPLOY_DIR}/pipelineLib" - public static final String BIN_DIR = "${DEPLOY_DIR}/bin" + public static final String MODULES_DIR = "modules" + public static final String DEPLOY_MODULES_DIR = "${DEPLOY_DIR}/${MODULES_DIR}" + public static final String DEPLOY_WEBAPP_DIR = "${DEPLOY_DIR}/labkeyWebapp" + public static final String DEPLOY_PIPELINE_DIR = "${DEPLOY_DIR}/pipelineLib" + public static final String DEPLOY_BIN_DIR = "${DEPLOY_DIR}/bin" public static final String STAGING_DIR = "staging" public static final String STAGING_MODULES_DIR = "${STAGING_DIR}/modules/" public static final String STAGING_PIPELINE_DIR = "${STAGING_DIR}/pipelineLib" @@ -143,12 +144,10 @@ class ServerDeploy implements Plugin task.group = GroupNames.DEPLOY task.description = "Make a symbolic link to the npm directory for use in PATH environment variable" task.doFirst({ - // we'll need to support both yarn and npm, so link them both if both are present. if (project.hasProperty('npmVersion') && project.hasProperty('npmWorkDirectory')) linkBinaries(project, "npm", project.npmVersion, project.npmWorkDirectory) - if (project.hasProperty('yarnVersion') && project.hasProperty('yarnWorkDirectory')) - linkBinaries(project, "yarn", project.yarnVersion, project.yarnWorkDirectory) }) + task.dependsOn(project.tasks.npmSetup) } project.tasks.symlinkNode.notCompatibleWithConfigurationCache("References project properties. Need to add task class with input properties") project.tasks.named('deployApp').configure {dependsOn(project.tasks.symlinkNode)} @@ -319,7 +318,7 @@ class ServerDeploy implements Plugin Path pmLinkPath = Paths.get("${linkContainer.getPath()}/${packageMgr}") String pmDirName = "${packageMgr}-v${version}" - Path pmTargetPath = Paths.get(BuildUtils.getBuildDirFile(pmLinkProject, "${workDirectory}/${pmDirName}").getPath()) + Path pmTargetPath = Paths.get(pmLinkProject.file( "${workDirectory}/${pmDirName}").getPath()) if (!Files.isSymbolicLink(pmLinkPath) || !Files.readSymbolicLink(pmLinkPath).getFileName().toString().equals(pmDirName)) { @@ -334,7 +333,7 @@ class ServerDeploy implements Plugin Path nodeLinkPath = Paths.get("${linkContainer.getPath()}/node") if (!Files.isSymbolicLink(nodeLinkPath) || !Files.readSymbolicLink(nodeLinkPath).getFileName().toString().startsWith(nodeFilePrefix)) { - File nodeDir = BuildUtils.getBuildDirFile(pmLinkProject, project.nodeWorkDirectory) + File nodeDir = pmLinkProject.file(project.nodeWorkDirectory) File[] nodeFiles = nodeDir.listFiles({ File file -> file.name.startsWith(nodeFilePrefix) } as FileFilter) if (nodeFiles != null && nodeFiles.length > 0) { diff --git a/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy b/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy index 240c0c28..cc554af7 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy @@ -179,8 +179,8 @@ class TeamCity extends Tomcat if (!extension.isValidForTestRun()) throw new GradleException("TeamCity configuration problem(s): ${extension.validationMessages.join('; ')}") - project.logger.info("teamcity.build.branch.is_default: ${extension.getTeamCityProperty('teamcity.build.branch.is_default')}") - project.logger.info("teamcity.build.branch: ${extension.getTeamCityProperty('teamcity.build.branch')}") + task.logger.info("teamcity.build.branch.is_default: ${extension.getTeamCityProperty('teamcity.build.branch.is_default')}") + task.logger.info("teamcity.build.branch: ${extension.getTeamCityProperty('teamcity.build.branch')}") } } diff --git a/src/main/groovy/org/labkey/gradle/plugin/extension/ServerDeployExtension.groovy b/src/main/groovy/org/labkey/gradle/plugin/extension/ServerDeployExtension.groovy index 1a24fe54..5f91aa2a 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/extension/ServerDeployExtension.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/extension/ServerDeployExtension.groovy @@ -24,6 +24,12 @@ class ServerDeployExtension { Map foundModules = new HashMap<>(); + @Deprecated(forRemoval=true) + static String getServerDeployDirectory(Project project) + { + return getServerDeployDirectoryPath(project) + } + static String getServerDeployDirectoryPath(Project project) { return BuildUtils.getRootBuildDirFile(project, ServerDeploy.DEPLOY_DIR).path diff --git a/src/main/groovy/org/labkey/gradle/task/DeployApp.groovy b/src/main/groovy/org/labkey/gradle/task/DeployApp.groovy index 0c248636..2506c12c 100644 --- a/src/main/groovy/org/labkey/gradle/task/DeployApp.groovy +++ b/src/main/groovy/org/labkey/gradle/task/DeployApp.groovy @@ -33,17 +33,17 @@ abstract class DeployApp extends DeployAppBase final abstract DirectoryProperty stagingPipelineJarDir = BuildUtils.getRootBuildDirectoryProperty(project, ServerDeploy.STAGING_PIPELINE_DIR) @OutputDirectory - final abstract DirectoryProperty deployModulesDir = BuildUtils.getRootBuildDirectoryProperty(project, ServerDeploy.MODULES_DIR) + final abstract DirectoryProperty deployModulesDir = BuildUtils.getRootBuildDirectoryProperty(project, ServerDeploy.DEPLOY_MODULES_DIR) // We declare this as an output so it will be created by this task, even though not actually populated here @OutputDirectory - final abstract DirectoryProperty deployWebappDir = BuildUtils.getRootBuildDirectoryProperty(project, ServerDeploy.WEBAPP_DIR) + final abstract DirectoryProperty deployWebappDir = BuildUtils.getRootBuildDirectoryProperty(project, ServerDeploy.DEPLOY_WEBAPP_DIR) @OutputDirectory - final abstract DirectoryProperty deployPipelineLibDir = BuildUtils.getRootBuildDirectoryProperty(project, ServerDeploy.PIPELINE_DIR) + final abstract DirectoryProperty deployPipelineLibDir = BuildUtils.getRootBuildDirectoryProperty(project, ServerDeploy.DEPLOY_PIPELINE_DIR) @OutputDirectory - final abstract DirectoryProperty deployBinDir = BuildUtils.getRootBuildDirectoryProperty(project, ServerDeploy.BIN_DIR) + final abstract DirectoryProperty deployBinDir = BuildUtils.getRootBuildDirectoryProperty(project, ServerDeploy.DEPLOY_BIN_DIR) @TaskAction void action() @@ -51,7 +51,7 @@ abstract class DeployApp extends DeployAppBase deployModules() deployPipelineJars() deployPlatformBinaries(deployBinDir.get().asFile) - updateRestartTriggerFile() + BuildUtils.updateRestartTriggerFile(project) } private void deployModules() diff --git a/src/main/groovy/org/labkey/gradle/task/DeployAppBase.groovy b/src/main/groovy/org/labkey/gradle/task/DeployAppBase.groovy index f1efbc63..a22082c9 100644 --- a/src/main/groovy/org/labkey/gradle/task/DeployAppBase.groovy +++ b/src/main/groovy/org/labkey/gradle/task/DeployAppBase.groovy @@ -1,6 +1,7 @@ package org.labkey.gradle.task import org.apache.commons.lang3.SystemUtils +import org.gradle.api.DefaultTask import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.CopySpec import org.gradle.api.file.DirectoryProperty @@ -12,7 +13,7 @@ import org.labkey.gradle.util.BuildUtils import javax.inject.Inject -abstract class DeployAppBase extends RestartTriggerTask { +abstract class DeployAppBase extends DefaultTask { @Inject abstract FileSystemOperations getFs() diff --git a/src/main/groovy/org/labkey/gradle/task/RestartTriggerTask.groovy b/src/main/groovy/org/labkey/gradle/task/RestartTriggerTask.groovy deleted file mode 100644 index 891aec07..00000000 --- a/src/main/groovy/org/labkey/gradle/task/RestartTriggerTask.groovy +++ /dev/null @@ -1,37 +0,0 @@ -package org.labkey.gradle.task - -import org.gradle.api.DefaultTask -import org.gradle.api.file.DirectoryProperty -import org.gradle.api.provider.Property -import org.gradle.api.tasks.Input -import org.gradle.api.tasks.OutputDirectory -import org.labkey.gradle.util.BuildUtils - -import java.nio.charset.StandardCharsets -import java.text.SimpleDateFormat - -abstract class RestartTriggerTask extends DefaultTask -{ - public static final String RESTART_FILE_NAME = ".restartTrigger" - - @Input - final abstract Property useLocalBuild = project.objects.property(String).convention(project.hasProperty('useLocalBuild') ? (String) project.property('useLocalBuild') : null) - - @OutputDirectory - final abstract DirectoryProperty triggerFileDir = BuildUtils.getRootBuildDirectoryProperty(project, "deploy/modules") - - void updateRestartTriggerFile() - { - if (useLocalBuild.get() == null || "false" == useLocalBuild.get()) - return - - if (!triggerFileDir.get().asFile.exists()) - return - - File triggerFile = new File(triggerFileDir.get().asFile, RESTART_FILE_NAME) - try (OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(triggerFile), StandardCharsets.UTF_8)) - { - writer.write(SimpleDateFormat.getDateTimeInstance().format(new Date())) - } - } -} diff --git a/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy b/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy index 9ad0f858..4878ebae 100644 --- a/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy +++ b/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy @@ -33,7 +33,6 @@ import org.labkey.gradle.plugin.extension.LabKeyExtension import org.labkey.gradle.plugin.extension.ModuleExtension import org.labkey.gradle.plugin.extension.ServerDeployExtension import org.labkey.gradle.plugin.extension.TeamCityExtension -import org.labkey.gradle.task.RestartTriggerTask import java.nio.charset.StandardCharsets import java.nio.file.Files @@ -96,6 +95,7 @@ class BuildUtils public static final int ARTIFACT_CLASSIFIER_INDEX = 7 public static final int ARTIFACT_EXTENSION_INDEX = 8 public static final String BOOTSTRAP_JAR_BASE_NAME = "labkeyBootstrap" + public static final String RESTART_FILE_NAME = ".restartTrigger" // the set of modules required for minimal LabKey server functionality static List getBaseModules(Gradle gradle) @@ -629,13 +629,13 @@ class BuildUtils depProject.configurations.modules.dependencies.each { dep -> if (dep instanceof ProjectDependency) { - if (!pathsAdded.contains(dep.getDependencyProject().getPath())) { + if (!pathsAdded.contains(dep.getPath())) { distributionProject.logger.info("${distributionProject.path}: Adding '${config}' dependency on project ${dep}") distributionProject.dependencies.add(config, dep) - distributionProject.evaluationDependsOn(dep.getDependencyProject().getPath()) - pathsAdded.add(dep.getDependencyProject().getPath()) - distributionProject.logger.debug("${distributionProject.path}: Adding recursive '${config}' dependenices from ${dep.dependencyProject}") - addTransitiveModuleDependencies(distributionProject, dep.dependencyProject, config, pathsAdded) + distributionProject.evaluationDependsOn(dep.getPath()) + pathsAdded.add(dep.getPath()) + distributionProject.logger.debug("${distributionProject.path}: Adding recursive '${config}' dependenices from ${dep.getPath()}") + addTransitiveModuleDependencies(distributionProject, depProject.project(dep.getPath()), config, pathsAdded) } } else @@ -729,7 +729,7 @@ class BuildUtils // TODO I don't think this combinedClosure works. Change to just pass transitive through in the add // and then pass on the closure without evaluating it. def combinedClosure = { - transitive isTransitive + transitive = isTransitive if (closure != null) closure() } @@ -882,9 +882,7 @@ class BuildUtils * spring.devtools.restart.additional-paths * * @param project - for use in getting the rootProject's build directory - * @deprecated Use RestartTriggerTask as a base class for your task instead */ - @Deprecated(forRemoval=true) static void updateRestartTriggerFile(Project project) { if (!project.hasProperty('useLocalBuild') || "false" == project.property("useLocalBuild")) @@ -896,7 +894,7 @@ class BuildUtils OutputStreamWriter writer = null try { - File triggerFile = new File(triggerFileDir, RestartTriggerTask.RESTART_FILE_NAME) + File triggerFile = new File(triggerFileDir, RESTART_FILE_NAME) writer = new OutputStreamWriter(new FileOutputStream(triggerFile), StandardCharsets.UTF_8) writer.write(SimpleDateFormat.getDateTimeInstance().format(new Date())) } @@ -907,6 +905,16 @@ class BuildUtils } } + static boolean useServerNode(Project project) { + return project.hasProperty("useServerNode") + } + + static boolean useOwnNode(Project project) { + if (project.hasProperty("useOwnNode")) + return true + return !useServerNode(project) // default to using own (for now) + } + static void addExternalDependency(Project project, ExternalDependency dependency, Closure closure=null) { project.dependencies.add(dependency.configuration, dependency.coordinates, closure) diff --git a/src/main/groovy/org/labkey/gradle/util/GroupNames.groovy b/src/main/groovy/org/labkey/gradle/util/GroupNames.groovy index fea24fb8..9a00934a 100644 --- a/src/main/groovy/org/labkey/gradle/util/GroupNames.groovy +++ b/src/main/groovy/org/labkey/gradle/util/GroupNames.groovy @@ -37,5 +37,4 @@ class GroupNames public static final String WEB_APPLICATION = "Web application" public static final String VERIFICATION = "Verification" public static final String XML_SCHEMA = "xmlSchema" - public static final String YARN = "Yarn" }