You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2019/12/29 14:48:22 UTC

[GitHub] [netbeans] lkishalmi commented on a change in pull request #1827: [NETBEANS-3041] Honor gradle.properties processing order for JVM args.

lkishalmi commented on a change in pull request #1827: [NETBEANS-3041] Honor gradle.properties processing order for JVM args.
URL: https://github.com/apache/netbeans/pull/1827#discussion_r361854556
 
 

 ##########
 File path: groovy/gradle/test/unit/src/org/netbeans/modules/gradle/api/execute/GradleCommandLineTest.java
 ##########
 @@ -277,4 +284,26 @@ public void testCombine3() {
         GradleCommandLine cmd = GradleCommandLine.combine(first, second);
         assertEquals(Arrays.asList("-Pversion=2.0", "build"), cmd.getSupportedCommandLine());
     }
+
+    @Test
+    public void testJVMArgs1() throws IOException {
+        TemporaryFolder root = new TemporaryFolder();
+        root.create();
+        File props = root.newFile("gradle.properties");
+        Files.write(props.toPath(), Arrays.asList("org.gradle.jvmargs=\"-Dfile.encoding=UTF-8\" -Xmx2g"));
+        List<String> jvmargs = new ArrayList<>();
+        GradleCommandLine.addGradleSettingJvmargs(root.getRoot(), jvmargs);
+        assertEquals(Arrays.asList("-Dfile.encoding=UTF-8", "-Xmx2g"), jvmargs);
+    }
+
+    @Test
+    public void testJVMArgs2() throws IOException {
+        TemporaryFolder root = new TemporaryFolder();
+        root.create();
+        File props = root.newFile("gradle.properties");
+        Files.write(props.toPath(), Arrays.asList("org.gradle.jvmargs=\"-Dfile.encoding=UTF-8\" -Dsomething=\"space value\""));
+        List<String> jvmargs = new ArrayList<>();
+        GradleCommandLine.addGradleSettingJvmargs(root.getRoot(), jvmargs);
+        assertEquals(Arrays.asList("-Dfile.encoding=UTF-8", "-Dsomething=space value"), jvmargs);
 
 Review comment:
   It should be really "-Dsomething=space value" as that would be passed to JVM and the JVM does parse the quotes.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists