I'm trying to run two different tasks, one for a staging environment and the other for production. These tasks have dependency on the architecture where it is being ran, because they use Native Libraries. Is it possible to run the task with an argument so I can point the proper native library for the run?
task stagingRun(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'project.JavaApp'
systemProperty "java.library.path", "libs/NORDIC/NativeLibraries/NatLinux64"
systemProperty 'SILVERBACK_URL', 'https://myback.com/api/'
systemProperty 'DATABASE_PATH', 'jdbc:h2:file:./data/backUp;AUTO_RECONNECT=TRUE'
systemProperty 'BACKUP_PATH', "main/data/backup.json"
}
task deployRun(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'project.JavaApp'
systemProperty "java.library.path", "libs/NORDIC/NativeLibraries/NatWin64"
systemProperty 'SILVERBACK_URL', 'https://myback.production.com/api/'
systemProperty 'DATABASE_PATH', 'jdbc:h2:file:/data/backUp;AUTO_RECONNECT=TRUE'
systemProperty 'BACKUP_PATH', "/data/backup.json"
}