-
Notifications
You must be signed in to change notification settings - Fork 80
Issue 194 #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 194 #210
Conversation
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.
rjrudin
left a comment
There was a problem hiding this 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") |
There was a problem hiding this comment.
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 = [ |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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.
|
implemented review points. kindly review |
|
Looks good, thanks! |
Please note that instead of the "-Ppath=/path/to/roxy/project", I used
"-PmlRoxyHome=/your/roxy/project/home" following the convention of RoxyCopyPropertiesTask.