[GRADLE-2207] Allow application plugin start scripts to be more flexible for different environments. Created: 02/Apr/12 Updated: 02/Apr/15 Resolved: 02/Apr/15 |
|
| Status: | Resolved |
| Project: | Gradle |
| Affects Version/s: | None |
| Fix Version/s: | 2.4-rc-1 |
| Type: | Improvement | ||
| Reporter: | Gradle Forums | Assignee: | Benjamin Muschko |
| Resolution: | Fixed | Votes: | 5 |
| Description |
|
See linked forum topic, and pull request https://github.com/gradle/gradle/pull/77 |
| Comments |
| Comment by Gradle Forums [ 02/Apr/12 ] |
|
I haven't found I nice way myself, but something like this met my needs at the time: startScripts << { } |
| Comment by Gradle Forums [ 02/Apr/12 ] |
|
Andrew is right, there is no direct way to do this right now. I tend to use: startScripts { doLast { def optsEnvVar = "DEFAULT_JVM_OPTS" unixScript.text = unixScript.text.replace("$optsEnvVar= startScripts { jvmOpts = "-Xmx1024m" inputs.property("jvmOpts", { jvmOpts } ) // for incremental build to work properly doLast { doLast { def optsEnvVar = "DEFAULT_JVM_OPTS" unixScript.text = unixScript.text.replace("$optsEnvVar=\"\"", "$optsEnvVar=\"$jvmOpts\"") windowsScript.text = windowsScript.text.replace("set $optsEnvVar=", "set $optsEnvVar=$jvmOpts") } } quot;", "$optsEnvVar= startScripts { jvmOpts = "-Xmx1024m" inputs.property("jvmOpts", { jvmOpts } ) // for incremental build to work properly doLast { ) // for incremental build to work properly doLast { |
| Comment by Gradle Forums [ 02/Apr/12 ] |
|
Thanks for ideas Andrew and Luke! How would you guys feel about doing something like I mentioned similar to Tomcat? For example in `unixStartScript.txt` around line 68, include this: CLASSPATH=$classpath if [ -r "setenv.sh" ]; then |
| Comment by Gradle Forums [ 02/Apr/12 ] |
|
I like the idea personally. |
| Comment by Gradle Forums [ 02/Apr/12 ] |
|
Luke, I created a pull request to update the templates: [1]https://github.com/gradle/gradle/pull/77 Please take a look when you have a chance. Thanks. |