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 2020/12/14 07:27:03 UTC

[GitHub] [netbeans] jlahoda opened a new pull request #2594: Removing the need for a default JS engine in JDK to call ant tryme.

jlahoda opened a new pull request #2594:
URL: https://github.com/apache/netbeans/pull/2594


   nbbuild/build.xml uses JavaScript to construct tryme.args property from tryme.arg.* properties. This, however, does not work for JDK 15+, as there is no default JS engine for it. I was thinking of various ways to fix it, but, in the end, this does not seem like a particularly important feature, and my proposal is to simple remove the feature to joing tryme.arg.* properties into tryme.args property.


----------------------------------------------------------------
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



---------------------------------------------------------------------
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


[GitHub] [netbeans] JaroslavTulach commented on pull request #2594: Removing the need for a default JS engine in JDK to call ant tryme.

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on pull request #2594:
URL: https://github.com/apache/netbeans/pull/2594#issuecomment-744266199


   I guess you should get rid of the known usages, if you really want to remove the code.
   ```bash
   netbeans$ grep "tryme.arg\." -r 
   ./nbbuild/build.xml:                if (e.getKey().startsWith('tryme.arg.')) {
   ./nbbuild/build.properties:tryme.arg.hack=-J-Dnetbeans.full.hack=true
   ./java/projectimport.eclipse.core/build.xml:            <property name="tryme.arg.eclipseimport" value="-J-Dorg.netbeans.modules.projectimport.eclipse.level=0 --clusters ${clusters.toString}"/>
   ./platform/keyring/build.xml:            <property name="tryme.arg.keyring" value="-J-Dorg.netbeans.modules.keyring.level=0 -J-Dnetbeans.keyring.no.native=${nonative}"/>
   ./ide/hudson/build.xml:        <property name="tryme.arg.hudson" value="-J-Dorg.netbeans.modules.hudson.level=FINER"/>
   ```
   Alternative is to write a simple Ant task in `nbbuild/antsrc` instead of using JavaScript.


----------------------------------------------------------------
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



---------------------------------------------------------------------
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


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #2594: Removing the need for a default JS engine in JDK to call ant tryme.

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #2594:
URL: https://github.com/apache/netbeans/pull/2594#discussion_r543067753



##########
File path: nbbuild/antsrc/org/netbeans/nbbuild/MergeTrymeArgs.java
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.nbbuild;
+
+import java.util.Map.Entry;
+import java.util.TreeMap;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+
+/**
+ * Merge the arguments supplied via the tryme.arg.* properties into the
+ * property tryme.args.
+ */
+public class MergeTrymeArgs extends Task {
+    public @Override void execute() throws BuildException {
+        StringBuilder tryMeArgs = new StringBuilder();
+        for(Entry<String,Object> e: new TreeMap<>(getProject().getProperties()).entrySet()) {
+            if(e.getKey().startsWith("tryme.arg.")) {
+                tryMeArgs.append(" ");
+                tryMeArgs.append(e.getValue());
+            }
+        }
+        getProject().setProperty("tryme.args", tryMeArgs.toString());

Review comment:
       The JavaScript code is using `setNewProperty` - e.g. don't override existing previous definition. This code is using `setProperty`. 




----------------------------------------------------------------
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



---------------------------------------------------------------------
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


[GitHub] [netbeans] lkishalmi merged pull request #2594: Removing the need for a default JS engine in JDK to call ant tryme.

Posted by GitBox <gi...@apache.org>.
lkishalmi merged pull request #2594:
URL: https://github.com/apache/netbeans/pull/2594


   


----------------------------------------------------------------
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



---------------------------------------------------------------------
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


[GitHub] [netbeans] jlahoda commented on pull request #2594: Removing the need for a default JS engine in JDK to call ant tryme.

Posted by GitBox <gi...@apache.org>.
jlahoda commented on pull request #2594:
URL: https://github.com/apache/netbeans/pull/2594#issuecomment-744360626


   Well, I was considering writing a task - but, frankly, what would be the point. We say all the Ant-based projects are effectively deprecated (we didn't even bother including any of them in the VS Code extension, AFAIK), and this is only the project for building NetBeans itself - not user applications. And I doubt this is a feature broadly used. I guess we should decide that either the Ant-base projects are deprecated, and we are allowed to keep shortcuts in maintaining them, or they are not deprecated, and then we need to treat them properly on all places.


----------------------------------------------------------------
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



---------------------------------------------------------------------
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


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #2594: Removing the need for a default JS engine in JDK to call ant tryme.

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #2594:
URL: https://github.com/apache/netbeans/pull/2594#discussion_r543067753



##########
File path: nbbuild/antsrc/org/netbeans/nbbuild/MergeTrymeArgs.java
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.nbbuild;
+
+import java.util.Map.Entry;
+import java.util.TreeMap;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+
+/**
+ * Merge the arguments supplied via the tryme.arg.* properties into the
+ * property tryme.args.
+ */
+public class MergeTrymeArgs extends Task {
+    public @Override void execute() throws BuildException {
+        StringBuilder tryMeArgs = new StringBuilder();
+        for(Entry<String,Object> e: new TreeMap<>(getProject().getProperties()).entrySet()) {
+            if(e.getKey().startsWith("tryme.arg.")) {
+                tryMeArgs.append(" ");
+                tryMeArgs.append(e.getValue());
+            }
+        }
+        getProject().setProperty("tryme.args", tryMeArgs.toString());

Review comment:
       The JavaScript code is using `setNewProperty` - e.g. don't override existing previous definition. This code is using `setProperty`. That may alter the semantics.




----------------------------------------------------------------
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



---------------------------------------------------------------------
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


[GitHub] [netbeans] JaroslavTulach edited a comment on pull request #2594: Removing the need for a default JS engine in JDK to call ant tryme.

Posted by GitBox <gi...@apache.org>.
JaroslavTulach edited a comment on pull request #2594:
URL: https://github.com/apache/netbeans/pull/2594#issuecomment-744266199


   I guess you should get rid of the known usages, if you really want to remove the code.
   ```bash
   netbeans$ grep "tryme.arg\." -r 
   ./nbbuild/build.xml:                if (e.getKey().startsWith('tryme.arg.')) {
   ./nbbuild/build.properties:tryme.arg.hack=-J-Dnetbeans.full.hack=true
   ./java/projectimport.eclipse.core/build.xml:            <property name="tryme.arg.eclipseimport" value="-J-Dorg.netbeans.modules.projectimport.eclipse.level=0 --clusters ${clusters.toString}"/>
   ./platform/keyring/build.xml:            <property name="tryme.arg.keyring" value="-J-Dorg.netbeans.modules.keyring.level=0 -J-Dnetbeans.keyring.no.native=${nonative}"/>
   ./ide/hudson/build.xml:        <property name="tryme.arg.hudson" value="-J-Dorg.netbeans.modules.hudson.level=FINER"/>
   ```
   Alternative is to write a simple Ant task in `nbbuild/antsrc` instead of using JavaScript. CCing @jglick 


----------------------------------------------------------------
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



---------------------------------------------------------------------
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


[GitHub] [netbeans] jlahoda commented on pull request #2594: Removing the need for a default JS engine in JDK to call ant tryme.

Posted by GitBox <gi...@apache.org>.
jlahoda commented on pull request #2594:
URL: https://github.com/apache/netbeans/pull/2594#issuecomment-744732170


   Thanks Matthias! I've included your patch in this PR.


----------------------------------------------------------------
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



---------------------------------------------------------------------
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


[GitHub] [netbeans] jglick commented on a change in pull request #2594: Removing the need for a default JS engine in JDK to call ant tryme.

Posted by GitBox <gi...@apache.org>.
jglick commented on a change in pull request #2594:
URL: https://github.com/apache/netbeans/pull/2594#discussion_r543660892



##########
File path: nbbuild/build.xml
##########
@@ -1189,22 +1189,10 @@ PKGINST=${pkg.svr4.pkginst}</echo>
           description="Try running the IDE interactively.
 It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in debug mode" 
    >
-    <script language="javascript">
-        if (typeof Packages !== 'undefined') {
-            v = '';
-            i = new Packages.java.util.TreeMap(project.getProperties()).entrySet().iterator()
-            while (i.hasNext()) {
-                e = i.next()
-                if (e.getKey().startsWith('tryme.arg.')) {
-                    v += ' ' + e.getValue()
-                }
-            }
-            project.setNewProperty('tryme.args', v)
-        }
-    </script>
+    <taskdef name="mergetrymeargs" classname="org.netbeans.nbbuild.MergeTrymeArgs" classpath="${nbantext.jar}" />
+    <mergetrymeargs />

Review comment:
       ```suggestion
       <taskdef name="mergetrymeargs" classname="org.netbeans.nbbuild.MergeTrymeArgs" classpath="${nbantext.jar}"/>
       <mergetrymeargs/>
   ```

##########
File path: nbbuild/antsrc/org/netbeans/nbbuild/MergeTrymeArgs.java
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.nbbuild;
+
+import java.util.Map.Entry;
+import java.util.TreeMap;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+
+/**
+ * Merge the arguments supplied via the tryme.arg.* properties into the
+ * property tryme.args.

Review comment:
       ```suggestion
    * Merge the arguments supplied via any {@code tryme.arg.*} properties into the
    * property {@code tryme.args}.
   ```




----------------------------------------------------------------
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



---------------------------------------------------------------------
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


[GitHub] [netbeans] matthiasblaesing commented on pull request #2594: Removing the need for a default JS engine in JDK to call ant tryme.

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #2594:
URL: https://github.com/apache/netbeans/pull/2594#issuecomment-744671785


   I agree with @JaroslavTulach and I'm putting my work where my mouth is:
   
   https://github.com/matthiasblaesing/netbeans/tree/pr-2594
   
   I added:
   
   https://github.com/matthiasblaesing/netbeans/commit/bee5912cd664a9747bcefca78b3412f73ceee392
   
   Feel free to copy/pull. That should be a drop-in replacement and I think it prevents a regression where the "tryme.arg.hack" would not be picked up.


----------------------------------------------------------------
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



---------------------------------------------------------------------
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