arusinha commented on a change in pull request #2015:
URL: https://github.com/apache/netbeans/pull/2015#discussion_r420001278
##########
File path: nbi/engine/build.xml
##########
@@ -20,10 +20,17 @@
-->
-<project name="NBI_Engine" default="default" basedir=".">
+<project name="nbi/engine" default="default" basedir=".">
Review comment:
Please don't change the project name. We tried building NB installer for
12.0 after merging your change set, It failed with below error
BUILD FAILED
netbeans/nbbuild/installer/infra/build/build.xml:133: The following error
occurred while executing this line:
nbbuild/installer/infra/build/nbi_all/nbi/engine/build.xml:47: Cannot find
/Users/sarillamohanarao/Mohan/Code_Repository/Github_Repository/Installer_Maven_Issue/netbeans/nbbuild/installer/infra/build/nbi_all/nbbuild/templates/projectized.xml
imported from
/Users/sarillamohanarao/Mohan/Code_Repository/Github_Repository/Installer_Maven_Issue/netbeans/nbbuild/installer/infra/build/nbi_all/nbi/engine/build.xml
##########
File path:
nbi/engine/src/org/netbeans/installer/wizard/containers/InitializeMacJDK8.java
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.installer.wizard.containers;
+
+import com.apple.eawt.Application;
+import com.apple.eawt.ApplicationAdapter;
+import com.apple.eawt.ApplicationEvent;
+
+/**
+ *
+ * @author christian.oyarzun
+ */
+public class InitializeMacJDK8 {
+ public static void initialize(SwingFrameContainer frameContainer)
+ {
+ final Application application = Application.getApplication();
Review comment:
can you enclose the code snippet with try-catch as it will throw the
error on jdk9+ runtime
##########
File path:
nbi/engine/src/org/netbeans/installer/wizard/containers/SwingFrameContainer.java
##########
@@ -418,23 +419,28 @@ public void actionPerformed(ActionEvent event) {
private void initializeMacOS() {
if (SystemUtils.isMacOS()) {
- final Application application = Application.getApplication();
- if(application == null) {
- // e.g. running OpenJDK port via X11 on Mac OS X
- return;
+ if
(!initializeMacJDK("org.netbeans.installer.wizard.containers.initializeMacJDK8"))
{ // NOI18N
Review comment:
Do we really needs reflection to call the classes?
you can change InitializeMacJDK8.initialize() to return true/false
if(!InitializeMacJDK8.initialize())
InitializeMacJDK9.initialize()
other alternative approach
boolean isJdk9OrAbove = false
try {
SourceVersion.valueOf("RELEASE_9"); //NOI18N
isJdk9OrAbove = true;
}
catch (IllegalArgumentException ex) {
isJdk9OrAbove = true;
}
if(isJdk9OrAbove)
(InitializeMacJDK9.initialize())
else InitializeMacJDK9.initialize()
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists