Reputation: 900
I want to add the path of a directory which contains the multiple scripts for windows and linux in my build.gradle script. Currently i am defining the task like this and its working fine.
task initdb(type: Exec){
if (System.getProperty('os.name').toLowerCase().contains('windows')) {
commandLine 'cmd', '/c', 'My_CONF\\pgdb\\initdb.cmd'
} else {
commandLine 'My_CONF/pgdb/initdb.sh'
}
}
But I want to define this task as-
task initdb(type: Exec){
if (System.getProperty('os.name').toLowerCase().contains('windows')) {
commandLine 'cmd', '/c', 'initdb.cmd'
} else {
commandLine 'initdb.sh'
}
}
These scripts also uses the another scripts which is in My_CONF\pgdb directory.
Upvotes: 3
Views: 1474