add read jvmargs from ~/.gradle/gradle.properties. #1416
add read jvmargs from ~/.gradle/gradle.properties. #1416one-leaf wants to merge 4 commits intoapache:masterfrom one-leaf:master
Conversation
…org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=256m
lkishalmi
left a comment
There was a problem hiding this comment.
Also a JIRA issue please.
Also make sure that this is actually required and the gradle launcher daes not take care of this one (as it probably should)
Also use the proper chain of property file reading.
| String userHomeDir = System.getProperty("user.home"); | ||
| File gradlePropertiesFile = Paths.get(userHomeDir, ".gradle", "gradle.properties").toFile(); | ||
| if (gradlePropertiesFile.exists()){ | ||
| Properties pps = new Properties(); |
There was a problem hiding this comment.
Probably you would put this as a private method, as actually the priority of the jvm arg resolve is project gradle.properties, root project gradle.properties, then gradle user home gradle. propertties.
Also for the grade user home, please use the GradleSettings.getGradleUserHome()
| if (gradlePropertiesFile.exists()){ | ||
| Properties pps = new Properties(); | ||
| InputStream in = null; | ||
| try { |
| in = new BufferedInputStream(new FileInputStream(gradlePropertiesFile)); | ||
| pps.load(in); | ||
| if (pps.containsKey("org.gradle.jvmargs")){ | ||
| String jvmargs_value = pps.getProperty("org.gradle.jvmargs"); |
There was a problem hiding this comment.
Constant declaration would be nice, tough a //NOI18N shall be added.
|
I'm sure that this is actually required, Gradle Tooling API with Gradle Daemon can't auto add jvmargs from gradle.properties file. only run gradle command can add jvmargs from gradle.properties. If you have a better way to limit memory of gradle daemon in netbeans, please let me know. |
|
Ok. Go ahead and do the requested changes. Thank you for your contribution! |
You can limit memory by set org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=256m