Skip to content

Conversation

@divino
Copy link
Contributor

@divino divino commented Jun 27, 2017

Please note that instead of the "-Ppath=/path/to/roxy/project", I used
"-PmlRoxyHome=/your/roxy/project/home" following the convention of RoxyCopyPropertiesTask.

divino added 3 commits June 28, 2017 00:48
Accept a "-Ppath=/path/to/roxy/project" command-line property to specify where the Roxy project is located
Copy the contents of $path/src to ./src/main/ml-modules/root
Copy the contents of $path/rest-api/config to ./src/main/ml-modules/options
Copy the contents of $path/rest-api/ext to ./src/main/ml-modules/services
Copy the contents of $path/rest-api/transforms to ./src/main/ml-modules/transforms
Make a backup copy of gradle.properties if it exists - e.g. gradle.properties.backup. See NewProjectTask for an example of doing this.
Log each of the items above via println in the Gradle task so that the user has a nice record of everything that the task did.
Copy link
Contributor

@rjrudin rjrudin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, just needs a few tweaks.


String roxyGroup = "ml-gradle Roxy";
project.task("mlRoxyCopyProperties", type: RoxyCopyPropertiesTask, group: roxyGroup, description: "Copy Roxy properties to gradle.properties file")
project.task("mlCopyRoxyFiles", type: CopyRoxyFilesTask, group: roxyGroup, description: "Copy roxy files")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@divino For consistency, can you name this "mlRoxyCopyFiles" and "RoxyCopyFilesTask"? I'd like to have all of the Roxy-related tasks start with "mlRoxy".


class CopyRoxyFilesTask extends MarkLogicTask {

def roxyFolderMapping = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MarkLogicTask has a getAppConfig method, which returns an AppConfig object. This has a "List getModulePaths" method, which returns a list of all the paths to modules that the developer has configured. Normally there is only one, and normally the path is the default - i.e. "src/main/ml-modules". But to avoid any potential issues, this mapping should call getModulePaths and use the first string that's returned.

The mapping here can still be hardcoded, but the "src/main/ml-modules" should be removed from each entry. And then when the mapping is used, the first string from getModulePaths can be prepended to the mapped value.


@TaskAction
void copyRoxyFiles() {
backupProperties()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be part of the "else", so that backup files aren't made unless the user provided valid input.

}
}

void backupProperties() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you can remove this, because you're not making any modifications to gradle.properties.

@divino
Copy link
Contributor Author

divino commented Jul 5, 2017

implemented review points. kindly review

@rjrudin rjrudin merged commit a374367 into marklogic:dev Jul 11, 2017
@rjrudin
Copy link
Contributor

rjrudin commented Jul 11, 2017

Looks good, thanks!

@rjrudin rjrudin added this to the 2.9.0 milestone Jul 11, 2017
rjrudin added a commit that referenced this pull request Jul 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants