Yep, that's done like this:
project(':whatever') {
apply plugin: 'application'
mainClassName = 'some.Main'
repositories { mavenCentral() }
dependencies {
// substitute needed version of aspectj
runtime "org.aspectj:aspectjweaver:$aspectj"
}
applicationDefaultJvmArgs = [
"-javaagent:\$APP_HOME/lib/aspectjweaver-${aspectj}.jar"
]
// $ symbol gets escaped in script anyway:( so we need to replace it.
startScripts {
doLast {
unixScript.text = unixScript.text.replace('\\$APP_HOME', '\$APP_HOME')
// do something like this for Windows scripts also
}
}
}