Skip to content

Commit ff5263a

Browse files
author
ssambasu
committed
Fixing generatePiiCommand command
1 parent 62c9319 commit ff5263a

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

ml-data-hub-plugin/src/main/groovy/com/marklogic/gradle/DataHubPlugin.groovy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import com.marklogic.appdeployer.command.Command
2222
import com.marklogic.appdeployer.impl.SimpleAppDeployer
2323
import com.marklogic.gradle.task.*
2424
import com.marklogic.hub.ApplicationConfig
25+
import com.marklogic.hub.deploy.commands.GeneratePiiCommand
2526
import com.marklogic.hub.deploy.commands.LoadHubModulesCommand
2627
import com.marklogic.hub.deploy.commands.LoadUserModulesCommand
2728
import com.marklogic.hub.impl.*
@@ -45,6 +46,7 @@ class DataHubPlugin implements Plugin<Project> {
4546
private MappingManagerImpl mappingManager
4647
private FlowManagerImpl flowManager
4748
private EntityManagerImpl entityManager
49+
private GeneratePiiCommand generatePiiCommand
4850

4951
Logger logger = LoggerFactory.getLogger(getClass())
5052

@@ -155,6 +157,7 @@ class DataHubPlugin implements Plugin<Project> {
155157
mappingManager = ctx.getBean(MappingManagerImpl.class)
156158
flowManager = ctx.getBean(FlowManagerImpl.class)
157159
entityManager = ctx.getBean(EntityManagerImpl.class)
160+
generatePiiCommand = ctx.getBean(GeneratePiiCommand.class)
158161

159162
initializeProjectExtensions(project)
160163
}
@@ -201,6 +204,7 @@ class DataHubPlugin implements Plugin<Project> {
201204
project.extensions.add("mappingManager", mappingManager)
202205
project.extensions.add("flowManager", flowManager)
203206
project.extensions.add("entityManager", entityManager)
207+
project.extensions.add("generatePiiCommand", generatePiiCommand)
204208

205209
configureAppDeployer(project)
206210
}

ml-data-hub-plugin/src/main/groovy/com/marklogic/gradle/task/GeneratePiiTask.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class GeneratePiiTask extends HubTask {
2424

2525
@TaskAction
2626
void generatePii() {
27-
def cmd = new GeneratePiiCommand(getHubConfig())
27+
def cmd = getGeneratePiiCommand()
2828
cmd.execute(getCommandContext())
2929
}
3030

ml-data-hub-plugin/src/main/groovy/com/marklogic/gradle/task/HubTask.groovy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.ObjectMapper
2222
import com.marklogic.appdeployer.command.CommandContext
2323
import com.marklogic.client.DatabaseClient
2424
import com.marklogic.hub.*
25+
import com.marklogic.hub.deploy.commands.GeneratePiiCommand
2526
import com.marklogic.hub.deploy.commands.LoadHubModulesCommand
2627
import com.marklogic.hub.deploy.commands.LoadUserModulesCommand
2728
import com.marklogic.hub.job.JobManager
@@ -70,6 +71,11 @@ abstract class HubTask extends DefaultTask {
7071
EntityManager getEntityManager() {
7172
getProject().property("entityManager")
7273
}
74+
75+
@Internal
76+
GeneratePiiCommand getGeneratePiiCommand() {
77+
getProject().property("generatePiiCommand")
78+
}
7379

7480
@Internal
7581
Tracing getTracing() {

0 commit comments

Comments
 (0)