Skip to content

Commit a4dc817

Browse files
authored
Merge pull request #774 from marklogic/feature/deprecations
MLE-23304 Removed deprecated items
2 parents 4f01d96 + 0b2be23 commit a4dc817

File tree

8 files changed

+17
-64
lines changed

8 files changed

+17
-64
lines changed

examples/properties-project/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ This project shows a basic setup of the [Gradle properties plugin](https://githu
22
The plugin allows you to define a properties file for each environment that you need to deploy to. These properties
33
override whatever is in gradle.properties.
44

5-
The "environmentName" property is used to specify a properties file. If that property is not specified, then
6-
"gradle-local.properties" is used by default. That file is almost always ignored by version control, which is the case
5+
The `environmentName` property is used to specify a properties file. If that property is not specified, then
6+
`gradle-local.properties` is used by default. That file is almost always ignored by version control, which is the case
77
in this sample project - the file is listed in .gitignore.
88

9-
The sample property files in this project only override "mlHost", but of course you can get as creative as you want. A
10-
more extreme example would be to override the "mlConfigDir" property to specify a different configuration directory for
9+
The sample property files in this project only override `mlHost`, but of course you can get as creative as you want. A
10+
more extreme example would be to override the `mlConfigPaths` property to specify a different configuration directory for
1111
each environment.
1212

examples/redaction-ruleset-project/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
This project shows an example of how MarkLogic 9 Redaction Rulesets can be loaded into a schemas
22
database from src/main/ml-schemas (the default path - this can be overridden via
3-
mlSchemasPath).
3+
`mlSchemaPaths`).
44

55
Note that in order for this to work, the content-database.json file must specify the schema
66
database that it's associated with. And in most cases, you'll want your own schemas database - not the default Schemas one - so schemas-database.json can be used to create own with a name based on mlAppName.

examples/schemas-project/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
This project shows an example of how MarkLogic 9 schemas can be loaded into a schemas
2-
database from src/main/ml-schemas (the default path - this can be overridden via
3-
mlSchemasPath).
1+
This project shows an example of how MarkLogic schemas can be loaded into a schemas
2+
database from src/main/ml-schemas (the default path - this can be overridden via `mlSchemaPaths`).
43

54
Note that in order for this to work, the content-database.json file must specify the schema
6-
database that it's associated with. And in most cases, you'll want your own schemas database - not the default Schemas one - so schemas-database.json can be used to create own with a name based on mlAppName.
5+
database that it's associated with. And in most cases, you'll want your own schemas database - not the default
6+
Schemas one - so schemas-database.json can be used to create a database with a name based on `mlAppName`.

ml-app-deployer/src/main/java/com/marklogic/appdeployer/DefaultAppConfigFactory.java

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,6 @@ public void initialize() {
8888
}
8989
});
9090

91-
propertyConsumerMap.put("mlOptimizeWithCma", (config, prop) -> {
92-
logger.info("mlOptimizeWithCma is DEPRECATED; please use a property specific to the resource that you want to deploy with CMA");
93-
// mlOptimizeWithCma was deprecated in 3.11; it was only used for deploying forests, so if the
94-
// property is still used, the client in theory expects forests to still be deployed with CMA
95-
config.getCmaConfig().setDeployForests(true);
96-
});
97-
9891
propertyConsumerMap.put("mlCombineCmaRequests", (config, prop) -> {
9992
logger.info("Combine requests" + cmaMessage + prop);
10093
config.getCmaConfig().setCombineRequests(Boolean.parseBoolean(prop));
@@ -161,31 +154,18 @@ public void initialize() {
161154

162155
/**
163156
* The path to the directory containing all the resource configuration files. Defaults to src/main/ml-config.
164-
* mlConfigPath is the preferred one, as its name is consistent with other properties that refer to a path.
165-
* mlConfigDir is deprecated but still supported.
166157
*
167-
* As of 3.3.0, mlConfigPaths is the preferred property, and mlConfigDir and mlConfigPath will be ignored if
168-
* it's set.
158+
* As of 3.3.0, mlConfigPaths is the preferred property, and mlConfigPath will be ignored if it's set.
169159
*/
170160
propertyConsumerMap.put("mlConfigPaths", (config, prop) -> {
171-
logger.info("Config paths: " + prop);
161+
logger.info("Config paths: {}", prop);
172162
List<ConfigDir> list = new ArrayList<>();
173163
for (String path : prop.split(",")) {
174164
list.add(buildConfigDir(path));
175165
}
176166
config.setConfigDirs(list);
177167
});
178168

179-
// TODO Only process if mlConfigPaths not set?
180-
propertyConsumerMap.put("mlConfigDir", (config, prop) -> {
181-
logger.info("mlConfigDir is deprecated; please use mlConfigPath; Config dir: " + prop);
182-
config.setConfigDir(buildConfigDir(prop));
183-
});
184-
propertyConsumerMap.put("mlConfigPath", (config, prop) -> {
185-
logger.info("Config path: " + prop);
186-
config.setConfigDir(buildConfigDir(prop));
187-
});
188-
189169
/**
190170
* Defines the MarkLogic host that requests should be sent to. Defaults to localhost.
191171
*/
@@ -571,12 +551,6 @@ public void initialize() {
571551
config.setTestContentDatabaseName(prop);
572552
});
573553

574-
// Deprecated - use mlSchemaPaths instead
575-
propertyConsumerMap.put("mlSchemasPath", (config, prop) -> {
576-
logger.info("mlSchemasPath is deprecated as of version 3.13.0; please use mlSchemaPaths instead; schemas path: " + prop);
577-
config.setSchemaPaths(buildPathListFromCommaDelimitedString(prop));
578-
});
579-
580554
propertyConsumerMap.put("mlSchemaPaths", (config, prop) -> {
581555
logger.info("Schema paths: " + prop);
582556
config.setSchemaPaths(buildPathListFromCommaDelimitedString(prop));

ml-app-deployer/src/test/java/com/marklogic/appdeployer/DefaultAppConfigFactoryTest.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void withProjectDir() {
4141
factory = new DefaultAppConfigFactory(new SimplePropertySource(
4242
"mlConfigPaths", "path1,path2",
4343
"mlModulePaths", "modulesPath1,modulesPath2",
44-
"mlSchemasPath", "schemasPath"));
44+
"mlSchemaPaths", "schemasPath"));
4545

4646
final String testPath = new File("").getAbsolutePath();
4747

@@ -564,19 +564,6 @@ public void mostProperties() {
564564
assertTrue(config.isCascadePermissions());
565565
}
566566

567-
/**
568-
* Verifies that mlConfigDir is still supported, though mlConfigPath is preferred.
569-
*/
570-
@Test
571-
public void mlConfigDir() {
572-
Properties p = new Properties();
573-
p.setProperty("mlConfigDir", "src/test/resources/sample-app/empty-ml-config");
574-
575-
factory = new DefaultAppConfigFactory(new SimplePropertySource(p));
576-
AppConfig config = factory.newAppConfig();
577-
assertTrue(config.getFirstConfigDir().getBaseDir().getAbsolutePath().contains("empty-ml-config"));
578-
}
579-
580567
@Test
581568
public void mlUsernameAndPassword() {
582569
AppConfig config = configure("mlUsername", "customuser", "mlPassword", "custompassword");

ml-gradle/src/main/groovy/com/marklogic/gradle/MarkLogicPlugin.groovy

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ class MarkLogicPlugin implements Plugin<Project> {
9898
copyGradlePropertiesToCustomTokensIfRequested(project)
9999

100100
project.getConfigurations().create("mlBundle")
101-
// Per #420, this is deprecated, but still need to create it
102-
project.getConfigurations().create("mlRestApi")
103101

104102
// No group or description on these so they don't show up in "gradle tasks"
105103
project.task("mlDeployApp", type: DeployAppTask, dependsOn: ["mlDeleteModuleTimestampsFile"])
@@ -188,7 +186,6 @@ class MarkLogicPlugin implements Plugin<Project> {
188186
project.task("mlCreateTransform", type: CreateTransformTask, group: devGroup, description: "Create a new transform in the modules transforms directory; use -PtransformName and -PtransformType to set the transform name and type (xqy, xsl, or sjs)")
189187
project.task("mlExportResources", type: ExportResourcesTask, group: devGroup, description: "Export resources based on a properties file specified via -PpropertiesFile, -Pprefix, or -Pregex; use -PincludeTypes to select resource types to export via a comma-delimited string; use -PexportPath to specify where to export resources to")
190188
project.task("mlPrepareBundles", type: PrepareBundlesTask, group: devGroup, dependsOn: project.configurations["mlBundle"], description: "Downloads (if necessary) and unzips in the build directory all mlBundle dependencies")
191-
project.task("mlPrepareRestApiDependencies", type: PrepareBundlesTask, group: devGroup, dependsOn: project.configurations["mlBundle"], description: "Deprecated in 3.13.0; please use mlPrepareBundles instead")
192189
project.task("mlPrintCommands", type: PrintCommandsTask, group: devGroup, description: "Print information about each command used by mlDeploy and mlUndeploy")
193190
project.task("mlPrintProperties", type: PrintPropertiesTask, group: devGroup, description: "Print all of the properties supported by ml-gradle")
194191
project.task("mlPrintTokens", type: PrintTokensTask, group: devGroup, description: "Print the customTokens map on the mlAppConfig object (typically for debugging purposes)")
@@ -220,10 +217,10 @@ class MarkLogicPlugin implements Plugin<Project> {
220217
project.task("mlEnableAllFlexrepTargets", type: EnableAllFlexrepTargetsTask, group: flexrepGroup, description: "Enable every target on every flexrep config")
221218

222219
String forestGroup = "ml-gradle Forest"
223-
project.task("mlConfigureForestReplicas", type: ConfigureForestReplicasTask, group: forestGroup, description: "Deprecated - configure forest replicas via the command.forestNamesAndReplicaCounts map")
224-
project.task("mlDeleteForestReplicas", type: DeleteForestReplicasTask, group: forestGroup, description: "Deprecated - delete forest replicas via the command.forestNamesAndReplicaCounts map; requires -Pconfirm=true to be set so this isn't accidentally executed")
220+
project.task("mlConfigureForestReplicas", type: ConfigureForestReplicasTask, group: forestGroup, description: "Configures forest replicas based on ml-gradle properties")
221+
project.task("mlDeleteForestReplicas", type: DeleteForestReplicasTask, group: forestGroup, description: "Deletes forest replicas based on ml-gradle properties; requires -Pconfirm=true to be set so this isn't accidentally executed")
225222
project.task("mlDeployCustomForests", type: DeployCustomForestsTask, group: forestGroup, description: "Deploy custom forests as defined in subdirectories of the forests configuration directory")
226-
project.task("mlDeployForestReplicas", type: DeployForestReplicasTask, group: forestGroup, description: "Prefer this over mlConfigureForestReplicas; it does the same thing, but uses the ConfigureForestReplicasCommand that is used by mlDeploy")
223+
project.task("mlDeployForestReplicas", type: DeployForestReplicasTask, group: forestGroup, description: "Alias for mlConfigureForestReplicas for naming consistency")
227224
project.task("mlPrintForestPlan", type: PrintForestPlanTask, group: forestGroup, description: "Print a list of primary forests to be created for a database specified by -Pdatabase=(name of database) when the database is next deployed. " +
228225
"This is only intended to be used when forests are created dynamically via properties.")
229226

ml-gradle/src/main/groovy/com/marklogic/gradle/task/client/AbstractModuleCreationTask.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class AbstractModuleCreationTask extends MarkLogicTask{
99

1010
/**
1111
* Select the first modules path that is a valid location for creating a new module. Intent is to filter out
12-
* paths containing "mlRestApi" or "mlBundle" as those almost certainly point to directories where bundles have been
12+
* paths containing "mlBundle" as those almost certainly point to directories where bundles have been
1313
* unzipped to, and we don't want to create new modules in those directories.
1414
*
1515
* @return
@@ -18,7 +18,7 @@ class AbstractModuleCreationTask extends MarkLogicTask{
1818
String path
1919
List<String> modulePaths = getAppConfig().getModulePaths()
2020
for (String modulePath : modulePaths) {
21-
if (modulePath != null && !modulePath.contains("mlRestApi") && !modulePath.contains("mlBundle")) {
21+
if (modulePath != null && !modulePath.contains("mlBundle")) {
2222
path = modulePath
2323
break
2424
}

ml-gradle/src/main/groovy/com/marklogic/gradle/task/client/PrepareBundlesTask.groovy

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class PrepareBundlesTask extends MarkLogicTask {
1919

2020
@TaskAction
2121
void prepareBundles() {
22-
prepareBundlesForConfiguration("mlRestApi")
2322
prepareBundlesForConfiguration("mlBundle")
2423
}
2524

@@ -30,10 +29,6 @@ class PrepareBundlesTask extends MarkLogicTask {
3029

3130
getLogger().info("Found " + configurationName + " configuration, will extract all of its dependencies to build/" + configurationName)
3231

33-
if ("mlRestApi".equals(configurationName)) {
34-
println "\nWARNING: mlRestApi is deprecated as of release 3.13.0, please use mlBundle instead, which is a drop-in replacement.\n"
35-
}
36-
3732
def buildDir = new File(getProject().getProjectDir(), "build")
3833
buildDir.mkdirs()
3934
def bundleDir = new File(buildDir, configurationName)

0 commit comments

Comments
 (0)