From 0ee61a19038a49207ee4505f162c1aa579a00ef9 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Tue, 3 Sep 2024 17:28:19 -0700 Subject: [PATCH 01/12] Remove support for useEmbeddedTomcat, tomcat-lib, and log4j2.xml --- README.md | 6 +- build.gradle | 2 +- distributionResources/labkey.xml | 64 ---- distributionResources/log4j2.xml | 338 ------------------ .../org/labkey/gradle/plugin/LabKey.groovy | 5 - .../labkey/gradle/plugin/ServerDeploy.groovy | 179 +--------- .../org/labkey/gradle/plugin/TeamCity.groovy | 4 - .../org/labkey/gradle/plugin/Tomcat.groovy | 14 +- .../plugin/extension/StagingExtension.groovy | 2 - .../plugin/extension/TeamCityExtension.groovy | 7 +- .../labkey/gradle/task/ConfigureLog4J.groovy | 85 ----- .../org/labkey/gradle/task/DeployApp.groovy | 16 - .../org/labkey/gradle/task/DoThenSetup.groovy | 176 +++------ .../org/labkey/gradle/task/RunUiTest.groovy | 5 +- .../gradle/task/StageDistribution.groovy | 4 - .../org/labkey/gradle/task/StartTomcat.groovy | 74 ---- .../org/labkey/gradle/task/StopTomcat.groovy | 23 -- .../org/labkey/gradle/util/BuildUtils.groovy | 15 - 18 files changed, 76 insertions(+), 943 deletions(-) delete mode 100644 distributionResources/labkey.xml delete mode 100644 distributionResources/log4j2.xml delete mode 100644 src/main/groovy/org/labkey/gradle/task/ConfigureLog4J.groovy diff --git a/README.md b/README.md index 99917305..dd46b3de 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ on how to do that, including how to develop and test locally and the versioning ## Release Notes -### TBD +### 4.0.0 *Released*: TBD (Earliest compatible LabKey version: 24.8) - Add `--add-opens` JVM arg for `java.nio` to `startTomcat` task. Required for Snowflake JDBC driver. @@ -22,6 +22,10 @@ on how to do that, including how to develop and test locally and the versioning - Remove `makeDistribution` property and deprecate `embeddedArchiveType` property (currently ignored) - Fix `subDirName` property's optional behavior; this property now correctly defaults to `project.name`. - Change `extraFileIdentifier` property's default value to `project.name` as well +- Remove support for `useEmbeddedTomcat` property and remove all standalone handling +- Remove all `tomcat-lib` JAR file handling: `cleanTomcatLib`, `deployTomcatJars`, and `stageTomcatJars` tasks; + `tomcatJars` configuration +- Remove `labkey.xml` and `log4j2.xml` files and handling ### 3.0.1 *Released*: 18 July 2024 diff --git a/build.gradle b/build.gradle index 245667d4..99e75a29 100644 --- a/build.gradle +++ b/build.gradle @@ -42,7 +42,7 @@ dependencies { } group 'org.labkey.build' -project.version = "3.1.0-SNAPSHOT" +project.version = "3.1.0-fb_useEmbedded-SNAPSHOT" gradlePlugin { plugins { diff --git a/distributionResources/labkey.xml b/distributionResources/labkey.xml deleted file mode 100644 index c34bca83..00000000 --- a/distributionResources/labkey.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distributionResources/log4j2.xml b/distributionResources/log4j2.xml deleted file mode 100644 index 4f1039c9..00000000 --- a/distributionResources/log4j2.xml +++ /dev/null @@ -1,338 +0,0 @@ - - - - - - - - - - - - - - - %-5p %-24.24c{1} %d{ISO8601} %24.24t : %m%n - - - - - - - - - - - - - - - %m%n - - - - - - - - - - - - %m%n - - - - - - - - - - - - %-5p %-24.24c{1} %d{ISO8601} %24.24t : %m%n - - - - - - - - - - - %-5p %-24.24c{1} %d{ISO8601} %24.24t : %m%n - - - - - - - - - - %-5p %-24.24c{1} %d{ISO8601} %24.24t : %m%n - - - - - - - %d{yyyy-MM-dd HH:mm:ss}%m%n - - - - - - - - - - - %m%n - - - - - - - - - - - %-5p %-24.24c{1} %d{ISO8601} %24.24t : %m%n - - - - - - - - - - - %d{ISO8601} %m%n - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/groovy/org/labkey/gradle/plugin/LabKey.groovy b/src/main/groovy/org/labkey/gradle/plugin/LabKey.groovy index d5f0fcd7..93321044 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/LabKey.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/LabKey.groovy @@ -69,10 +69,6 @@ class LabKey implements Plugin project.configurations { modules - // we don't want this to be transitive because we use this configuration to - // clean out the tomcat/lib directory when we do a cleanDeploy and the transitive - // dependencies include some of the jars that are native to tomcat. - tomcatJars { transitive = false } remotePipelineJars external { canBeConsumed = true @@ -85,7 +81,6 @@ class LabKey implements Plugin project.configurations.external.setDescription("External dependencies to be included in a module's lib directory") project.configurations.externalsNotTrans.setDescription("Direct external dependencies (not including transitive dependencies), for use in creating jars.txt file") project.configurations.modules.setDescription("Modules used in the current server deployment") - project.configurations.tomcatJars.setDescription("Dependencies to be copied into the tomcat/lib directory upon deployment") project.configurations.remotePipelineJars.setDescription("Dependencies required for running remote pipeline jobs") } diff --git a/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy b/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy index b1bbfc57..ae0a4409 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy @@ -231,7 +231,7 @@ class ServerDeploy implements Plugin "setup", DoThenSetup) { DoThenSetup task -> task.group = GroupNames.DEPLOY - task.description = "Installs labkey.xml and application.properties (for embedded tomcat) into the tomcat configuration directory. Sets default database properties." + task.description = "Installs application.properties into the tomcat configuration directory. Sets default database properties." // stage the application first to try to avoid multiple Tomcat restarts task.mustRunAfter(project.tasks.stageApp) } @@ -272,41 +272,21 @@ class ServerDeploy implements Plugin } - String log4jFile = 'log4j2.xml' - project.tasks.register('configureLog4j', ConfigureLog4J) { - ConfigureLog4J task -> - task.fileName = log4jFile - task.group = GroupNames.DEPLOY - task.description = "Edit and copy ${log4jFile} file" - } - project.tasks.named('stageApp').configure {dependsOn(project.tasks.configureLog4j)} - project.tasks.register("stageDistribution", StageDistribution) { StageDistribution task -> task.group = GroupNames.DISTRIBUTION task.description = "Populate the staging directory using a LabKey distribution file from directory dist or directory specified with distDir property. Use property distType to specify zip or tar.gz (default)." } - if (BuildUtils.useEmbeddedTomcat(project)) - project.tasks.register("deployDistribution", DeployEmbeddedDistribution) { - DeployEmbeddedDistribution task -> - task.group = GroupNames.DISTRIBUTION - task.description = "Extract the executable jar from a distribution and put it and the included binaries in the appropriate deploy directory" - task.dependsOn(project.tasks.cleanEmbeddedDeploy, project.tasks.setup) - } - else - project.tasks.register("deployDistribution", DeployApp) { - DeployApp task -> - task.group = GroupNames.DISTRIBUTION - task.description = "Deploy a LabKey distribution file from directory dist or directory specified with distDir property. Use property distType to specify zip or tar.gz (default)." - task.dependsOn(project.tasks.stageDistribution, project.tasks.configureLog4j, project.tasks.setup) - task.doFirst {deployTomcatJars(task)} - } - + project.tasks.register("deployDistribution", DeployEmbeddedDistribution) { + DeployEmbeddedDistribution task -> + task.group = GroupNames.DISTRIBUTION + task.description = "Extract the executable jar from a distribution and put it and the included binaries in the appropriate deploy directory" + task.dependsOn(project.tasks.cleanEmbeddedDeploy, project.tasks.setup) + } // This may prevent multiple Tomcat restarts project.tasks.named('setup').configure {mustRunAfter(project.tasks.stageDistribution)} - project.tasks.named('configureLog4j').configure {mustRunAfter(project.tasks.stageDistribution)} project.tasks.register('undeployModules',UndeployModules) { UndeployModules task -> @@ -314,7 +294,6 @@ class ServerDeploy implements Plugin task.description = "Removes all module files and directories from the deploy and staging directories" } - project.tasks.register( 'cleanStaging',Delete) { Delete task -> @@ -337,16 +316,6 @@ class ServerDeploy implements Plugin } project.tasks.named('deployApp').configure {mustRunAfter(project.tasks.cleanDeploy)} - project.tasks.register("cleanTomcatLib") { - Task task -> - task.group = GroupNames.DEPLOY - task.description = "Remove the jar files deployed to the tomcat/lib directory" - task.doLast { - deleteTomcatLibs(project) - } - } - - project.tasks.register("cleanAndDeploy", DeployApp) { DeployApp task -> task.group = GroupNames.DEPLOY @@ -364,32 +333,6 @@ class ServerDeploy implements Plugin } project.tasks.named('deployApp').configure {mustRunAfter(project.tasks.cleanBuild)} - Project serverProject = BuildUtils.getServerProject(project) - if (serverProject != null) { - project.tasks.register('stageTomcatJars', DefaultTask) { - DefaultTask task -> - task.group = GroupNames.DEPLOY - task.description = "Copy runtime Tomcat dependencies to ${staging.tomcatLibDir}" - task.dependsOn(serverProject.configurations.tomcatJars) - task.doLast({ - stageTomcatJars(task) - }) - } - - project.tasks.register('deployTomcatJars', DefaultTask) { - DefaultTask task -> - task.group = GroupNames.DEPLOY - task.description = "Copying files from ${staging.tomcatLibDir} to \$CATALINA_HOME/lib" - task.dependsOn(serverProject.tasks.stageTomcatJars) - task.doLast({ - deployTomcatJars(task) - }) - } - - project.tasks.named('stageApp').configure {dependsOn(project.tasks.stageTomcatJars)} - project.tasks.named('deployApp').configure {dependsOn(project.tasks.deployTomcatJars)} - } - // TODO is this still useful? project.tasks.register( 'checkModuleTasks', DefaultTask) { @@ -432,92 +375,6 @@ class ServerDeploy implements Plugin } } - /** - * For consistency with a distribution deployment and the treatment of all other deployment artifacts, - * first copy the tomcat jars into the staging directory - * @param task - */ - private void stageTomcatJars(Task task) { - Project project = task.project - Project serverProject = BuildUtils.getServerProject(project) - // Remove the staging tomcatLib directory before copying into it to avoid duplicates. - project.delete project.staging.tomcatLibDir - - // We resolve the tomcatJars files outside of the ant copy because this seems to avoid - // an error we saw on TeamCity when running the pickMssql task on Windows when updating to Gradle 6.7 - // The error in the gradle log was: - // org.apache.tools.ant.BuildException: copy doesn't support the nested "exec" element. - // Theory is that when the files in the configuration have not been resolved, they get resolved - // inside the node being added to the ant task below and that is not supported. - FileTree tomcatJars = serverProject.configurations.tomcatJars.getAsFileTree() - - if (tomcatJars.size() == 1 && tomcatJars.getAt(0).getName().endsWith(".zip")) { - // Crack open zipped published tomcat libs - tomcatJars = project.zipTree(tomcatJars.singleFile) - } - task.logger.info("Copying to ${project.staging.tomcatLibDir}") - task.logger.info("tomcatFiles are ${tomcatJars.files}") - project.ant.copy( - todir: project.staging.tomcatLibDir, - preserveLastModified: true, - overwrite: true // Issue 33473: overwrite the existing jars to facilitate switching to older versions of labkey with older dependencies - ) - { - tomcatJars.addToAntBuilder(project.ant, "fileset", FileCollection.AntType.FileSet) - - // Put unversioned files into the tomcatLibDir. These files are meant to be copied into - // the tomcat/lib directory when deploying a build or a distribution. When version numbers change, - // you will end up with multiple versions of these jar files on the classpath, which will often - // result in problems of compatibility. Additionally, we want to maintain the (incorrect) names - // of the files that have been used with the Ant build process. - // - // We may employ CATALINA_BASE in order to separate our libraries from the ones that come with - // the tomcat distribution. This will require updating our instructions for installation by clients - // but would allow us to use artifacts with more self-documenting names. - chainedmapper() - { - flattenmapper() - // get rid of the version numbers on the jar files - // matches on: name-X.Y.Z-SNAPSHOT.jar, name-X.Y.Z_branch-SNAPSHOT.jar, name-X.Y.Z.jar - // - // N.B. Attempts to use BuildUtils.VERSIONED_ARTIFACT_NAME_PATTERN here fail for the javax.mail-X.Y.Z.jar file. - // The Ant regexpmapper chooses only javax as \\1, which is not what is wanted - regexpmapper(from: "^(.*?)(-\\d+(\\.\\d+)*(_.+)?(-SNAPSHOT)?)?\\.jar", to: "\\1.jar") - filtermapper() - { - replacestring(from: "mysql-connector-java", to: "mysql") - // the Ant build used mysql.jar - replacestring(from: "javax.mail", to: "mail") // the Ant build used mail.jar - replacestring(from: "jakarta.mail", to: "mail") - // the Ant build used mail.jar - replacestring(from: "jakarta.activation", to: "javax.activation") - // the Ant build used javax.activation.jar - } - } - } - } - - private void deployTomcatJars(Task task) { - Project project = task.project - if (BuildUtils.useEmbeddedTomcat(project)) { - task.logger.info("Not deploying tomcat jars for embedded deployment") - return - } - - JDBC_JARS.each{String name -> new File("${project.tomcat.catalinaHome}/lib/${name}").delete()} - - // Then copy them into the tomcat/lib directory - task.logger.info("Copying files from ${project.staging.tomcatLibDir} to ${project.tomcat.catalinaHome}/lib") - project.ant.copy( - todir: "${project.tomcat.catalinaHome}/lib", - preserveLastModified: true, - overwrite: true - ) - { - fileset(dir: project.staging.tomcatLibDir) - } - } - private static linkBinaries(Project project, String packageMgr, String version, workDirectory) { Project pmLinkProject = project.findProject(BuildUtils.getNodeBinProjectPath(project.gradle)) @@ -558,28 +415,6 @@ class ServerDeploy implements Plugin project.logger.warn("No file found with prefix ${nodeDir.path}/${nodeFilePrefix}. Symbolic link in ${linkContainer.getPath()}/node not created.") } } - - private static void deleteTomcatLibs(Project project) - { - project.tomcat.validateCatalinaHome() - - Files.newDirectoryStream(Paths.get(project.tomcat.catalinaHome, "lib"), "${BuildUtils.BOOTSTRAP_JAR_BASE_NAME}*.jar").each { Path path -> - project.delete path.toString() - } - - project.configurations.tomcatJars.files.each {File jarFile -> - File libFile = new File("${project.tomcat.catalinaHome}/lib/${jarFile.getName()}") - if (libFile.exists()) - project.delete libFile.getAbsolutePath() - } - - // Get rid of (un-versioned) jars that were deployed - TOMCAT_LIB_UNVERSIONED_JARS.each{String name -> - File libFile = new File("${project.tomcat.catalinaHome}/lib/${name}") - if (libFile.exists()) - project.delete libFile.getAbsolutePath() - } - } } diff --git a/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy b/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy index 1e4711c6..b180e87b 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy @@ -108,10 +108,6 @@ class TeamCity extends Tomcat task.group = GroupNames.TEST_SERVER task.description = "Removes log files from Tomcat and TeamCity" task.dependsOn project.tasks.cleanLogs - if (!BuildUtils.useEmbeddedTomcat(project)) { - // Not valid for embedded Tomcat - task.dependsOn project.tasks.cleanTemp - } task.doLast { project.delete "${project.projectDir}/${TEAMCITY_INFO_FILE}" } diff --git a/src/main/groovy/org/labkey/gradle/plugin/Tomcat.groovy b/src/main/groovy/org/labkey/gradle/plugin/Tomcat.groovy index 09a40565..3b175a2a 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/Tomcat.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/Tomcat.groovy @@ -15,7 +15,6 @@ */ package org.labkey.gradle.plugin - import org.gradle.api.DefaultTask import org.gradle.api.Plugin import org.gradle.api.Project @@ -26,7 +25,6 @@ import org.labkey.gradle.plugin.extension.TomcatExtension import org.labkey.gradle.plugin.extension.UiTestExtension import org.labkey.gradle.task.StartTomcat import org.labkey.gradle.task.StopTomcat -import org.labkey.gradle.util.BuildUtils import org.labkey.gradle.util.GroupNames /** @@ -60,27 +58,21 @@ class Tomcat implements Plugin project.tasks.register("startTomcat", StartTomcat) { StartTomcat task -> task.group = GroupNames.WEB_APPLICATION - task.description = "Start the local or embedded (if property useEmbeddedTomcat is defined) Tomcat instance" + task.description = "Start the embedded Tomcat instance" } project.tasks.register( "stopTomcat", StopTomcat) { StopTomcat task -> task.group = GroupNames.WEB_APPLICATION - task.description = "Stop the local or embedded (if property useEmbeddedTomcat is defined) Tomcat instance" + task.description = "Stop the embedded Tomcat instance" } project.tasks.register("cleanLogs", Delete) { Delete task -> - var logDir = BuildUtils.useEmbeddedTomcat(project) - ? "${ServerDeployExtension.getEmbeddedServerDeployDirectory(project)}/logs" - : "${tomcat.catalinaHome}/logs" - + var logDir = "${ServerDeployExtension.getEmbeddedServerDeployDirectory(project)}/logs" task.group = GroupNames.WEB_APPLICATION task.description = "Delete logs from ${logDir}" - if (!BuildUtils.useEmbeddedTomcat(project)) { - task.doFirst {tomcat.validateCatalinaHome()} - } task.configure { DeleteSpec spec -> spec.delete project.fileTree(logDir) } } diff --git a/src/main/groovy/org/labkey/gradle/plugin/extension/StagingExtension.groovy b/src/main/groovy/org/labkey/gradle/plugin/extension/StagingExtension.groovy index 1f862df3..cf5f0a72 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/extension/StagingExtension.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/extension/StagingExtension.groovy @@ -31,7 +31,6 @@ class StagingExtension String webInfDir String webappDir String modulesDir - String tomcatLibDir String pipelineLibDir void setDirectories(Project project) @@ -43,7 +42,6 @@ class StagingExtension webInfDir = "${buildDirPath}/${STAGING_WEBINF_DIR}" webappDir = "${buildDirPath}/${STAGING_WEBAPP_DIR}" modulesDir = "${buildDirPath}/${STAGING_MODULES_DIR}" - tomcatLibDir = "${dir}/tomcat-lib" // Note: Keep this path in sync with AdminController.getTomcatJars() pipelineLibDir = "${dir}/pipelineLib" } } 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 f2e34310..b7241f96 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/extension/TeamCityExtension.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/extension/TeamCityExtension.groovy @@ -116,12 +116,7 @@ class TeamCityExtension } File startupPropertiesDir() { - File startupDir - if (BuildUtils.useEmbeddedTomcat(project)) { - startupDir = new File(new File(ServerDeployExtension.getEmbeddedServerDeployDirectory(project)), 'startup') - } else { - startupDir = new File(new File(ServerDeployExtension.getServerDeployDirectory(project)), 'startup') - } + File startupDir = new File(new File(ServerDeployExtension.getEmbeddedServerDeployDirectory(project)), 'startup') FileUtils.forceMkdir(startupDir) return startupDir } diff --git a/src/main/groovy/org/labkey/gradle/task/ConfigureLog4J.groovy b/src/main/groovy/org/labkey/gradle/task/ConfigureLog4J.groovy deleted file mode 100644 index 7daa5ba5..00000000 --- a/src/main/groovy/org/labkey/gradle/task/ConfigureLog4J.groovy +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2016-2018 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.labkey.gradle.task - -import org.gradle.api.DefaultTask -import org.gradle.api.tasks.Input -import org.gradle.api.tasks.InputFile -import org.gradle.api.tasks.OutputFile -import org.gradle.api.tasks.TaskAction -import org.labkey.gradle.plugin.extension.LabKeyExtension -import org.labkey.gradle.util.BuildUtils - -/** - * Used to copy over the log4j.xml template file and replace the consoleAppender value - * as appropriate for the current deployMode. - */ -class ConfigureLog4J extends DefaultTask -{ - @Input - String fileName - - private File stagingDir = new File((String) project.staging.webappClassesDir) - private File deployDir = new File("${project.serverDeploy.webappDir}/WEB-INF/classes") - - @InputFile - File getLog4jXml() - { - return BuildUtils.getWebappConfigFile(project, fileName) - } - - @OutputFile - File getStagingFile() - { - return new File(stagingDir, fileName) - } - - @OutputFile - File getDeployFile() - { - return new File(deployDir, fileName) - } - - @TaskAction - void copyFile() - { - String consoleAppender = "" // this is the setting for production mode - if (LabKeyExtension.isDevMode(project)) - { - consoleAppender = '' - } - ant.copy( - todir: stagingDir, - overwrite: true, - ) - { - fileset(file: getLog4jXml()) - filterset(beginToken: "@@", endToken: "@@") - { - filter (token: "consoleAppender", - value: consoleAppender - ) - } - } - ant.copy( - todir: deployDir, - overwrite: true, - ) - { - fileset(file: getStagingFile()) - } - } -} diff --git a/src/main/groovy/org/labkey/gradle/task/DeployApp.groovy b/src/main/groovy/org/labkey/gradle/task/DeployApp.groovy index 7dde92ff..177a34aa 100644 --- a/src/main/groovy/org/labkey/gradle/task/DeployApp.groovy +++ b/src/main/groovy/org/labkey/gradle/task/DeployApp.groovy @@ -26,9 +26,6 @@ class DeployApp extends DeployAppBase @InputDirectory File stagingModulesDir = new File((String) project.staging.modulesDir) - @InputDirectory - File stagingWebappDir = new File((String) project.staging.webappDir) - @InputDirectory File stagingPipelineJarDir = new File((String) project.staging.pipelineLibDir) @@ -47,25 +44,12 @@ class DeployApp extends DeployAppBase @TaskAction void action() { - deployWebappDir() deployModules() deployPipelineJars() deployNlpEngine(deployBinDir) deployPlatformBinaries(deployBinDir) } - - private void deployWebappDir() - { - ant.copy( - todir: deployWebappDir, - preserveLastModified: true - ) - { - fileset(dir: stagingWebappDir) - } - } - private void deployModules() { ant.copy ( diff --git a/src/main/groovy/org/labkey/gradle/task/DoThenSetup.groovy b/src/main/groovy/org/labkey/gradle/task/DoThenSetup.groovy index 0827ae27..d3a4003a 100644 --- a/src/main/groovy/org/labkey/gradle/task/DoThenSetup.groovy +++ b/src/main/groovy/org/labkey/gradle/task/DoThenSetup.groovy @@ -60,128 +60,66 @@ class DoThenSetup extends DefaultTask @TaskAction void setup() { doDatabaseTask() - boolean useEmbeddedTomcat = BuildUtils.useEmbeddedTomcat(project) - if (!useEmbeddedTomcat) - { - project.tomcat.validateCatalinaHome() - File tomcatConfDir = project.file(project.tomcat.tomcatConfDir) - if (tomcatConfDir.exists()) { - if (!tomcatConfDir.isDirectory()) - throw new GradleException("No such directory: ${tomcatConfDir.absolutePath}") - if (!tomcatConfDir.canWrite() || !tomcatConfDir.canRead()) - throw new GradleException("Directory ${tomcatConfDir.absolutePath} does not have proper permissions") - } else if (!canCreate(tomcatConfDir)) - throw new GradleException("Insufficient permissions to create ${tomcatConfDir.absolutePath}") - - String appDocBase = project.serverDeploy.webappDir.toString().split("[/\\\\]").join("${File.separator}") - - if (!labkeyXmlUpToDate(appDocBase)) { - Properties configProperties = databaseProperties.getConfigProperties() - configProperties.putAll(getExtraJdbcProperties()) - configProperties.setProperty("appDocBase", appDocBase) - boolean isNextLineComment = false - File labkeyXml = BuildUtils.getWebappConfigFile(project, "labkey.xml") - project.copy({ CopySpec copy -> - copy.from labkeyXml - copy.into project.rootProject.layout.buildDirectory - copy.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE) - copy.filter({ String line -> - if (project.ext.has('enableJms') && project.ext.enableJms) { - line = line.replace("", "") - return line - } - // If we want to automatically enable an LDAP Sync that is hardcoded in the labkey.xml - // for testing purposes, this will uncomment that stanza if the enableLdapSync - // property is defined. - if (project.hasProperty('enableLdapSync')) { - line = line.replace("", "") - return line - } - if (configProperties.containsKey("extraJdbcDataSource")) - { - line = line.replace("", "") - } - if (isNextLineComment || line.contains("") - return line // Don't apply replacements to comments - } - return PropertiesUtils.replaceProps(line, configProperties, true) - }) - }) - - project.copy({ CopySpec copy -> - copy.from project.rootProject.layout.buildDirectory - copy.into "${project.tomcat.tomcatConfDir}" - copy.include "labkey.xml" - copy.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE) - }) + if (!embeddedConfigUpToDate()) { + Properties configProperties = databaseProperties.getConfigProperties() + configProperties.putAll(getExtraJdbcProperties()) + // in .properties files, backward slashes are seen as escape characters, so all paths must use forward slashes, even on Windows + configProperties.setProperty("pathToServer", project.rootDir.getAbsolutePath().replaceAll("\\\\", "/")) + + configProperties.setProperty("serverPort", tcPropOrDefault(project, + TeamCityExtension::getLabKeyServerPort, + "serverPort", + project.hasProperty("useSsl") ? "8443" : "8080")) + + configProperties.setProperty("shutdownPort", tcPropOrDefault(project, + TeamCityExtension::getLabKeyServerShutdownPort, + "shutdownPort", + "8081")) + + if (project.hasProperty("useSsl")) { + configProperties.setProperty("keyStore", tcPropOrDefault(project, + TeamCityExtension::getLabKeyServerKeystore, + "keyStore", + "/opt/teamcity-agent/localhost.keystore")) + + configProperties.setProperty("keyStorePassword", tcPropOrDefault(project, + TeamCityExtension::getLabKeyServerKeystorePassword, + "keyStorePassword", + "changeit")) } - } - else { - if (!embeddedConfigUpToDate()) { - Properties configProperties = databaseProperties.getConfigProperties() - configProperties.putAll(getExtraJdbcProperties()) - // in .properties files, backward slashes are seen as escape characters, so all paths must use forward slashes, even on Windows - configProperties.setProperty("pathToServer", project.rootDir.getAbsolutePath().replaceAll("\\\\", "/")) - - configProperties.setProperty("serverPort", tcPropOrDefault(project, - TeamCityExtension::getLabKeyServerPort, - "serverPort", - project.hasProperty("useSsl") ? "8443" : "8080")) - - configProperties.setProperty("shutdownPort", tcPropOrDefault(project, - TeamCityExtension::getLabKeyServerShutdownPort, - "shutdownPort", - "8081")) - if (project.hasProperty("useSsl")) { - configProperties.setProperty("keyStore", tcPropOrDefault(project, - TeamCityExtension::getLabKeyServerKeystore, - "keyStore", - "/opt/teamcity-agent/localhost.keystore")) - - configProperties.setProperty("keyStorePassword", tcPropOrDefault(project, - TeamCityExtension::getLabKeyServerKeystorePassword, - "keyStorePassword", - "changeit")) - } - - String embeddedDir = BuildUtils.getEmbeddedConfigPath(project) - File configsDir = new File(BuildUtils.getConfigsProject(project).projectDir, "configs") - project.copy({ CopySpec copy -> - copy.from configsDir - copy.into embeddedDir - copy.include "application.properties" - copy.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE) - copy.filter({ String line -> - // Always uncomment properties prepended by '#setupTask#' - line = line.replace("#setupTask#", "") - if (project.hasProperty("useSsl")) { - line = line.replace("#server.ssl", "server.ssl") - } - if (project.hasProperty("useLocalBuild") && "false" != project.property("useLocalBuild")) { - // Enable properties that require 'useLocalBuild' (e.g. 'context.webAppLocation' and 'spring.devtools.restart.additional-paths') - line = line.replace("#useLocalBuild#", "") - } - else { - // Remove placeholder - line = line.replace("#useLocalBuild#", "#") - } - if (configProperties.containsKey("extraJdbcDataSource") && line.contains("=@@extraJdbc")) - { - line = line.replace("#context.", "context.") - } - if (line.startsWith("#")) { - return line // Don't apply replacements to comments - } - return PropertiesUtils.replaceProps(line, configProperties, false) - }) + String embeddedDir = BuildUtils.getEmbeddedConfigPath(project) + File configsDir = new File(BuildUtils.getConfigsProject(project).projectDir, "configs") + project.copy({ CopySpec copy -> + copy.from configsDir + copy.into embeddedDir + copy.include "application.properties" + copy.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE) + copy.filter({ String line -> + // Always uncomment properties prepended by '#setupTask#' + line = line.replace("#setupTask#", "") + if (project.hasProperty("useSsl")) { + line = line.replace("#server.ssl", "server.ssl") + } + if (project.hasProperty("useLocalBuild") && "false" != project.property("useLocalBuild")) { + // Enable properties that require 'useLocalBuild' (e.g. 'context.webAppLocation' and 'spring.devtools.restart.additional-paths') + line = line.replace("#useLocalBuild#", "") + } + else { + // Remove placeholder + line = line.replace("#useLocalBuild#", "#") + } + if (configProperties.containsKey("extraJdbcDataSource") && line.contains("=@@extraJdbc")) + { + line = line.replace("#context.", "context.") + } + if (line.startsWith("#")) { + return line // Don't apply replacements to comments + } + return PropertiesUtils.replaceProps(line, configProperties, false) }) - BuildUtils.updateRestartTriggerFile(project) - } + }) + BuildUtils.updateRestartTriggerFile(project) } } diff --git a/src/main/groovy/org/labkey/gradle/task/RunUiTest.groovy b/src/main/groovy/org/labkey/gradle/task/RunUiTest.groovy index 84f35a86..bb4c2dcd 100644 --- a/src/main/groovy/org/labkey/gradle/task/RunUiTest.groovy +++ b/src/main/groovy/org/labkey/gradle/task/RunUiTest.groovy @@ -88,11 +88,10 @@ abstract class RunUiTest extends Test systemProperty "labkey.root", project.rootProject.projectDir systemProperty "project.root", project.rootProject.projectDir systemProperty "user.home", System.getProperty('user.home') - // A handfull of tests require tomcat.home to be defined when running within IntelliJ + // A handful of tests require tomcat.home to be defined when running within IntelliJ systemProperty "tomcat.home", project.tomcat.catalinaHome systemProperty "test.credentials.file", "${project.projectDir}/test.credentials.json" - if (BuildUtils.useEmbeddedTomcat(project)) - systemProperty BuildUtils.USE_EMBEDDED_TOMCAT, '' + systemProperty BuildUtils.USE_EMBEDDED_TOMCAT, '' setTeamCityProperties() } diff --git a/src/main/groovy/org/labkey/gradle/task/StageDistribution.groovy b/src/main/groovy/org/labkey/gradle/task/StageDistribution.groovy index 5c90bcd6..09727ef7 100644 --- a/src/main/groovy/org/labkey/gradle/task/StageDistribution.groovy +++ b/src/main/groovy/org/labkey/gradle/task/StageDistribution.groovy @@ -38,10 +38,6 @@ class StageDistribution extends DefaultTask @OutputDirectory File pipelineJarStagingDir = new File((String) project.staging.pipelineLibDir) - @OutputDirectory - File tomcatJarStagingDir = new File((String) project.staging.tomcatLibDir) - - @TaskAction void action() { diff --git a/src/main/groovy/org/labkey/gradle/task/StartTomcat.groovy b/src/main/groovy/org/labkey/gradle/task/StartTomcat.groovy index 2745bea7..29e64dd4 100644 --- a/src/main/groovy/org/labkey/gradle/task/StartTomcat.groovy +++ b/src/main/groovy/org/labkey/gradle/task/StartTomcat.groovy @@ -43,14 +43,6 @@ class StartTomcat extends DefaultTask @TaskAction void action() - { - if (BuildUtils.useEmbeddedTomcat(project)) - startEmbeddedTomcat() - else - startLocalTomcat() - } - - private startEmbeddedTomcat() { File jarFile = BuildUtils.getExecutableServerJar(project) if (jarFile == null) @@ -89,72 +81,6 @@ class StartTomcat extends DefaultTask } } - private void startLocalTomcat() - { - project.tomcat.validateCatalinaHome() - - // we need to create the logs directory if it doesn't exist because Tomcat won't start without it, - // and, annoyingly, this is not seen as an error for this action. - if (!project.file("${project.tomcat.catalinaHome}/logs").exists()) - project.mkdir("${project.tomcat.catalinaHome}/logs") - if (SystemUtils.IS_OS_UNIX) - { - project.ant.chmod(dir: "${project.tomcat.catalinaHome}/bin", includes: "**/*.sh", perm: "ug+rx") - } - project.ant.exec( - spawn: true, - dir: SystemUtils.IS_OS_WINDOWS ? "${project.tomcat.catalinaHome}/bin" : project.tomcat.catalinaHome, - executable: SystemUtils.IS_OS_WINDOWS ? "cmd" : "bin/catalina.sh" - ) - { - env( - key: "PATH", - path: "${BuildUtils.getServerProject(project).serverDeploy.binDir}${File.pathSeparator}${System.getenv("PATH")}" - ) - - String catalinaOpts = getStartupOpts(project).join(" ").replaceAll("\\s+", " ") - - this.logger.debug("setting CATALINA_OPTS to ${catalinaOpts}") - env( - key: "CATALINA_OPTS", - value: catalinaOpts - ) - if (TeamCityExtension.isOnTeamCity(project)) - { - env( - key: "R_LIBS_USER", - value: System.getenv("R_LIBS_USER") != null ? System.getenv("R_LIBS_USER") : project.rootProject.file("sampledata/rlabkey") - ) - - def javaHome = TeamCityExtension.getTeamCityProperty(project, "tomcatJavaHome", System.getenv("JAVA_HOME")) - env ( - key: "JAVA_HOME", - value: javaHome - ) - env ( - key: "JRE_HOME", - value: javaHome - ) - } - - if (SystemUtils.IS_OS_WINDOWS) - { - env( - key: "CLOSE_WINDOW", - value: true - ) - arg(line: "/c start ") - arg(value: "'Tomcat Server'") - arg(value: "/B") - arg(value: "${project.tomcat.catalinaHome}/bin/catalina.bat") - } - arg(value: "start") - } - println("Waiting 5 seconds for tomcat to start...") - project.ant.sleep(seconds: 5) - println("Tomcat started.") - } - static List getStartupOpts(Project project) { List optsList = new ArrayList<>() diff --git a/src/main/groovy/org/labkey/gradle/task/StopTomcat.groovy b/src/main/groovy/org/labkey/gradle/task/StopTomcat.groovy index 369fb50a..75bbbc94 100644 --- a/src/main/groovy/org/labkey/gradle/task/StopTomcat.groovy +++ b/src/main/groovy/org/labkey/gradle/task/StopTomcat.groovy @@ -17,8 +17,6 @@ package org.labkey.gradle.task import org.gradle.api.DefaultTask import org.gradle.api.tasks.TaskAction -import org.gradle.process.JavaExecSpec -import org.labkey.gradle.util.BuildUtils import org.labkey.gradle.util.PropertiesUtils /** @@ -28,27 +26,6 @@ class StopTomcat extends DefaultTask { @TaskAction void action() - { - if (BuildUtils.useEmbeddedTomcat(project)) - stopEmbeddedTomcat() - else - stopLocalTomcat() - } - - void stopLocalTomcat() - { - project.tomcat.validateCatalinaHome() - project.javaexec( { - JavaExecSpec java -> - java.mainClass = "org.apache.catalina.startup.Bootstrap" - java.classpath { ["${project.tomcat.catalinaHome}/bin/bootstrap.jar", "${project.tomcat.catalinaHome}/bin/tomcat-juli.jar"] } - java.systemProperties["user.dir"] = project.tomcat.catalinaHome - java.args = ["stop"] - java.ignoreExitValue = true - }) - } - - void stopEmbeddedTomcat() { def applicationProperties = PropertiesUtils.getApplicationProperties(project) def port = applicationProperties.getProperty("management.server.port", applicationProperties.getProperty("server.port")) diff --git a/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy b/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy index cb0caf92..2b70ec35 100644 --- a/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy +++ b/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy @@ -885,21 +885,6 @@ class BuildUtils return project.findProject(getEmbeddedProjectPath(project.gradle)) != null } - static boolean useEmbeddedTomcat(Project project) - { - _useEmbeddedTomcat(project) - } - - static boolean useEmbeddedTomcat(Settings settings) - { - _useEmbeddedTomcat(settings) - } - - private static boolean _useEmbeddedTomcat(Object o) - { - o.hasProperty(USE_EMBEDDED_TOMCAT) && o[USE_EMBEDDED_TOMCAT] != "false" - } - /** * Writes a file in the build/deploy/modules directory that can be used as a trigger file for restarting * SpringBoot. Without this, restarts may happen before the full application deployment is done, resulting From 5709e4a085da3933e041430c239ebbacc47c0ef7 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Wed, 4 Sep 2024 11:00:51 -0700 Subject: [PATCH 02/12] Some code review feedback and fix TeamCity distribution build --- src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy | 4 ---- src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy | 1 - .../groovy/org/labkey/gradle/task/ModuleDistribution.groovy | 4 ---- src/main/groovy/org/labkey/gradle/task/RunUiTest.groovy | 1 - src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy | 1 - 5 files changed, 11 deletions(-) diff --git a/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy b/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy index ae0a4409..b69ccd46 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy @@ -27,7 +27,6 @@ import org.gradle.api.artifacts.Dependency import org.gradle.api.file.CopySpec import org.gradle.api.file.DeleteSpec import org.gradle.api.file.FileCollection -import org.gradle.api.file.FileTree import org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency import org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency import org.gradle.api.tasks.Delete @@ -47,9 +46,6 @@ import java.nio.file.Paths */ class ServerDeploy implements Plugin { - public static final List JDBC_JARS = ["jtds.jar", "mysql.jar", "postgresql.jar"] - public static final List TOMCAT_LIB_UNVERSIONED_JARS = JDBC_JARS + ["ant.jar", "mail.jar", "javax.activation.jar"] - private ServerDeployExtension serverDeploy @Override diff --git a/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy b/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy index b180e87b..451d9ec8 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy @@ -113,7 +113,6 @@ class TeamCity extends Tomcat } } - project.tasks.named("stopTomcat").configure { doLast { ensureShutdown(project) diff --git a/src/main/groovy/org/labkey/gradle/task/ModuleDistribution.groovy b/src/main/groovy/org/labkey/gradle/task/ModuleDistribution.groovy index 2e0c6cfb..16470177 100644 --- a/src/main/groovy/org/labkey/gradle/task/ModuleDistribution.groovy +++ b/src/main/groovy/org/labkey/gradle/task/ModuleDistribution.groovy @@ -211,10 +211,6 @@ class ModuleDistribution extends DefaultTask String modulesZipFile = getDistributionZipPath() File serverJarFile = new File(getEmbeddedTomcatJarPath()) ant.zip(destFile: modulesZipFile) { - zipfileset(dir: staging.webappDir, - prefix: "labkeywebapp") { - exclude(name: "WEB-INF/classes/distribution") - } zipfileset(dir: getModulesDir(), prefix: "modules") { include(name: "*.module") diff --git a/src/main/groovy/org/labkey/gradle/task/RunUiTest.groovy b/src/main/groovy/org/labkey/gradle/task/RunUiTest.groovy index bb4c2dcd..0df16832 100644 --- a/src/main/groovy/org/labkey/gradle/task/RunUiTest.groovy +++ b/src/main/groovy/org/labkey/gradle/task/RunUiTest.groovy @@ -91,7 +91,6 @@ abstract class RunUiTest extends Test // A handful of tests require tomcat.home to be defined when running within IntelliJ systemProperty "tomcat.home", project.tomcat.catalinaHome systemProperty "test.credentials.file", "${project.projectDir}/test.credentials.json" - systemProperty BuildUtils.USE_EMBEDDED_TOMCAT, '' setTeamCityProperties() } diff --git a/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy b/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy index 2b70ec35..f85ba29b 100644 --- a/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy +++ b/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy @@ -45,7 +45,6 @@ import java.util.regex.Pattern class BuildUtils { public static final String BUILD_FROM_SOURCE_PROP = "buildFromSource" - public static final String USE_EMBEDDED_TOMCAT = "useEmbeddedTomcat" public static final String BUILD_CLIENT_LIBS_FROM_SOURCE_PROP = "buildClientLibsFromSource" public static final String SERVER_MODULES_DIR = "server/modules" public static final String PLATFORM_MODULES_DIR = "server/modules/platform" From 51a9ff3eca33fe3a13af42cc72bbe5864eebc6c8 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Wed, 4 Sep 2024 11:35:00 -0700 Subject: [PATCH 03/12] Update src/main/groovy/org/labkey/gradle/task/RunUiTest.groovy Co-authored-by: Trey Chadick --- src/main/groovy/org/labkey/gradle/task/RunUiTest.groovy | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/groovy/org/labkey/gradle/task/RunUiTest.groovy b/src/main/groovy/org/labkey/gradle/task/RunUiTest.groovy index 0df16832..2011fa55 100644 --- a/src/main/groovy/org/labkey/gradle/task/RunUiTest.groovy +++ b/src/main/groovy/org/labkey/gradle/task/RunUiTest.groovy @@ -88,8 +88,6 @@ abstract class RunUiTest extends Test systemProperty "labkey.root", project.rootProject.projectDir systemProperty "project.root", project.rootProject.projectDir systemProperty "user.home", System.getProperty('user.home') - // A handful of tests require tomcat.home to be defined when running within IntelliJ - systemProperty "tomcat.home", project.tomcat.catalinaHome systemProperty "test.credentials.file", "${project.projectDir}/test.credentials.json" setTeamCityProperties() From 740a2da4bbc01dd381871dd668ca9a0cc757d370 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Wed, 4 Sep 2024 11:35:55 -0700 Subject: [PATCH 04/12] Excise more unused code --- .../labkey/gradle/plugin/ServerDeploy.groovy | 10 ----- .../org/labkey/gradle/plugin/Tomcat.groovy | 42 ++----------------- .../plugin/extension/TomcatExtension.groovy | 31 -------------- .../org/labkey/gradle/task/Bootstrap.groovy | 6 --- 4 files changed, 3 insertions(+), 86 deletions(-) diff --git a/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy b/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy index b69ccd46..972b6b36 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy @@ -359,16 +359,6 @@ class ServerDeploy implements Plugin } project.tasks.named('deployApp').configure {dependsOn(project.tasks.named("checkModuleTasks"))} project.tasks.named('checkModuleTasks').configure {mustRunAfter(project.tasks.stageApp)} // do this so the message appears at the bottom of the output - if (project.plugins.hasPlugin(Tomcat)) { - if (project.tomcat.hasCatalinaHome()) { - project.tasks.named("cleanBuild").configure { - it.dependsOn(project.tasks.stopTomcat) - } - project.tasks.named("cleanDeploy").configure { - it.dependsOn(project.tasks.stopTomcat) - } - } - } } private static linkBinaries(Project project, String packageMgr, String version, workDirectory) { diff --git a/src/main/groovy/org/labkey/gradle/plugin/Tomcat.groovy b/src/main/groovy/org/labkey/gradle/plugin/Tomcat.groovy index 3b175a2a..b59d6267 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/Tomcat.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/Tomcat.groovy @@ -15,14 +15,12 @@ */ package org.labkey.gradle.plugin -import org.gradle.api.DefaultTask + import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.file.DeleteSpec import org.gradle.api.tasks.Delete import org.labkey.gradle.plugin.extension.ServerDeployExtension -import org.labkey.gradle.plugin.extension.TomcatExtension -import org.labkey.gradle.plugin.extension.UiTestExtension import org.labkey.gradle.task.StartTomcat import org.labkey.gradle.task.StopTomcat import org.labkey.gradle.util.GroupNames @@ -37,23 +35,10 @@ class Tomcat implements Plugin @Override void apply(Project project) { - TomcatExtension tomcat = project.extensions.findByType(TomcatExtension.class) - if (tomcat == null) - { - tomcat = project.extensions.create("tomcat", TomcatExtension, project) - } - if (project.plugins.hasPlugin(TestRunner.class)) - { - UiTestExtension testEx = (UiTestExtension) project.getExtensions().getByType(UiTestExtension.class) - tomcat.assertionFlag = Boolean.valueOf((String) testEx.getTestConfig("disableAssertions")) ? "-da" : "-ea" - } - tomcat.catalinaOpts = "-Dproject.root=${project.rootProject.projectDir.absolutePath}" - - addTasks(project, tomcat) + addTasks(project) } - - private static void addTasks(Project project, TomcatExtension tomcat) + private static void addTasks(Project project) { project.tasks.register("startTomcat", StartTomcat) { StartTomcat task -> @@ -75,27 +60,6 @@ class Tomcat implements Plugin task.description = "Delete logs from ${logDir}" task.configure { DeleteSpec spec -> spec.delete project.fileTree(logDir) } } - - project.tasks.register("cleanTemp", DefaultTask) { - DefaultTask task -> - task.group = GroupNames.WEB_APPLICATION - task.description = "Delete temp files from ${tomcat.catalinaHome}" - task.doFirst {tomcat.validateCatalinaHome()} - task.doLast( { - // Note that we use the AntBuilder here because a fileTree in Gradle is a set of FILES only. - // Deleting a file tree will delete all the leaves of the directory structure, but none of the - // directories. - project.ant.delete(includeEmptyDirs: true, quiet: true) - { - fileset(dir: "${tomcat.catalinaHome}/temp") - { - include(name: "**/*") - } - } - new File("${tomcat.catalinaHome}", "temp").mkdirs() - }) - } - } } diff --git a/src/main/groovy/org/labkey/gradle/plugin/extension/TomcatExtension.groovy b/src/main/groovy/org/labkey/gradle/plugin/extension/TomcatExtension.groovy index 8bcfc0e2..c4c2714f 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/extension/TomcatExtension.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/extension/TomcatExtension.groovy @@ -15,7 +15,6 @@ */ package org.labkey.gradle.plugin.extension -import org.gradle.api.GradleException import org.gradle.api.Project class TomcatExtension @@ -49,36 +48,6 @@ class TomcatExtension return tomcatConfDir } - void validateCatalinaHome() - { - String errorMsg = "" - if (catalinaHome == null || catalinaHome.isEmpty()) - { - errorMsg = "Tomcat home directory not set" - } - else if (!project.file(catalinaHome).exists()) - { - errorMsg = "Specified Tomcat home directory [${project.file(catalinaHome).getAbsolutePath()}] does not exist" - } - else if (!new File(project.file(catalinaHome), "conf/server.xml").exists()) - { - errorMsg = "Specified Tomcat home directory [${project.file(catalinaHome).getAbsolutePath()}] does not appear to be a tomcat installation" - } - if (!errorMsg.isEmpty()) - { - throw new GradleException("${errorMsg}. Please specify using the environment variable CATALINA_HOME. " + - "You may also set the value of the 'tomcat.home' system property using either " + - "systemProp.tomcat.home= in a gradle.properties file or " + - "-Dtomcat.home= on command line. Note that CATALINA_HOME is not, generally, " + - "visible from within IntelliJ IDEA") - } - } - - boolean hasCatalinaHome() - { - return catalinaHome != null && !catalinaHome.isEmpty() - } - private void setCatalinaDirs(Project project) { if (System.getenv("CATALINA_HOME") != null) diff --git a/src/main/groovy/org/labkey/gradle/task/Bootstrap.groovy b/src/main/groovy/org/labkey/gradle/task/Bootstrap.groovy index 5e57ddd9..b9d967f4 100644 --- a/src/main/groovy/org/labkey/gradle/task/Bootstrap.groovy +++ b/src/main/groovy/org/labkey/gradle/task/Bootstrap.groovy @@ -36,10 +36,4 @@ class Bootstrap extends DoThenSetup { databaseProperties = new DatabaseProperties(project, true) } - - @Override - boolean labkeyXmlUpToDate(String appDocBase) - { - return false - } } From e8950c85c7ab7deb3486a09020e5df0ebd4c0835 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Wed, 4 Sep 2024 14:10:51 -0700 Subject: [PATCH 05/12] Nix distributionResources --- .gitignore | 1 - build.gradle | 8 - distributionResources/README.txt | 7 - distributionResources/embedded/README.txt | 7 - .../embedded/config/application.properties | 163 ------- distributionResources/manual-upgrade.sh | 452 ------------------ .../labkey/gradle/plugin/Distribution.groovy | 1 - .../gradle/task/ModuleDistribution.groovy | 23 - .../org/labkey/gradle/util/BuildUtils.groovy | 10 - 9 files changed, 672 deletions(-) delete mode 100644 distributionResources/README.txt delete mode 100644 distributionResources/embedded/README.txt delete mode 100644 distributionResources/embedded/config/application.properties delete mode 100755 distributionResources/manual-upgrade.sh diff --git a/.gitignore b/.gitignore index 5f94cbe2..fd9d1fe3 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,6 @@ lib/ # Ignore zip files created by build src/main/resources/moduleTemplate.zip -src/main/resources/distributionResources.zip # Ignore Gradle GUI config gradle-app.setting diff --git a/build.gradle b/build.gradle index 99e75a29..09a75c9d 100644 --- a/build.gradle +++ b/build.gradle @@ -163,14 +163,6 @@ if (project.file("moduleTemplate").exists()) project.tasks.processResources.dependsOn(project.tasks.zipModuleTemplate) } -project.tasks.register("zipDistributionResources", Zip) { - Zip zip -> - zip.archiveFileName = "distributionResources.zip" - zip.from project.file("distributionResources") - zip.destinationDirectory.set(new File(project.projectDir, "src/main/resources")) -} -project.tasks.processResources.dependsOn(project.tasks.zipDistributionResources) - if (hasProperty('artifactory_user') && hasProperty('artifactory_password')) { publishing { diff --git a/distributionResources/README.txt b/distributionResources/README.txt deleted file mode 100644 index c3aa8701..00000000 --- a/distributionResources/README.txt +++ /dev/null @@ -1,7 +0,0 @@ -Thank you for downloading LabKey Server. For more information about... - -- Installing LabKey Server. See https://www.labkey.org/Documentation/wiki-page.view?name=config - -- Upgrading LabKey Server. See https://www.labkey.org/Documentation/wiki-page.view?name=upgrade - -- Using LabKey Server. See https://www.labkey.org/Documentation/project-begin.view \ No newline at end of file diff --git a/distributionResources/embedded/README.txt b/distributionResources/embedded/README.txt deleted file mode 100644 index 57e7aac2..00000000 --- a/distributionResources/embedded/README.txt +++ /dev/null @@ -1,7 +0,0 @@ -Thank you for downloading LabKey Server. For more information about... - -- Installing LabKey Server. See https://www.labkey.org/Documentation/wiki-page.view?name=embeddedConfig - -- Upgrading LabKey Server. See https://www.labkey.org/Documentation/wiki-page.view?name=embeddedUpgrade - -- Using LabKey Server. See https://www.labkey.org/Documentation/project-begin.view diff --git a/distributionResources/embedded/config/application.properties b/distributionResources/embedded/config/application.properties deleted file mode 100644 index 90e45d76..00000000 --- a/distributionResources/embedded/config/application.properties +++ /dev/null @@ -1,163 +0,0 @@ -server.port=8080 - -## To use ssl, update the properties below for your local installation - -#server.ssl.enabled=true -#server.ssl.enabled-protocols=TLSv1.3,TLSv1.2,TLSv1.1 -#server.ssl.protocol=TLS -#server.ssl.key-alias=tomcat -#server.ssl.key-store=@@keyStore@@ -#server.ssl.key-store-password=@@keyStorePassword@@ -## Typically either PKCS12 or JKS -#server.ssl.key-store-type=PKCS12 -#server.ssl.ciphers=HIGH:!ADH:!EXP:!SSLv2:!SSLv3:!MEDIUM:!LOW:!NULL:!aNULL - -## HTTP-only port for servers that need to handle both HTTPS (configure via server.port and server.ssl above) and HTTP -#context.httpPort=8080 - -## Database connections. All deployments need a labkeyDataSource as their primary database. Add additional external -## data sources by specifying the required properties (at least driverClassName, url, username, and password) -## with a prefix of context.resources.jdbc.. -context.resources.jdbc.labkeyDataSource.type=javax.sql.DataSource -context.resources.jdbc.labkeyDataSource.driverClassName=org.postgresql.Driver -context.resources.jdbc.labkeyDataSource.url=jdbc:postgresql://localhost/labkey -context.resources.jdbc.labkeyDataSource.username=@@jdbcUser@@ -context.resources.jdbc.labkeyDataSource.password=@@jdbcPassword@@ -context.resources.jdbc.labkeyDataSource.maxTotal=50 -context.resources.jdbc.labkeyDataSource.maxIdle=10 -context.resources.jdbc.labkeyDataSource.maxWaitMillis=120000 -context.resources.jdbc.labkeyDataSource.accessToUnderlyingConnectionAllowed=true -context.resources.jdbc.labkeyDataSource.validationQuery=SELECT 1 -#context.resources.jdbc.labkeyDataSource.logQueries=true -#context.resources.jdbc.labkeyDataSource.displayName=Alternate Display Name - -#context.resources.jdbc.@@extraJdbcDataSource@@.driverClassName=@@extraJdbcDriverClassName@@ -#context.resources.jdbc.@@extraJdbcDataSource@@.url=@@extraJdbcUrl@@ -#context.resources.jdbc.@@extraJdbcDataSource@@.username=@@extraJdbcUsername@@ -#context.resources.jdbc.@@extraJdbcDataSource@@.password=@@extraJdbcPassword@@ - -context.encryptionKey=@@encryptionKey@@ - -## By default, we deploy to the root context path. However, some servers have historically used /labkey or even /cpas -#context.contextPath=/labkey - -## Using a legacy context path provides backwards compatibility with old deployments. A typical use case would be to -## deploy to the root context (the default) and configure /labkey as the legacy path. GETs will be redirected. -## All other methods (POSTs, PUTs, etc) will be handled server-side via a servlet forward. -#context.legacyContextPath=/labkey - -## Other webapps to be deployed, most commonly to deliver a set of static files. The context path to deploy into is the -## property name after the "context.additionalWebapps." prefix, and the value is the location of the webapp on disk -#context.additionalWebapps.firstContextPath=/my/webapp/path -#context.additionalWebapps.secondContextPath=/my/other/webapp/path - -#context.oldEncryptionKey= -#context.requiredModules= -#context.pipelineConfig=/path/to/pipeline/config/dir -#context.serverGUID= -#context.bypass2FA=true -#context.workDirLocation=/path/to/desired/workDir - -mail.smtpHost=@@smtpHost@@ -mail.smtpPort=@@smtpPort@@ -mail.smtpUser=@@smtpUser@@ -#mail.smtpFrom=@@smtpFrom@@ -#mail.smtpPassword=@@smtpPassword@@ -#mail.startTlsEnable=@@smtpStartTlsEnable@@ -#mail.smtpSocketFactoryClass=@@smtpSocketFactoryClass@@ -#mail.smtpAuth=@@smtpAuth@@ - -## Optional - JMS configuration for remote ActiveMQ message management for distributed pipeline jobs -## https://www.labkey.org/Documentation/wiki-page.view?name=jmsQueue -#context.resources.jms.ConnectionFactory.type=org.apache.activemq.ActiveMQConnectionFactory -#context.resources.jms.ConnectionFactory.factory=org.apache.activemq.jndi.JNDIReferenceFactory -#context.resources.jms.ConnectionFactory.description=JMS Connection Factory -## Use an in-process ActiveMQ queue -#context.resources.jms.ConnectionFactory.brokerURL=vm://localhost?broker.persistent=false&broker.useJmx=false -## Use an out-of-process ActiveMQ queue -#context.resources.jms.ConnectionFactory.brokerURL=tcp://localhost:61616 -#context.resources.jms.ConnectionFactory.brokerName=LocalActiveMQBroker - -## Optional - LDAP configuration for LDAP group/user synchronization -## https://www.labkey.org/Documentation/wiki-page.view?name=LDAP_sync -#context.resources.ldap.ConfigFactory.type=org.labkey.premium.ldap.LdapConnectionConfigFactory -#context.resources.ldap.ConfigFactory.factory=org.labkey.premium.ldap.LdapConnectionConfigFactory -#context.resources.ldap.ConfigFactory.host=myldap.mydomain.com -#context.resources.ldap.ConfigFactory.port=389 -#context.resources.ldap.ConfigFactory.principal=cn=read_user -#context.resources.ldap.ConfigFactory.credentials=read_user_password -#context.resources.ldap.ConfigFactory.useTls=false -#context.resources.ldap.ConfigFactory.useSsl=false -#context.resources.ldap.ConfigFactory.sslProtocol=SSLv3 - -## HTTP session timeout for users - defaults to 30 minutes -#server.servlet.session.timeout=30m - -## Enable shutdown endpoint. Allows server to be shutdown with a POST to 'localhost:8081/actuator/shutdown -#management.endpoint.shutdown.enabled=true -#management.endpoints.enabled-by-default=false -#management.endpoints.web.exposure.include=* -#management.server.port=8081 - -## Don't show the Spring banner on startup -spring.main.banner-mode=off -#logging.config=path/to/alternative/log4j2.xml - -## Optional - JMS configuration for remote ActiveMQ message management for distributed pipeline jobs -## https://www.labkey.org/Documentation/wiki-page.view?name=jmsQueue -#context.resources.jms.name=jms/ConnectionFactory -#context.resources.jms.type=org.apache.activemq.ActiveMQConnectionFactory -#context.resources.jms.factory=org.apache.activemq.jndi.JNDIReferenceFactory -#context.resources.jms.description=JMS Connection Factory -#context.resources.jms.brokerURL=vm://localhost?broker.persistent=false&broker.useJmx=false -#context.resources.jms.brokerName=LocalActiveMQBroker - -## Turn on JSON-formatted HTTP access logging to stdout. See issue 48565 -## https://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#JSON_Access_Log_Valve -#jsonaccesslog.enabled=true - -## Optional configuration, modeled on the non-JSON Spring Boot properties -## https://docs.spring.io/spring-boot/docs/current/reference/html/application-properties.html#application-properties.server.server.tomcat.accesslog.buffered -#jsonaccesslog.pattern=%h %t %m %U %s %b %D %S "%{Referer}i" "%{User-Agent}i" %{LABKEY.username}s -#jsonaccesslog.condition-if=attributeName -#jsonaccesslog.condition-unless=attributeName - -## Define one or both of 'csp.report' and 'csp.enforce' to enable Content Security Policy (CSP) headers -## Do not use these examples for any production environment without understanding the meaning of each directive! - -## example usage 1 - very strict, disallows 'external' websites, disallows unsafe-inline, but only reports violations (does not enforce) - -#csp.report=\ -# default-src 'self';\ -# connect-src 'self' ${LABKEY.ALLOWED.CONNECTIONS} ;\ -# object-src 'none' ;\ -# style-src 'self' 'unsafe-inline' ;\ -# img-src 'self' data: ;\ -# font-src 'self' data: ;\ -# script-src 'unsafe-eval' 'strict-dynamic' 'nonce-${REQUEST.SCRIPT.NONCE}';\ -# base-uri 'self' ;\ -# upgrade-insecure-requests ;\ -# frame-ancestors 'self' ;\ -# report-uri https://www.labkey.org/admin-contentsecuritypolicyreport.api?${CSP.REPORT.PARAMS} ; - -## example usage 2 - less strict but enforces directives, (NOTE: unsafe-inline is still required for many modules) - -#csp.enforce=\ -# default-src 'self' https: ;\ -# connect-src 'self' https: ${LABKEY.ALLOWED.CONNECTIONS};\ -# object-src 'none' ;\ -# style-src 'self' https: 'unsafe-inline' ;\ -# img-src 'self' data: ;\ -# font-src 'self' data: ;\ -# script-src 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' 'nonce-${REQUEST.SCRIPT.NONCE}';\ -# base-uri 'self' ;\ -# upgrade-insecure-requests ;\ -# frame-ancestors 'self' ;\ -# report-uri https://www.labkey.org/admin-contentsecuritypolicyreport.api?${CSP.REPORT.PARAMS} ; - - -## Enable tomcat access log -#server.tomcat.basedir=. -#server.tomcat.accesslog.enabled=true -#server.tomcat.accesslog.directory=logs -#server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %S %I "%{Referrer}i" "%{User-Agent}i" %{LABKEY.username}s diff --git a/distributionResources/manual-upgrade.sh b/distributionResources/manual-upgrade.sh deleted file mode 100755 index d563796e..00000000 --- a/distributionResources/manual-upgrade.sh +++ /dev/null @@ -1,452 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006-2018 LabKey Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################################### -# LabKey Server Upgrade Script. -# This script can be used to upgrade an installed LabKey Server instance running -# on Linux, MacOSX or Solaris. The script assumes that you have installed the LabKey Server -# following the instructions at -# https://www.labkey.org/Documentation/wiki-page.view?name=manualInstall. -# -# If you have installed the LabKey Server using the Graphical Windows Installer, please use the -# latest version of Graphical Windows Installer to upgrade the LabKey Server -# -# If you have installed the LabKey Server using the Linux Installer (install-labkey.py), please -# use the Linux Installer upgrade script, upgrade-labkey.py, to upgrade the LabKey Server -# -# It is recommended that you perform an backup of your database and files before using this -# script to upgrade your server. -# -# Important Documentation -# - Documentation for using this script: -# https://www.labkey.org/Documentation/wiki-page.view?name=manualUpgradeScript -# - Documentation for performing a manual upgrade (ie not using this script): -# https://www.labkey.org/Documentation/wiki-page.view?name=manupgrade -# - LabKey Upgrade Support Policy: -# https://www.labkey.org/Documentation/wiki-page.view?name=upgradeSupportPolicy -# -################################################################################################# - - -print_usage() -{ - echo "Usage:" - echo " manual-upgrade.sh -l dir [-d dir] [-c dir] [-u tomcatuser] [--noPrompt] [--service|--systemctl|--catalina|--tomcat_lk|--skip_tomcat]" - echo "" - echo " -l dir: LABKEY_HOME directory to be upgraded. This directory contains the " - echo " the labkeywebapp, modules, pipeline-lib, etc directories for the existing " - echo " LabKey Server instance. (Required)" - echo "" - echo " -d dir: Upgrade distribution directory: contains labkeywebapp, lib, and this script." - echo " (default: `pwd`)" - echo "" - echo " -c dir: TOMCAT_HOME; root of LabKey Apache Tomcat installation." - echo " (default: $CATALINA_HOME)" - echo "" - echo " -u owner: the tomcat user account (default: `whoami`)" - echo "" - echo " --noPrompt: do not require the user to hit enter before proceeding with the install" - echo "" - echo " (Web server startup/shutdown method: select one of the following)" - echo "" - echo " --service: use /etc/init.d/tomcat (default)" - echo "" - echo " --systemctl: use /bin/systemctl" - echo "" - echo " --catalina: use TOMCAT_HOME/bin/shutdown.sh and TOMCAT_HOME/bin/startup.sh" - echo "" - echo " --tomcat_lk: for LabKey Internal Hosted Server Installed Only" - echo "" - echo " --skip_tomcat: the script will not attempt to start/stop tomcat. You must do this manually before/after running the script." - echo "" -} - -print_error() -{ - echo "" - echo " ERROR: The upgrade did not complete successfully. See the error message" - echo " above for more information " - echo "" - exit 1 - -} - -# -# Variables -# -service="true" -systemctl="false" -catalina="false" -tomcat_lk="false" -skip_tomcat="false" -noPrompt="false" -labkey_home="" -tomcat_home=$CATALINA_HOME -labkey_binary_distro_dir=$(pwd) -tomcat_user="-" -service_script="/etc/init.d/tomcat" -DATE=$(date +%Y-%m-%d\ %H:%M) -count=0 - -# -# Parse command line arguments -# -if [ -z "$1" ] -then - print_usage - exit -fi -while [ -n "$1" ] -do - case $1 - in - -c) - if [ -z $2 ] || [ "$(echo $2 | cut -c1)" = "-" ] - then - echo "Please specify a directory with the -c option. See the Usage text below" - echo "" - print_usage - exit - fi - tomcat_home=$2; - shift 2;; - -l) - if [ -z $2 ] || [ "$(echo $2 | cut -c1)" = "-" ] - then - echo "Please specify a directory with the -l option. See the Usage text below" - echo "" - print_usage - exit - fi - labkey_home=$2; - shift 2;; - -d) - if [ -z $2 ] || [ "$(echo $2 | cut -c1)" = "-" ] - then - echo "Please specify a directory with the -d option. See the Usage text below" - echo "" - print_usage - exit - fi - labkey_binary_distro_dir=$2; - shift 2;; - -u) - if [ -z $2 ] || [ "$(echo $2 | cut -c1)" = "-" ] - then - echo "Please specify the tomcat user with the -u option. See the Usage text below" - echo "" - print_usage - exit - fi - tomcat_user=$2; - shift 2;; - --service) - service="true"; - shift;; - --systemctl) - systemctl="true"; - service="false" - shift;; - --catalina) - catalina="true"; - service="false" - shift;; - --tomcat_lk) - tomcat_lk="true"; - service="false" - shift;; - --skip_tomcat) - skip_tomcat="true"; - service="false" - shift;; - --noPrompt) - noPrompt="true"; - shift;; - *) - echo "Option [$1] not one of [c, l, d, t, u, service, catalina, noPrompt]"; - print_usage - exit;; - esac -done - - -# -# More Variables -# -# strip trailing slashes off of paths for easier path contruction later: -labkey_home=`echo $labkey_home | sed 's;/$;;'` -tomcat_home=`echo $tomcat_home | sed 's;/$;;'` -labkey_binary_distro_dir=`echo $labkey_binary_distro_dir | sed 's;/$;;'` - - -# -# validate parameters -# -echo "" -echo "" -echo "------------- Starting the Upgrade at " `date` -echo "" - -echo "Verifying installation directories and upgrade files..." - -if [ -z $labkey_home ] || [ ! -d $labkey_home ] -then - echo "" - echo "LABKEY_HOME location, $labkey_home, is either invalid or not provided. Please specify correct path on the command line." - echo "" - print_usage - exit 1 -fi - -if [ -z $labkey_binary_distro_dir ] || [ ! -d $labkey_binary_distro_dir ] || [ ! -d "$labkey_binary_distro_dir/labkeywebapp" ] -then - echo "" - echo "The LabKey distribution location, $labkey_binary_distro_dir, was either invalid or not provided. Please specify correct path on the command line." - echo "" - print_usage - exit 1 -fi - -if [ -z $tomcat_home ] || [ ! -d $tomcat_home ] -then - echo "" - echo "TOMCAT_HOME location, $tomcat_home, is either invalid or not provided." - echo "Please specify the correct path on the command line, or set the CATALINA_HOME environment variable." - echo "" - print_usage - exit 1 -fi - -CATALINA_HOME=$tomcat_home -# export CATALINA_HOME - -echo "" -echo " Installation options have been verified" - -# -# Ask the administrator to backup the database. -# - -echo "" -echo " LabKey recommends performing a database backup before moving forward with the upgrade." -echo " - See https://www.labkey.org/Documentation/wiki-page.view?name=backupScenarios " -echo " for more information on how to perform a backup of your database." -echo "" -echo " Additionally, the upgrade process will replace the current contents of your deployment's" -echo " ./modules and ./labkeyWebapp directories. If you have added your own modules or content, " -echo " please migrate to using ./externalModules before proceeding." -echo " - See https://www.labkey.org/Documentation/wiki-page.view?name=moduleUpgrades" -echo "" - -if [ "$noPrompt" = "false" ] -then - echo " Press [Enter] to start the upgrade. " - read -p " " read_variable -fi - -# -# Stop the Tomcat server -# - -echo " Stopping the LabKey/Tomcat server..." -if [ "$service" = "true" ] -then - sudo $service_script stop -elif [ "$systemctl" = "true" ] -then - sudo /bin/systemctl stop tomcat.service -elif [ "$tomcat_lk" = "true" ] -then - sudo service tomcat_lk stop -elif [ "$catalina" = "true" ] -then - $tomcat_home/bin/shutdown.sh -elif [ "$skip_tomcat" = "true" ] -then - echo "skip_tomcat=true, so tomcat will not be shutdown" -fi - -# -# Check if Tomcat has successfully shutdown -# -PID=$(ps ax | grep bootstrap.jar | grep catalina) -if [ -n "$PID" ] -then - /bin/echo -n " Waiting for the Tomcat to shutdown..." - sleep 10 - while [ ${count} -le 15 ] - do - PID=$(ps ax | grep bootstrap.jar | grep catalina) - if [ -n "$PID" ] - then - /bin/echo -n "." - sleep 2 - count=`expr $count + 1` - else - echo "" - break - fi - done -fi - -if [ "$count" = "16" ] -then - echo "" - echo " The LabKey/Tomcat server did not respond to the stop request and is " - echo " still running. The upgrade will not proceed. " - echo "" - echo " Please see the Tomcat logs, in the directory $tomcat_home/logs, " - echo " for more information." - echo "" - exit -fi - -# -# Remove LabKey installed files in LABKEY_HOME -# -echo "" -echo " Remove the currently installed LabKey binaries from the $labkey_home directory" -rm -rf $labkey_home/modules -if [ $? != 0 ]; then print_error; fi # exit if the last command failed -rm -rf $labkey_home/labkeywebapp -if [ $? != 0 ]; then print_error; fi # exit if the last command failed -if [ -x $labkey_home/pipeline-lib ]; then - rm -rf $labkey_home/pipeline-lib - if [ $? != 0 ]; then print_error; fi # exit if the last command failed -fi - -# -# Install the new version of LabKey in LABKEY_HOME -# -echo "" -echo " Install the new version of LabKey into $labkey_home directory " -cd $labkey_binary_distro_dir - -# -# As of 16.2.1 sprint build, /bin directory no longer exists in the Linux/OSX distributions, #26103 & #26210 -# -# cp -f bin/* $labkey_home/bin -# if [ $? != 0 ]; then print_error; fi # exit if the last command failed - -cp -R modules $labkey_home -if [ $? != 0 ]; then print_error; fi # exit if the last command failed -cp -R labkeywebapp $labkey_home -if [ $? != 0 ]; then print_error; fi # exit if the last command failed -if [ -x pipeline-lib ]; then - cp -R pipeline-lib $labkey_home - if [ $? != 0 ]; then print_error; fi # exit if the last command failed -fi - -# -# Remove all existing LabKey JAR files from TOMCAT_HOME/lib directory, if found -# Throws warning if the forced delete fails. -# -removeTomcatJar() -{ - jar=$1 - file=$CATALINA_HOME/lib/$jar - if [ -f $file ] - then - echo "Deleting the $file file..." - rm -f $file; - retValue=$? - if [ $retValue -ne 0 ]; then - echo "FAILED" - deleteFailed=1 - fi - fi -} - -deleteFailed=0 -removeTomcatJar 'javax.activation.jar' -removeTomcatJar 'labkeyBootstrap.jar' -removeTomcatJar 'mysql.jar' -removeTomcatJar 'jtds.jar' -removeTomcatJar 'mail.jar' -removeTomcatJar 'postgresql.jar' - -if [ $deleteFailed -eq 1 ]; then - echo "Unable to delete one or more legacy jar files from $CATALINA_HOME/lib. You will need to remove these manually in order for the server to start cleanly." -fi - -# -# Copy the LabKey jar files (libraries) to the TOMCAT_HOME directory -# -echo "" -echo " Install the LabKey jar files(libraries) into $tomcat_home/lib directory " -cp -f tomcat-lib/*.jar $CATALINA_HOME/lib -if [ $? != 0 ]; then print_error; fi # exit if the last command failed - -# -# Ensure that the user running the tomcat server owns all the files -# -echo "" -echo " Setting owner for the newly installed files" -if [ $tomcat_user != "-" ]; then - chown -R $tomcat_user $labkey_home - chown -R $tomcat_user $tomcat_home/lib -fi - -# -# Start the LabKey/Tomcat Server -# -echo "" -echo " Starting Apache Tomcat..." -if [ $service = "true" ] -then - sudo $service_script start -elif [ $systemctl = "true" ] -then - sudo /bin/systemctl start tomcat.service -elif [ $tomcat_lk = "true" ] -then - sudo service tomcat_lk start -elif [ $catalina = "true" ] -then - $tomcat_home/bin/startup.sh -elif [ "$skip_tomcat" = "true" ] -then - echo "skip_tomcat=true, so tomcat will not be restarted" -fi - -# -# Write out upgrade log. -# The upgrade log is a record of all LabKey Server -# upgrades which occur on this server. The log will collect -# the date of the upgrade, LabKey Server version and other -# important information. -# -installLog=$labkey_home/labkey_installs.txt -hostname=`hostname -f` -if [ -z "$SUDO_USER" ] -then - user=$USER -else - user=$SUDO_USER -fi -distname=`basename $labkey_binary_distro_dir` -echo $DATE, $hostname, $user, $distname >> $installLog - - -echo "" -echo " The upgrade has completed successfully " -echo "" -echo " If the LabKey server does not start properly see the log files at " -echo " - Tomcat startup log: $tomcat_home/logs/catalina.out " -echo " - LabKey specific log: $tomcat_home/logs/labkey.log " -echo "" -echo " ------------- The upgrade has completed at " `date` -echo "" diff --git a/src/main/groovy/org/labkey/gradle/plugin/Distribution.groovy b/src/main/groovy/org/labkey/gradle/plugin/Distribution.groovy index 04139648..ad8d3475 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/Distribution.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/Distribution.groovy @@ -237,7 +237,6 @@ class Distribution implements Plugin .orElse(project.name) } } - } diff --git a/src/main/groovy/org/labkey/gradle/task/ModuleDistribution.groovy b/src/main/groovy/org/labkey/gradle/task/ModuleDistribution.groovy index 16470177..82162b77 100644 --- a/src/main/groovy/org/labkey/gradle/task/ModuleDistribution.groovy +++ b/src/main/groovy/org/labkey/gradle/task/ModuleDistribution.groovy @@ -27,7 +27,6 @@ import org.gradle.api.tasks.* import org.labkey.gradle.plugin.ApplyLicenses import org.labkey.gradle.plugin.extension.DistributionExtension import org.labkey.gradle.plugin.extension.LabKeyExtension -import org.labkey.gradle.plugin.extension.StagingExtension import org.labkey.gradle.util.BuildUtils import java.nio.file.Files @@ -205,8 +204,6 @@ class ModuleDistribution extends DefaultTask private makeEmbeddedTomcatJar() { - StagingExtension staging = project.getExtensions().getByType(StagingExtension.class) - File embeddedJarFile = project.configurations.embedded.singleFile String modulesZipFile = getDistributionZipPath() File serverJarFile = new File(getEmbeddedTomcatJarPath()) @@ -271,13 +268,6 @@ class ModuleDistribution extends DefaultTask { writeDistributionFile() writeVersionFile() - FileTree zipFile = getDistributionResources(project) - project.copy({ CopySpec copy -> - copy.from(zipFile) - copy.exclude "*.xml" - copy.into(project.layout.buildDirectory) - copy.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE) - }) // Prefer files from 'server/configs/webapps' if they exist File serverConfigDir = project.rootProject.file("server/configs/webapps/") if (serverConfigDir.exists()) { @@ -308,19 +298,6 @@ class ModuleDistribution extends DefaultTask project.ant.fixcrlf (srcdir: BuildUtils.getBuildDirPath(project), includes: "manual-upgrade.sh", eol: "unix") } - static FileTree getDistributionResources(Project project) { - // This seems a very convoluted way to get to the zip file in the jar file. Using the classLoader did not - // work as expected, however. Following the example from here: - // https://discuss.gradle.org/t/gradle-plugin-copy-directory-tree-with-files-from-resources/12767/7 - FileTree jarTree = project.zipTree(ModuleDistribution.class.getProtectionDomain().getCodeSource().getLocation().toExternalForm()) - - def tree = project.zipTree( - jarTree.matching({ - include "distributionResources.zip" - }).singleFile) - return tree - } - private File getDistributionFile() { File distExtraDir = BuildUtils.getBuildDirFile(project, DistributionExtension.DIST_FILE_DIR) diff --git a/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy b/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy index f85ba29b..fd496f63 100644 --- a/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy +++ b/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy @@ -869,16 +869,6 @@ class BuildUtils return jarFiles[0] } - static File getWebappConfigFile(Project project, String fileName) - { - if (project.rootProject.file("webapps/" + fileName).exists()) - return project.rootProject.fileTree("webapps/" + fileName).singleFile - else if (project.rootProject.file("server/configs/webapps/" + fileName).exists()) - return project.rootProject.fileTree("server/configs/webapps/" + fileName).singleFile - else - return ModuleDistribution.getDistributionResources(project).matching {include fileName}.singleFile - } - static boolean embeddedProjectExists(Project project) { return project.findProject(getEmbeddedProjectPath(project.gradle)) != null From 0de53d3ab96a10a58e96379e6fed2edcb7714956 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Wed, 4 Sep 2024 14:21:20 -0700 Subject: [PATCH 06/12] Remove unused embeddedArchiveType property --- README.md | 5 +++-- .../groovy/org/labkey/gradle/task/ModuleDistribution.groovy | 5 ----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index dd46b3de..53b2a019 100644 --- a/README.md +++ b/README.md @@ -15,17 +15,18 @@ on how to do that, including how to develop and test locally and the versioning ### 4.0.0 *Released*: TBD -(Earliest compatible LabKey version: 24.8) +(Earliest compatible LabKey version: 24.10) - Add `--add-opens` JVM arg for `java.nio` to `startTomcat` task. Required for Snowflake JDBC driver. - Update `distributions` task to build embedded Tomcat tar.gz archives only - Remove support for building zip, Tomcat standalone, and module archives - - Remove `makeDistribution` property and deprecate `embeddedArchiveType` property (currently ignored) + - Remove `makeDistribution` and `embeddedArchiveType` properties - Fix `subDirName` property's optional behavior; this property now correctly defaults to `project.name`. - Change `extraFileIdentifier` property's default value to `project.name` as well - Remove support for `useEmbeddedTomcat` property and remove all standalone handling - Remove all `tomcat-lib` JAR file handling: `cleanTomcatLib`, `deployTomcatJars`, and `stageTomcatJars` tasks; `tomcatJars` configuration - Remove `labkey.xml` and `log4j2.xml` files and handling +- Remove `distributionResources` folder ### 3.0.1 *Released*: 18 July 2024 diff --git a/src/main/groovy/org/labkey/gradle/task/ModuleDistribution.groovy b/src/main/groovy/org/labkey/gradle/task/ModuleDistribution.groovy index 82162b77..c67c0a58 100644 --- a/src/main/groovy/org/labkey/gradle/task/ModuleDistribution.groovy +++ b/src/main/groovy/org/labkey/gradle/task/ModuleDistribution.groovy @@ -21,7 +21,6 @@ import org.gradle.api.GradleException import org.gradle.api.Project import org.gradle.api.file.CopySpec import org.gradle.api.file.DuplicatesStrategy -import org.gradle.api.file.FileTree import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.labkey.gradle.plugin.ApplyLicenses @@ -33,10 +32,6 @@ import java.nio.file.Files class ModuleDistribution extends DefaultTask { - // TODO: Remove this unused property - @Optional @Input - String embeddedArchiveType = null - @Optional @Input String extraFileIdentifier = null @Optional @Input From d0716eb3c27aded5cb6c76b65b713c79fc0f553b Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Thu, 5 Sep 2024 10:28:17 -0700 Subject: [PATCH 07/12] Restore project.tomcat --- .../labkey/gradle/plugin/ServerDeploy.groovy | 54 ++++++++----------- .../org/labkey/gradle/plugin/Tomcat.groovy | 13 +++++ 2 files changed, 36 insertions(+), 31 deletions(-) diff --git a/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy b/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy index 972b6b36..478d9b54 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy @@ -70,8 +70,7 @@ class ServerDeploy implements Plugin private void addTasks(Project project) { - project.tasks.register( - "deployApp", DeployApp) { + project.tasks.register("deployApp", DeployApp) { DeployApp task -> task.group = GroupNames.DEPLOY task.description = "Deploy the application locally into ${serverDeploy.dir}" @@ -121,15 +120,14 @@ class ServerDeploy implements Plugin if (!localModules.isEmpty()) { project.ant.copy( - overwrite: true, // overwrite existing files even if the destination files are newer - todir: staging.modulesDir, - preserveLastModified: true // this is important so we don't re-explode modules that have not changed + overwrite: true, // overwrite existing files even if the destination files are newer + todir: staging.modulesDir, + preserveLastModified: true // this is important so we don't re-explode modules that have not changed ) - { - localModules.addToAntBuilder(project.ant, "fileset", FileCollection.AntType.FileSet) - } + { + localModules.addToAntBuilder(project.ant, "fileset", FileCollection.AntType.FileSet) + } } - }) } project.tasks.named('stageModules').configure {dependsOn project.configurations.modules} @@ -150,10 +148,8 @@ class ServerDeploy implements Plugin }) } - project.tasks.named('stageModules').configure {dependsOn(project.tasks.checkModuleVersions)} - project.tasks.register("checkVersionConflicts") { Task task -> task.group = GroupNames.DEPLOY @@ -188,7 +184,6 @@ class ServerDeploy implements Plugin project.tasks.named('deployApp').configure {dependsOn(project.tasks.symlinkNode)} } - project.tasks.register( "stageRemotePipelineJars") { Task task -> @@ -196,20 +191,20 @@ class ServerDeploy implements Plugin task.description = "Copy files needed for using remote pipeline jobs into ${staging.pipelineLibDir}" task.doLast( { - if (!project.configurations.remotePipelineJars.getFiles().isEmpty()) { - project.ant.copy( - todir: staging.pipelineLibDir, - preserveLastModified: true - ) - { - project.configurations.remotePipelineJars { Configuration collection -> - collection.addToAntBuilder(project.ant, "fileset", FileCollection.AntType.FileSet) - - } - } + if (!project.configurations.remotePipelineJars.getFiles().isEmpty()) { + project.ant.copy( + todir: staging.pipelineLibDir, + preserveLastModified: true + ) + { + project.configurations.remotePipelineJars { Configuration collection -> + collection.addToAntBuilder(project.ant, "fileset", FileCollection.AntType.FileSet) + } } - ) + } + } + ) } project.tasks.named('stageRemotePipelineJars').configure {dependsOn project.configurations.remotePipelineJars} @@ -349,10 +344,10 @@ class ServerDeploy implements Plugin }) if (projectsMissingTasks.length > 0) project.logger.quiet("Each of the following projects has a 'module.properties' file but no 'module' task. " + - "These modules will not be included in the deployed server. " + - "You should apply either the 'org.labkey.build.fileModule' or 'org.labkey.build.module' plugin in each project's 'build.gradle' file. " + - "See https://www.labkey.org/Documentation/wiki-page.view?name=gradleModules for more information.\n\t" + - "${projectsMissingTasks.join("\n\t")}") + "These modules will not be included in the deployed server. " + + "You should apply either the 'org.labkey.build.fileModule' or 'org.labkey.build.module' plugin in each project's 'build.gradle' file. " + + "See https://www.labkey.org/Documentation/wiki-page.view?name=gradleModules for more information.\n\t" + + "${projectsMissingTasks.join("\n\t")}") }) task.notCompatibleWithConfigurationCache("Needs to walk the project tree") @@ -402,6 +397,3 @@ class ServerDeploy implements Plugin } } } - - - diff --git a/src/main/groovy/org/labkey/gradle/plugin/Tomcat.groovy b/src/main/groovy/org/labkey/gradle/plugin/Tomcat.groovy index b59d6267..f3eea330 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/Tomcat.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/Tomcat.groovy @@ -21,6 +21,8 @@ import org.gradle.api.Project import org.gradle.api.file.DeleteSpec import org.gradle.api.tasks.Delete import org.labkey.gradle.plugin.extension.ServerDeployExtension +import org.labkey.gradle.plugin.extension.TomcatExtension +import org.labkey.gradle.plugin.extension.UiTestExtension import org.labkey.gradle.task.StartTomcat import org.labkey.gradle.task.StopTomcat import org.labkey.gradle.util.GroupNames @@ -35,6 +37,17 @@ class Tomcat implements Plugin @Override void apply(Project project) { + TomcatExtension tomcat = project.extensions.findByType(TomcatExtension.class) + if (tomcat == null) + { + tomcat = project.extensions.create("tomcat", TomcatExtension, project) + } + if (project.plugins.hasPlugin(TestRunner.class)) + { + UiTestExtension testEx = (UiTestExtension) project.getExtensions().getByType(UiTestExtension.class) + tomcat.assertionFlag = Boolean.valueOf((String) testEx.getTestConfig("disableAssertions")) ? "-da" : "-ea" + } + tomcat.catalinaOpts = "-Dproject.root=${project.rootProject.projectDir.absolutePath}" addTasks(project) } From dff9a5f2134643e8771f842776900d37528a8aca Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Thu, 5 Sep 2024 10:51:10 -0700 Subject: [PATCH 08/12] Restore stopTomcat --- .../labkey/gradle/plugin/ServerDeploy.groovy | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy b/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy index 478d9b54..c5ab1001 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/ServerDeploy.groovy @@ -132,7 +132,6 @@ class ServerDeploy implements Plugin } project.tasks.named('stageModules').configure {dependsOn project.configurations.modules} - project.tasks.register("checkModuleVersions", CheckForVersionConflicts) { CheckForVersionConflicts task -> task.directory = new File(serverDeploy.modulesDir) @@ -184,27 +183,25 @@ class ServerDeploy implements Plugin project.tasks.named('deployApp').configure {dependsOn(project.tasks.symlinkNode)} } - project.tasks.register( - "stageRemotePipelineJars") { + project.tasks.register("stageRemotePipelineJars") { Task task -> task.group = GroupNames.DEPLOY task.description = "Copy files needed for using remote pipeline jobs into ${staging.pipelineLibDir}" - task.doLast( - { + task.doLast({ if (!project.configurations.remotePipelineJars.getFiles().isEmpty()) { project.ant.copy( todir: staging.pipelineLibDir, preserveLastModified: true ) { - project.configurations.remotePipelineJars { Configuration collection -> - collection.addToAntBuilder(project.ant, "fileset", FileCollection.AntType.FileSet) - + project.configurations.remotePipelineJars + { + Configuration collection -> + collection.addToAntBuilder(project.ant, "fileset", FileCollection.AntType.FileSet) } } } - } - ) + }) } project.tasks.named('stageRemotePipelineJars').configure {dependsOn project.configurations.remotePipelineJars} @@ -354,6 +351,12 @@ class ServerDeploy implements Plugin } project.tasks.named('deployApp').configure {dependsOn(project.tasks.named("checkModuleTasks"))} project.tasks.named('checkModuleTasks').configure {mustRunAfter(project.tasks.stageApp)} // do this so the message appears at the bottom of the output + project.tasks.named("cleanBuild").configure { + it.dependsOn(project.tasks.stopTomcat) + } + project.tasks.named("cleanDeploy").configure { + it.dependsOn(project.tasks.stopTomcat) + } } private static linkBinaries(Project project, String packageMgr, String version, workDirectory) { From 1e1dc2c5ae65295119976dffa83667429cefdb80 Mon Sep 17 00:00:00 2001 From: Trey Chadick Date: Thu, 5 Sep 2024 11:11:18 -0700 Subject: [PATCH 09/12] Remove references to 'tomcat.home' and 'CATALINA_HOME' (#217) --- .../org/labkey/gradle/plugin/TeamCity.groovy | 6 +-- .../labkey/gradle/plugin/TestRunner.groovy | 34 -------------- .../plugin/extension/TomcatExtension.groovy | 46 ------------------- .../org/labkey/gradle/task/DoThenSetup.groovy | 25 ---------- .../labkey/gradle/task/RunTestSuite.groovy | 22 +-------- .../org/labkey/gradle/util/BuildUtils.groovy | 8 +--- 6 files changed, 4 insertions(+), 137 deletions(-) diff --git a/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy b/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy index 451d9ec8..b3537136 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy @@ -66,11 +66,7 @@ class TeamCity extends Tomcat // from TeamCity's configuration when creating the UITestExtension on TeamCity super.apply(project) project.tomcat.assertionFlag = "-ea" - String truststoreFile = "${project.tomcat.catalinaHome}/localhost.truststore" - if (!project.file(truststoreFile).exists()) - { - truststoreFile = "${System.getProperty("user.home")}/localhost.truststore" - } + truststoreFile = "${System.getProperty("user.home")}/localhost.truststore" if (project.file(truststoreFile).exists()) { project.tomcat.trustStore = "-Djavax.net.ssl.trustStore=${truststoreFile}" diff --git a/src/main/groovy/org/labkey/gradle/plugin/TestRunner.groovy b/src/main/groovy/org/labkey/gradle/plugin/TestRunner.groovy index 4e5b7a9e..61b9821c 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/TestRunner.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/TestRunner.groovy @@ -17,8 +17,6 @@ package org.labkey.gradle.plugin import org.gradle.api.Project import org.gradle.api.Task -import org.gradle.api.tasks.TaskProvider -import org.gradle.api.tasks.bundling.Zip import org.labkey.gradle.plugin.extension.TeamCityExtension import org.labkey.gradle.task.RunTestSuite import org.labkey.gradle.util.BuildUtils @@ -35,8 +33,6 @@ class TestRunner extends UiTest addDataFileTasks(project) - addExtensionsTasks(project) - addTestSuiteTask(project) addAspectJ(project) @@ -164,36 +160,6 @@ class TestRunner extends UiTest } } - private static void addExtensionsTasks(Project project) - { - File extensionsDir = project.file("chromeextensions") - if (extensionsDir.exists()) - { - List extensionsZipTasks = new ArrayList<>() - extensionsDir.eachDir({ - File dir -> - - String extensionTaskName = "package" + dir.getName().capitalize() - project.tasks.register(extensionTaskName, Zip) { - Zip task -> - task.description = "Package the ${dir.getName()} chrome extension used for testing" - task.archiveBaseName.set(dir.getName()) - task.archiveExtension.set("zip") - task.from dir - task.destinationDirectory.set(project.layout.buildDirectory.dir("chromextensions")) - } - - extensionsZipTasks.add(project.tasks.named(extensionTaskName)) - }) - project.tasks.register("packageChromeExtensions") { - Task task -> - task.description = "Package all chrome extensions used for testing" - task.dependsOn (extensionsZipTasks) - } - - } - } - private void addTestSuiteTask(Project project) { project.logger.debug("TestRunner: addTestSuiteTask for ${project.path}") diff --git a/src/main/groovy/org/labkey/gradle/plugin/extension/TomcatExtension.groovy b/src/main/groovy/org/labkey/gradle/plugin/extension/TomcatExtension.groovy index c4c2714f..c68398af 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/extension/TomcatExtension.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/extension/TomcatExtension.groovy @@ -21,8 +21,6 @@ class TomcatExtension { private final Project project - String catalinaHome - String tomcatConfDir String assertionFlag = "-ea" // set to -da to disable assertions and -ea to enable assertions String maxMemory = "2G" boolean disableRecompileJsp = false @@ -35,49 +33,5 @@ class TomcatExtension TomcatExtension(Project project) { this.project = project - setCatalinaDirs(project) - } - - String getCatalinaHome() - { - return catalinaHome - } - - String getTomcatConfDir() - { - return tomcatConfDir - } - - private void setCatalinaDirs(Project project) - { - if (System.getenv("CATALINA_HOME") != null) - { - this.catalinaHome = System.getenv("CATALINA_HOME") - } - else if (project.hasProperty("tomcatDir")) - { - this.catalinaHome = project.tomcatDir - } - else if (project.ext.hasProperty("tomcatDir")) - { - this.catalinaHome = project.ext.tomcatDir - } - else - { - this.catalinaHome = TeamCityExtension.getTeamCityProperty(project, "tomcat.home", null) - } - - if (project.ext.hasProperty("tomcatConfDir")) - { - this.tomcatConfDir = project.ext.tomcatConfDir - } - else if (this.catalinaHome != null) - { - this.tomcatConfDir = "${this.catalinaHome}/conf/Catalina/localhost" - } - else - { - this.tomcatConfDir = null - } } } diff --git a/src/main/groovy/org/labkey/gradle/task/DoThenSetup.groovy b/src/main/groovy/org/labkey/gradle/task/DoThenSetup.groovy index d3a4003a..59a8ce45 100644 --- a/src/main/groovy/org/labkey/gradle/task/DoThenSetup.groovy +++ b/src/main/groovy/org/labkey/gradle/task/DoThenSetup.groovy @@ -16,7 +16,6 @@ package org.labkey.gradle.task import org.gradle.api.DefaultTask -import org.gradle.api.GradleException import org.gradle.api.Project import org.gradle.api.file.CopySpec import org.gradle.api.file.DuplicatesStrategy @@ -141,30 +140,6 @@ class DoThenSetup extends DefaultTask return extraJdbcProperties } - - // labkeyXml is up to date if it was created after the current config file was created - // and it has the current appDocBase - boolean labkeyXmlUpToDate(String appDocBase) - { - if (this.dbPropertiesChanged) - return false - - File dbPropFile = DatabaseProperties.getPickedConfigFile(project) - File tomcatLabkeyXml = new File("${project.tomcat.tomcatConfDir}", "labkey.xml") - if (!dbPropFile.exists() || !tomcatLabkeyXml.exists()) - return false - if (dbPropFile.lastModified() < tomcatLabkeyXml.lastModified()) - { - // make sure we haven't switch contexts - for (String line: tomcatLabkeyXml.readLines()) - { - if (line.contains("docBase=\"" + appDocBase + "\"")) - return true - } - } - return false - } - boolean embeddedConfigUpToDate() { if (this.dbPropertiesChanged) diff --git a/src/main/groovy/org/labkey/gradle/task/RunTestSuite.groovy b/src/main/groovy/org/labkey/gradle/task/RunTestSuite.groovy index fe81a79e..9d259663 100644 --- a/src/main/groovy/org/labkey/gradle/task/RunTestSuite.groovy +++ b/src/main/groovy/org/labkey/gradle/task/RunTestSuite.groovy @@ -16,13 +16,10 @@ package org.labkey.gradle.task import org.apache.commons.lang3.StringUtils -import org.gradle.api.file.CopySpec -import org.gradle.api.file.DuplicatesStrategy import org.gradle.api.tasks.Internal import org.labkey.gradle.plugin.TeamCity import org.labkey.gradle.plugin.extension.TeamCityExtension import org.labkey.gradle.util.DatabaseProperties -import org.labkey.gradle.util.TaskUtils /** * Class that sets our test/Runner.class as the junit test suite and configures a bunch of system properties for @@ -44,26 +41,10 @@ abstract class RunTestSuite extends RunUiTest dependsOn(project.tasks.writeSampleDataFile) dependsOn(project.tasks.ensurePassword) - if (project.findProject(":tools:Rpackages:install") != null) - dependsOn(project.project(':tools:Rpackages:install')) - if (!project.getPlugins().hasPlugin(TeamCity.class)) { - TaskUtils.addOptionalTaskDependency(project, this, 'packageChromeExtensions') - } if (project.getPlugins().hasPlugin(TeamCity.class)) { dependsOn(project.tasks.killChrome) - dependsOn(project.tasks.ensurePassword) - - if (project.tomcat.catalinaHome != null) - { - doLast( { - project.copy({ CopySpec copy -> - copy.from "${project.tomcat.catalinaHome}/logs" - copy.into project.layout.buildDirectory.file("logs/test/tomcat") - copy.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE) - }) - }) - } + dependsOn(project.tasks.killFirefox) } } @@ -80,7 +61,6 @@ abstract class RunTestSuite extends RunUiTest systemProperty "testRecentlyFailed", "${runRiskGroupTestsFirst.contains("recentlyFailed")}" } systemProperty "teamcity.buildType.id", project.teamcity['teamcity.buildType.id'] - systemProperty "tomcat.home", System.getenv("CATALINA_HOME") systemProperty "tomcat.port", project.teamcity["tomcat.port"] systemProperty "tomcat.debug", project.teamcity["tomcat.debug"] systemProperty "labkey.port", project.teamcity['tomcat.port'] diff --git a/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy b/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy index fd496f63..93f2cf82 100644 --- a/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy +++ b/src/main/groovy/org/labkey/gradle/util/BuildUtils.groovy @@ -30,7 +30,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.ModuleDistribution import java.nio.charset.StandardCharsets import java.nio.file.Files @@ -546,7 +545,7 @@ class BuildUtils 'tomcat-jsp-api', 'tomcat-util', 'tomcat-websocket-api', - 'tomcat7-websocket' + 'tomcat-websocket' ] static String getGitUrl(Project project) @@ -569,10 +568,7 @@ class BuildUtils static void addTomcatBuildDependencies(Project project, String configuration) { - List tomcatLibs = new ArrayList<>(TOMCAT_LIBS) // Don't modify list - if (!"${project.apacheTomcatVersion}".startsWith("7.")) - tomcatLibs.replaceAll({it.replace('tomcat7-', 'tomcat-')}) - for (String lib : tomcatLibs) + for (String lib : TOMCAT_LIBS) project.dependencies.add(configuration, "org.apache.tomcat:${lib}:${project.apacheTomcatVersion}") } From fe956042ec709125a30e2f54e0cb21d8b0f6935b Mon Sep 17 00:00:00 2001 From: labkey-tchad Date: Thu, 5 Sep 2024 13:11:43 -0700 Subject: [PATCH 10/12] Add missing variable declaration --- src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy b/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy index b3537136..ad916dd3 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/TeamCity.groovy @@ -66,7 +66,7 @@ class TeamCity extends Tomcat // from TeamCity's configuration when creating the UITestExtension on TeamCity super.apply(project) project.tomcat.assertionFlag = "-ea" - truststoreFile = "${System.getProperty("user.home")}/localhost.truststore" + String truststoreFile = "${System.getProperty("user.home")}/localhost.truststore" if (project.file(truststoreFile).exists()) { project.tomcat.trustStore = "-Djavax.net.ssl.trustStore=${truststoreFile}" From 4258c98177e83b558cf091163df63903d89215cd Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Thu, 5 Sep 2024 13:47:43 -0700 Subject: [PATCH 11/12] Gradle 8.10 --- gradle/wrapper/gradle-wrapper.jar | Bin 43453 -> 43504 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 5 ++++- gradlew.bat | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e6441136f3d4ba8a0da8d277868979cfbc8ad796..2c3521197d7c4586c843d1d3e9090525f1898cde 100644 GIT binary patch delta 8703 zcmYLtRag{&)-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lygfmUyojkE=PnV)zc)7%^5BxpjkU+>ol2}WpB2hlDP(hVA;uLdu`=M_A!%RaRTd6>Mi_ozLYOEh!dfT_h0dSsnQm1bk)%K45)xLw zql&fx?ZOMBLXtUd$PRlqpo2CxNQTBb=!T|_>p&k1F})Hq&xksq>o#4b+KSs2KyxPQ z#{(qj@)9r6u2O~IqHG76@Fb~BZ4Wz_J$p_NU9-b3V$$kzjN24*sdw5spXetOuU1SR z{v}b92c>^PmvPs>BK2Ylp6&1>tnPsBA0jg0RQ{({-?^SBBm>=W>tS?_h^6%Scc)8L zgsKjSU@@6kSFX%_3%Qe{i7Z9Wg7~fM_)v?ExpM@htI{G6Db5ak(B4~4kRghRp_7zr z#Pco0_(bD$IS6l2j>%Iv^Hc)M`n-vIu;-2T+6nhW0JZxZ|NfDEh;ZnAe d|9e8rKfIInFTYPwOD9TMuEcqhmizAn{|ERF)u#Xe diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 09523c0e..9355b415 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.9-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index b740cf13..f5feea6d 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 25da30db..9d21a218 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## From ad37ed31af0113c0428716a245539580c35dbb9f Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Thu, 5 Sep 2024 16:51:40 -0700 Subject: [PATCH 12/12] Prepare for v4.1.0 --- README.md | 8 ++++++-- build.gradle | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 53b2a019..03a54b58 100644 --- a/README.md +++ b/README.md @@ -13,15 +13,19 @@ on how to do that, including how to develop and test locally and the versioning ## Release Notes -### 4.0.0 +### TBD *Released*: TBD (Earliest compatible LabKey version: 24.10) + +### 4.0.0 +*Released*: 5 September 2024 +(Earliest compatible LabKey version: 24.10) - Add `--add-opens` JVM arg for `java.nio` to `startTomcat` task. Required for Snowflake JDBC driver. - Update `distributions` task to build embedded Tomcat tar.gz archives only - Remove support for building zip, Tomcat standalone, and module archives - Remove `makeDistribution` and `embeddedArchiveType` properties - Fix `subDirName` property's optional behavior; this property now correctly defaults to `project.name`. - - Change `extraFileIdentifier` property's default value to `project.name` as well + - Change `extraFileIdentifier` property's default value to `-project.name` - Remove support for `useEmbeddedTomcat` property and remove all standalone handling - Remove all `tomcat-lib` JAR file handling: `cleanTomcatLib`, `deployTomcatJars`, and `stageTomcatJars` tasks; `tomcatJars` configuration diff --git a/build.gradle b/build.gradle index 09a75c9d..b57f60ff 100644 --- a/build.gradle +++ b/build.gradle @@ -42,7 +42,7 @@ dependencies { } group 'org.labkey.build' -project.version = "3.1.0-fb_useEmbedded-SNAPSHOT" +project.version = "4.1.0-SNAPSHOT" gradlePlugin { plugins {