Skip to content
Permalink
Browse files

Improved: Do not pass debug mode to ‘createOfbizCommandTask’

The ‘isDebugMode’ argument of the ‘createofbizcommandtask’ method was
only set to ‘true’ inside the “ofbizDebug” rule-based task.  Given the
exceptionality of the case, this argument has been replaced with an
ad-hoc override of the ‘debug’ value after the fact.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1855796 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Mar 18, 2019
1 parent 004785d commit 61e92926761f13c65f0db3e7b3e2074805fb9c28
Showing with 8 additions and 11 deletions.
  1. +8 −11 build.gradle
@@ -361,8 +361,7 @@ task terminateOfbiz(group: ofbizServer,
task loadAdminUserLogin(group: ofbizServer) {
description 'Create admin user with temporary password equal to ofbiz. You must provide userLoginId'
createOfbizCommandTask('executeLoadAdminUser',
['--load-data', 'file=/runtime/tmp/AdminUserLoginData.xml'],
false)
['--load-data', 'file=/runtime/tmp/AdminUserLoginData.xml'])
executeLoadAdminUser.doFirst {
copy {
from ("${rootDir}/framework/resources/templates/AdminUserLoginData.xml") {
@@ -379,7 +378,7 @@ task loadAdminUserLogin(group: ofbizServer) {

task loadTenant(group: ofbizServer, description: 'Load data using tenantId') {

createOfbizCommandTask('executeLoadTenant', [], false)
createOfbizCommandTask('executeLoadTenant', [])

if (project.hasProperty('tenantId')) {
executeLoadTenant.args '--load-data', "delegator=default#${tenantId}"
@@ -452,16 +451,15 @@ task createTenant(group: ofbizServer, description: 'Create a new tenant in your
// Load the tenants master database
createOfbizCommandTask('loadTenantOnMasterTenantDb',
['--load-data', 'file=/runtime/tmp/tmpFilteredTenantData.xml',
'--load-data', 'readers=tenant'],
false)
'--load-data', 'readers=tenant'])
loadTenantOnMasterTenantDb.dependsOn(generateDatabaseTemplateFile, generateAdminUserTemplateFile)

// Load the actual tenant data
createOfbizCommandTask('loadTenantData', [], false)
createOfbizCommandTask('loadTenantData', [])
loadTenantData.dependsOn(loadTenantOnMasterTenantDb)

// Load the tenant admin user account
createOfbizCommandTask('loadTenantAdminUserLogin', [], false)
createOfbizCommandTask('loadTenantAdminUserLogin', [])
loadTenantAdminUserLogin.dependsOn(loadTenantData)

/* pass arguments to tasks, must be done this way
@@ -959,14 +957,14 @@ task cleanAll(group: cleanupGroup, dependsOn: [cleanTasks, clean]) {
tasks.addRule('Pattern: ofbiz <Commands>: Execute OFBiz startup commands') { String taskName ->
if (taskName ==~ /^ofbiz\s.*/ || taskName == 'ofbiz') {
def arguments = (taskName - 'ofbiz').tokenize(' ')
createOfbizCommandTask(taskName, arguments, false)
createOfbizCommandTask(taskName, arguments)
}
}

tasks.addRule('Pattern: ofbizDebug <Commands>: Execute OFBiz startup commands in remote debug mode') { String taskName ->
if (taskName ==~ /^ofbizDebug\s.*/ || taskName == 'ofbizDebug') {
def arguments = (taskName - 'ofbizDebug').tokenize(' ')
createOfbizCommandTask(taskName, arguments, true)
createOfbizCommandTask(taskName, arguments).with { debug = true }
}
}

@@ -980,13 +978,12 @@ tasks.addRule('Pattern: ofbizBackground <Commands>: Execute OFBiz startup comman
* Helper Functions
* ======================================================== */

def createOfbizCommandTask(taskName, arguments, isDebugMode) {
def createOfbizCommandTask(taskName, arguments) {

def ofbizJarName = buildDir.toString()+'/libs/'+project.name+'.jar'

task(type: JavaExec, dependsOn: build, taskName) {
jvmArgs(jvmArguments)
debug = isDebugMode
classpath = files(ofbizJarName)
main = ofbizMainClass
args arguments

0 comments on commit 61e9292

Please sign in to comment.
You can’t perform that action at this time.