diff --git a/README.md b/README.md index 8c7fff03..829342fd 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,18 @@ on how to do that, including how to develop and test locally and the versioning ## Release Notes -### 6.1.0-SNAPSHOT +### 6.2.0-SNAPSHOT *Released*: TBD -(Earliest compatible LabKey version: 24.11) +(Earliest compatible LabKey version: 25.2) + +### 6.1.0 +*Released*: 10 January, 2025 +(Earliest compatible LabKey version: 25.2) - Module template: first script is now incremental, use three-digit version numbers, stop creating SQL Server scripts - Module template: update test files to avoid IDE warnings +- `module.properties`: change `ManageVersion` default value to `false` (to [exclude externally developed modules from + old schema version checks at upgrade time](https://www.labkey.org/home/Developer/issues/Secure/issues-details.view?issueId=47369)), + set to `true` in module template, and throw if old, unsupported properties are detected. - Update dependency versions ### 6.0.0 diff --git a/build.gradle b/build.gradle index d0cd1f4b..b0ca5afb 100644 --- a/build.gradle +++ b/build.gradle @@ -42,7 +42,7 @@ dependencies { } group = 'org.labkey.build' -project.version = "6.1.0-SNAPSHOT" +project.version = "6.2.0-SNAPSHOT" gradlePlugin { plugins { diff --git a/moduleTemplate/module.properties b/moduleTemplate/module.properties index 0168b62b..b586057f 100644 --- a/moduleTemplate/module.properties +++ b/moduleTemplate/module.properties @@ -5,3 +5,4 @@ Description: FIXME! Write a paragraph describing the functionality and the \ URL: http://example.com/FIXME License: Apache 2.0 LicenseURL: http://www.apache.org/licenses/LICENSE-2.0 +ManageVersion: true diff --git a/src/main/groovy/org/labkey/gradle/plugin/FileModule.groovy b/src/main/groovy/org/labkey/gradle/plugin/FileModule.groovy index 17d6e70e..61584ba8 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/FileModule.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/FileModule.groovy @@ -36,11 +36,8 @@ import org.labkey.gradle.task.ModuleXmlFile import org.labkey.gradle.util.BuildUtils import org.labkey.gradle.util.GroupNames import org.labkey.gradle.util.PomFileHelper -import org.labkey.gradle.util.PropertiesUtils import org.labkey.gradle.util.TaskUtils -import java.util.regex.Matcher - /** * This class is used for building a LabKey file-based module, which contains only client-side code. * It also serves as a base class for the Java module classes. @@ -133,7 +130,7 @@ class FileModule implements Plugin Dependency dep -> moduleDependencies += dep.getName() } if (!moduleDependencies.isEmpty()) - project.lkModule.setPropertyValue(ModuleExtension.MODULE_DEPENDENCIES_PROPERTY, moduleDependencies.join(", ")) + project.lkModule.setPropertyValue("ModuleDependencies", moduleDependencies.join(", ")) task.getModuleProperties().set(project.lkModule.getModProperties()) if (project.file("build.gradle").exists()) task.inputs.file(project.file("build.gradle")) diff --git a/src/main/groovy/org/labkey/gradle/plugin/MultiGit.groovy b/src/main/groovy/org/labkey/gradle/plugin/MultiGit.groovy index d4bb84e2..f4f18021 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/MultiGit.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/MultiGit.groovy @@ -183,23 +183,14 @@ class MultiGit implements Plugin private Boolean isPrivate = false private Boolean isExternal = false private Boolean isArchived = false - private Boolean isSvn = false private Type type = Type.other private Project project private File enlistmentDir private Project rootProject private Properties moduleProperties - private String dependencies private String supportedDatabases = "mssql,pgsql" private List pullRequests - Repository(Project rootProject, String name, Boolean isSvn) - { - this.name = name - this.isSvn = isSvn - setProject(rootProject) - } - Repository(Project rootProject, String name, String url, Boolean isPrivate, Boolean isArchived, List topics) { this.rootProject = rootProject @@ -234,7 +225,6 @@ class MultiGit implements Plugin setProject(rootProject) } - String getName() { return name @@ -315,26 +305,6 @@ class MultiGit implements Plugin this.isArchived = isArchived } - Boolean getIsSvn() - { - return isSvn - } - - void setIsSvn(Boolean isSvn) - { - this.isSvn = isSvn - } - - String getDependencies() - { - return dependencies - } - - void setDependencies(String dependencies) - { - this.dependencies = dependencies - } - String getSupportedDatabases() { return supportedDatabases @@ -464,8 +434,6 @@ class MultiGit implements Plugin this.setLicenseURL((String) this.moduleProperties.get("LicenseURL")) if (this.moduleProperties.containsKey("Description") && !StringUtils.isEmpty(((String) this.moduleProperties.get("Description")).trim())) this.setDescription((String) this.moduleProperties.get("Description")) - if (this.moduleProperties.containsKey(ModuleExtension.MODULE_DEPENDENCIES_PROPERTY)) - this.setDependencies((String) this.moduleProperties.get(ModuleExtension.MODULE_DEPENDENCIES_PROPERTY)) if (this.moduleProperties.containsKey("SupportedDatabases")) this.setSupportedDatabases((String) this.moduleProperties.get("SupportedDatabases")) } @@ -566,8 +534,6 @@ class MultiGit implements Plugin if (this.getLicenseURL() != null) builder.append(" (${this.getLicenseURL()})") builder.append("\n") - if (this.dependencies != null) - builder.append("\tModule Dependencies: ${this.getDependencies()}\n") builder.append("\tRepoURL: ${this.getUrl()}\n") builder.append("\tSupported Databases: ${this.supportedDatabases}\n") List prs = this.getPullRequests() @@ -1328,14 +1294,6 @@ class MultiGit implements Plugin { enlist(repositories, (Repository) repositories.get(name), enlisted, branch) } - else - { - Repository svnRepo = new Repository(project, name, true) - if (svnRepo.getEnlistmentDir().exists()) - project.logger.quiet("Already have svn enlistment for ${svnRepo.getName()} in ${svnRepo.getEnlistmentDir()}") - else - project.logger.warn("WARNING: No repository found for dependency '${svnRepo.getProjectPath()}'.") - } } }) } diff --git a/src/main/groovy/org/labkey/gradle/plugin/extension/ModuleExtension.groovy b/src/main/groovy/org/labkey/gradle/plugin/extension/ModuleExtension.groovy index d421ef7f..a844750f 100644 --- a/src/main/groovy/org/labkey/gradle/plugin/extension/ModuleExtension.groovy +++ b/src/main/groovy/org/labkey/gradle/plugin/extension/ModuleExtension.groovy @@ -27,7 +27,6 @@ class ModuleExtension { private static final String ENLISTMENT_PROPERTIES = "enlistment.properties" public static final String MODULE_PROPERTIES_FILE = "module.properties" - public static final String MODULE_DEPENDENCIES_PROPERTY = "ModuleDependencies" private Map modProperties = new HashMap<>() private Project project private Map externalDependencies = new HashMap<>() @@ -57,7 +56,6 @@ class ModuleExtension { String value = modProperties.get(propertyName) return value == null ? defaultValue : value - } String getPropertyValue(String propertyName) @@ -81,25 +79,32 @@ class ModuleExtension if (propertiesFile.exists()) { Properties props = new Properties() PropertiesUtils.readProperties(propertiesFile, props) + this.modProperties.putAll(props) if (logDeprecations) { List deprecationMsgs = [] - if (this.modProperties.get(MODULE_DEPENDENCIES_PROPERTY)) - deprecationMsgs += "The '" + MODULE_DEPENDENCIES_PROPERTY + "' property is no longer supported as of gradlePlugin version 1.25.0 (LabKey Server version 21.3.0)." + - " Declare the dependency in the module's build.gradle file instead using the 'modules' configuration." + - " See https://www.labkey.org/Documentation/wiki-page.view?name=gradleDepend for more information." - - if (this.modProperties.get("ConsolidateScripts")) - deprecationMsgs += "The 'ConsolidateScripts' property is no longer supported." - if (this.modProperties.get("Version")) - deprecationMsgs += "The 'Version' property is no longer supported." +// Follow this pattern to deprecate a property in module.properties + // Remove check for OldProperty in mmm, yyyy (one year after deprecation) +// if (this.modProperties.get("OldProperty")) +// deprecationMsgs += "The OldProperty property is no longer supported." if (!deprecationMsgs.isEmpty()) project.logger.quiet("${propertiesFile.absolutePath}: Deprecated or unsupported properties detected.\n\t" - + deprecationMsgs.join("\n\t") - + "\nRefer to https://www.labkey.org/Documentation/wiki-page.view?name=includeModulePropertiesFile for the current set of supported properties.") + + deprecationMsgs.join("\n\t") + + "\nRefer to https://www.labkey.org/Documentation/wiki-page.view?name=includeModulePropertiesFile for the current set of supported properties.") } - if (this.modProperties.get(MODULE_DEPENDENCIES_PROPERTY)) - this.modProperties.remove(MODULE_DEPENDENCIES_PROPERTY) + + List unsupportedMsgs = [] + // Remove checks for ModuleDependencies, ConsolidateScripts, and Version properties in Jan, 2026 (one year after designated as unsupported) + if (this.modProperties.get("ModuleDependencies")) + unsupportedMsgs += "The 'ModuleDependencies' property is no longer supported." + if (this.modProperties.get("ConsolidateScripts")) + unsupportedMsgs += "The 'ConsolidateScripts' property is no longer supported." + if (this.modProperties.get("Version")) + unsupportedMsgs += "The 'Version' property is no longer supported." + if (!unsupportedMsgs.isEmpty()) + throw new GradleException("${propertiesFile.absolutePath}: Unsupported properties detected.\n\t" + + unsupportedMsgs.join("\n\t") + + "\nRefer to https://www.labkey.org/Documentation/wiki-page.view?name=includeModulePropertiesFile for the current set of supported properties.") } else project.logger.info("${project.path} - no ${MODULE_PROPERTIES_FILE} found") @@ -146,14 +151,11 @@ class ModuleExtension modProperties.put("ReleaseVersion", (String) project.getProperty("labkeyVersion")) if (modProperties.get("ManageVersion") == null) { - modProperties.put("ManageVersion", "true") + modProperties.put("ManageVersion", "false") // Issue #47369 } if (modProperties.get("SchemaVersion") == null) { - if (modProperties.get("Version") == null) - modProperties.put("SchemaVersion", "") // Spring binds this as setSchemaVersion(null), which is what we want - else - modProperties.put("SchemaVersion", modProperties.get("Version")) // For backward compatibility with old modules TODO: Remove + modProperties.put("SchemaVersion", "") // Spring binds this as setSchemaVersion(null), which is what we want } }