apply plugin: 'java'
// LEONIND - Using ext block to make the map globally accessible to all tasks
ext {
cpls_instances_apac = [
global_refdata : [
asset : 'cash',
region : 'APAC',
country : 'HNK',
env : 'dev',
instance : 'global_refdata_cpls',
appName : 'GLOBAL.HNK.GLOBAL.REFDATA.CPLS',
temp : 'global_refdata_cpls',
debugPort : 8890
],
cash_cpls_mys_sales : [
asset : 'cash',
region : 'APAC',
country : 'MYS',
env : 'dev',
instance : 'cash_cpls_mys_sales',
appName : 'GLOBAL.MYS.COMET.CPLS.CASH_CPLS.SALES',
temp : 'cash_cpls_mys_sales',
debugPort: 8890
],
cash_cpls_jpn_trdr1 : [
asset : 'cash',
region : 'APAC',
country : 'JPN',
env : 'dev',
instance : 'cash_cpls_jpn_trdr1',
appName : 'GLOBAL.JPN.COMET.CPLS.CASH_CPLS.TRDR',
temp : 'cash_cpls_jpn_trdr1',
debugPort: 8890
],
deriv_cpls_jpn_prop1 : [
asset : 'derivatives',
region : 'APAC',
country : 'JPN',
env : 'dev',
instance : 'deriv_cpls_jpn_prop1',
appName : 'GLOBAL.JPN.COMET.CPLS.DERIV_PROP_CPLS1',
temp : 'deriv_cpls_jpn_prop1',
debugPort: 8890
],
cash_cpls_sls1 : [
app : 'CPLS',
asset : 'cash',
region : 'US',
env : 'dev',
instance : 'cash_cpls_sls1',
appName : 'GLOBAL.NA.US.COMET.CPLS.CPLS_CASH.CASH_CPLS_INSTANCE1',
temp : 'cash_cpls_sls1',
debugPort: 9797
],
emea_local_dev_cpls : [
app : 'CPLS',
asset : 'multi',
region : 'EMEA',
env : 'dev',
instance : 'emea_cpls_sls102',
appName : 'GLOBAL.COMET.EMEA.CASHSLS.CPLS',
temp : 'emea_cpls_sls102',
topic_instance : 'local_dev_100',
instance_id : 201110100,
isDevLocal : true,
debugPort : 8741
],
cash_position_1_qa : [
app : 'CPLS',
asset : 'cash',
region : 'US',
env : 'qa',
instance : 'cash_position_1',
appName : 'GLOBAL.US.COMET.POSITION.POSITIONINSTANCE1',
temp : 'cash_position_1',
isDevLocal : false,
debugPort : 9798
],
cash_position_1_dev : [
app : 'CPLS',
asset : 'cash',
region : 'US',
env : 'dev',
instance : 'cash_position_1',
appName : 'GLOBAL.US.COMET.POSITION.POSITIONINSTANCE1',
temp : 'cash_position_1',
isDevLocal : true,
debugPort : 9799
]
]
}
String javaHome = System.getenv('JAVA_HOME')
if(!javaHome) throw new GradleException("JAVA_HOME not set.")
def toolsJarFile = new File(javaHome + "/lib/tools.jar")
task prepareLibDir(type: Copy) {
from configurations.sharedlib
into 'lib'
}
// Line 49 fix: Accessing via project.cpls_instances_apac
project.cpls_instances_apac.each { task_name, instance_options ->
tasks.register(task_name, JavaExec) {
dependsOn prepareLibDir, classes
// Scope variables locally inside task to prevent "mixing up"
def asset = instance_options.asset
def region = instance_options.region
def country = instance_options.country
def env = instance_options.env
def instanceName = instance_options.instance
def appName = instance_options.appName
def tempDir = instance_options.temp
def isDevLocal = instance_options.isDevLocal?.toString()?.toBoolean() ?: false
def countryPath = country ? "${country}/" : ""
def instanceClasspath = [
file("src/main/config/quantum/$asset/$region/${countryPath}$env"),
file("src/main/config/quantum/$asset/$region/${country ?: ''}"),
file("src/main/config/quantum/$asset/$region/${countryPath}$env/$instanceName"),
file("src/main/config/dds/$asset/$region/${countryPath}$env/$instanceName"),
file('src/main/config'),
toolsJarFile
]
def cfgFileName = 'CFG.' + appName + '.xml'
def cplsConfigFile = file("src/main/config/quantum/$asset/$region/${countryPath}$env/cplsConfig.xml")
def cplsFile = file("src/main/config/dds/$asset/$region/${countryPath}$env/$instanceName/$cfgFileName")
def cplsDir = file("src/main/config/quantum/$asset/$region/${countryPath}$env/$instanceName")
def loggingConfig = file("src/main/config/quantum/$asset/$region/${countryPath}$env/logging.properties.txt")
def aleConfig = file("src/main/config/quantum/$asset/$region/${countryPath}$env/alefcg")
def securityFile = file("src/main/config/resources/security.dat")
doFirst {
logger.info "task: " + task_name + " started execution"
// OS-specific temp dir
if (System.properties.'os.name'.toLowerCase().contains("linux")){
System.properties.'java.io.tmpdir' = '/opt/lgohome'
} else {
System.properties.'java.io.tmpdir' = 'C:/temp'
}
['dds','log','store'].each { dir ->
new File("${System.properties.'java.io.tmpdir'}/$tempDir/$dir").mkdirs()
}
jvmArgs = [
"-Xms26", "-Xmx46", "-Xss256k",
"-Djava.library.path=" + file('lib').absolutePath,
"-Dcom.citigroup.project.config.filename=$cplsConfigFile",
"-Dapplication=${instance_options.app ?: 'CPLS_ASIA'}",
"-Dinstance=$instanceName",
"-Ddds.tmpdir=${System.properties.'java.io.tmpdir'}/$tempDir/dds/",
"-Dcpls.path.store.dir=${System.properties.'java.io.tmpdir'}/$tempDir/store/",
"-Djava.io.tmpdir=${System.properties.'java.io.tmpdir'}/$tempDir/log/",
"-Dcom.citi.get.etsf.config.DDsConfigurationImpl.local.file=" + cplsFile,
"-Dcpls.path.asset.region=$asset/$region/${countryPath}$env",
"-Dcpls.path.springqas.dir=$cplsDir",
"-Dregion=$region${country ? "/$country" : ""}",
"-Djava.util.logging.config.file=$loggingConfig",
"-DALE_CONFIGFILE=$aleConfig",
"-DALE_SECURITYFILE=$securityFile",
"-Dcom.citi.get.etsf.appName=$appName"
]
if (isDevLocal) jvmArgs += "-Ddev_local=true"
}
classpath = files(instanceClasspath) + (sourceSets.main.runtimeClasspath)
// Original print layout
classpath.each { cp -> println 'classpath: ' + cp }
main = 'com.citi.DebugLauncher'
args 'file://' + file("src/main/config/quantum/$asset/$region/${countryPath}$env").absolutePath, instanceName, 'dummy'
workingDir file('src/main/config')
standardInput = System.in
}
}
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)