Skip to content

Commit

Permalink
Improved: Provide multi-arguments to the ‘Exec#args’ method
Browse files Browse the repository at this point in the history
Previously only one argument at a time was passed to the ‘Exec#args’
method.  Since it is possible to pass multiple arguments we can remove
some syntax redudancy.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1855678 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Mar 17, 2019
1 parent 2b77397 commit 8c4836b
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions build.gradle
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -383,16 +383,13 @@ task loadTenant(group: ofbizServer, description: 'Load data using tenantId') {
createOfbizCommandTask('executeLoadTenant', [], jvmArguments, false) createOfbizCommandTask('executeLoadTenant', [], jvmArguments, false)


if (project.hasProperty('tenantId')) { if (project.hasProperty('tenantId')) {
executeLoadTenant.args '--load-data' executeLoadTenant.args '--load-data', "delegator=default#${tenantId}"
executeLoadTenant.args "delegator=default#${tenantId}"
} }
if (project.hasProperty('tenantReaders')) { if (project.hasProperty('tenantReaders')) {
executeLoadTenant.args '--load-data' executeLoadTenant.args '--load-data', "readers=${tenantReaders}"
executeLoadTenant.args "readers=${tenantReaders}"
} }
if (project.hasProperty('tenantComponent')) { if (project.hasProperty('tenantComponent')) {
executeLoadTenant.args '--load-data' executeLoadTenant.args '--load-data', "component=${tenantComponent}"
executeLoadTenant.args "component=${tenantComponent}"
} }


executeLoadTenant.doFirst { executeLoadTenant.doFirst {
Expand Down Expand Up @@ -472,17 +469,14 @@ task createTenant(group: ofbizServer, description: 'Create a new tenant in your
* because we are in the configuration phase. We cannot * because we are in the configuration phase. We cannot
* set the parameters at the execution phase. */ * set the parameters at the execution phase. */
if (project.hasProperty('tenantId')) { if (project.hasProperty('tenantId')) {
loadTenantData.args '--load-data' loadTenantData.args '--load-data', "delegator=default#${tenantId}"
loadTenantData.args "delegator=default#${tenantId}" loadTenantAdminUserLogin.args(

'--load-data', "delegator=default#${tenantId}",
loadTenantAdminUserLogin.args '--load-data' '--load-data', "file=${rootDir}/runtime/tmp/tmpFilteredUserLogin.xml"
loadTenantAdminUserLogin.args "delegator=default#${tenantId}" )
loadTenantAdminUserLogin.args '--load-data'
loadTenantAdminUserLogin.args "file=${rootDir}/runtime/tmp/tmpFilteredUserLogin.xml"
} }
if (project.hasProperty('tenantReaders')) { if (project.hasProperty('tenantReaders')) {
loadTenantData.args '--load-data' loadTenantData.args '--load-data', "readers=${tenantReaders}"
loadTenantData.args "readers=${tenantReaders}"
} }


dependsOn(loadTenantAdminUserLogin) dependsOn(loadTenantAdminUserLogin)
Expand Down Expand Up @@ -996,9 +990,7 @@ def createOfbizCommandTask(taskName, arguments, jvmArguments, isDebugMode) {
debug = isDebugMode debug = isDebugMode
classpath = files(ofbizJarName) classpath = files(ofbizJarName)
main = ofbizMainClass main = ofbizMainClass
arguments.each { argument -> args arguments
args argument
}


if (taskName ==~ /^ofbiz.*--test.*/ if (taskName ==~ /^ofbiz.*--test.*/
|| taskName ==~ /^ofbiz.*-t.*/) { || taskName ==~ /^ofbiz.*-t.*/) {
Expand Down

0 comments on commit 8c4836b

Please sign in to comment.