You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This plugin seems to set the javaagent path specifically for the ApplicationPlugin's task, not any/all CreateStartScripts type tasks. It might be useful to add the same injection of the javaagent to the ShadowApplicationPlugin.SHADOW_SCRIPTS_TASK_NAME task so it can be used in conjunction with shadow.
Working around this by basically recreating what the plugin does:
Edit: the workaround is a bit more complicated as the script generated using the above isn't usable...instead I'm manually mapping the javaagent files to jvm opts and working around gradle/gradle#19795 with a pattern/replace. It's a bit ugly...
tasks.named<CreateStartScripts>(ShadowApplicationPlugin.SHADOW_SCRIPTS_TASK_NAME) {
defaultJvmOpts = configurations.javaagent.get().files.map { jar ->"-javaagent:\$\\{APP_HOME\\}/agent-libs/${jar.name}"
}.plus(defaultJvmArgs)
// FIXME - Replace env var template in `DEFAULT_JVM_OPTS`// Workaround for https://github.com/gradle/gradle/issues/19795
doLast {
val envVarRegex ="\\\\\\$\\\\\\\\\\{(\\w+)\\\\\\\\\\}".toRegex()
val startScript = outputs.files.single().listFiles { file -> file.name == rootProject.name }!!.single()
val contents = startScript.readLines().joinToString("\n") { line ->if (line.startsWith("DEFAULT_JVM_OPTS")) line.replace(envVarRegex, "\\$$1") else line
}
startScript.writeText(contents)
}
}
The text was updated successfully, but these errors were encountered:
Today I learned about shadowDist! I always thought the point of the shadow plugin was to just ship a shadow jar. This seems quite reasonable and within the scope of this plugin to add support for, but I don't envision myself getting to it anytime soon
The Gradle shadow plugin has the ability to create an equivalent distribution but using the shadowed dependencies: https://imperceptiblethoughts.com/shadow/application-plugin/#distributing-the-shadow-jar
This plugin seems to set the javaagent path specifically for the ApplicationPlugin's task, not any/all
CreateStartScripts
type tasks. It might be useful to add the same injection of the javaagent to theShadowApplicationPlugin.SHADOW_SCRIPTS_TASK_NAME
task so it can be used in conjunction with shadow.Working around this by basically recreating what the plugin does:
Edit: the workaround is a bit more complicated as the script generated using the above isn't usable...instead I'm manually mapping the javaagent files to jvm opts and working around gradle/gradle#19795 with a pattern/replace. It's a bit ugly...
The text was updated successfully, but these errors were encountered: