[jira] [Commented] (NETBEANS-4219) Release specific Source Package Folders

2020-05-12 Thread Frank Tsiang (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-4219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17105342#comment-17105342
 ] 

Frank Tsiang commented on NETBEANS-4219:


Sorry, for the delayed response we have been overloaded lately.
 
We use multiple IDE's (currently Netbeans, IntelliJ CE and Eclipse). For 
Netbeans I use "Java with Ant" / "Java Project with Existing Sources" for 
running code within the IDE. We also have a custom built Ant script that we can 
run locally (in terminal) and on Jenkins. 
 
*The Ant Script*
The Ant script runs a java preprocessor, jar shrinker, junit test, code 
coverage reports, javadoc output, JMH benchmark jar files for performance 
regression and multi-release jars. The Ant script is typically run only before 
check-in, when benchmarking or ensuring proper test coverage.
 
*Netbeans / IDE*
For Netbeans I have used "Java with Ant" / "Java Project with Existing 
Sources". Then in the project I load the base source code folder along with any 
JDK specific source code folder using "Project Properties" / "Sources" / 
"Source Package Folder". If the multi-release structure is simple eg I can load 
the base folder (JDK agnostic code) and a JDK specific version folder then it 
is easy to write, run and debug in Netbeans.
 
If there are cumulative changes across multiple JDK specific folders (eg jdk 8, 
jdk 10, jdk 11) then all of these folders need to be loaded in the IDE. The 
challenge we face is when there is a mix of cumulative and overriding changes 
in the JDK specific folders. For example:
 
    jdk specific classes:
        jdk 8 has classes A & B
        jdk 10 overriding classes A & B
        jdk 11 overrides class A
 
Then when running and testing jdk 11 we need all jdk agnostic code plus class B 
from jdk 10 source folder and class A from jdk 11 source folder.
 
I will look at getting a sample structure up in GitHub (probably not before the 
end of the month). FYI we were using maven but as our build process but as our 
build process became more complex we struggled to adapt maven to our CI 
process. I can have someone look at Free-form projects, although I was hopping 
that maybe in the future it might be as simple as just selecting an optional 
source-level per "source package folder".
 

> Release specific Source Package Folders
> ---
>
> Key: NETBEANS-4219
> URL: https://issues.apache.org/jira/browse/NETBEANS-4219
> Project: NetBeans
>  Issue Type: New Feature
>Affects Versions: 11.3
>Reporter: Frank Tsiang
>Priority: Major
>  Labels: multi-release
>
> Currently I don't see any way to support multi-release projects. When loading 
> multiple source package folders netbeans assigns a single "Source/Binary 
> Format" for the entire project. What is needed is to be able to specify the 
> JDK version on a per Source Package Folder. Otherwise Netbeans complains 
> about syntax errors for source code that is not for the same JDK version as 
> the project.
>  
> Additional support to run the project as a specific JDK version would be 
> useful in this scenario (eg in Run under Project properties).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

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



[jira] [Commented] (NETBEANS-4219) Release specific Source Package Folders

2020-04-30 Thread Jan Lahoda (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-4219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17096993#comment-17096993
 ] 

Jan Lahoda commented on NETBEANS-4219:
--

I wonder what is the project type inside NetBeans - if it is Ant, is it "Java 
Application"/"Java Project with Existing Sources", "Java Free-Form Project", or 
something else? Your ant build script is generated, or hand-written?

 

The Java Application projects are meant to be simple projects, which have some 
pre-defined structure. The Free-Form projects allow much more fine-grained 
control, and while not everything can be configured in the UI, it is possible 
to set source level per source root in Free-Form project text configuration. If 
there's a sample, I can try to configure it. Although as Geertjan mentions, we 
are recommending different types of project for new projects.

 

Note that this is purely a UI issue - inside the IDE, there is no source level 
set on the project, all source levels are on source roots only.

 

I don't think there is a strong relation to 
[https://github.com/apache/netbeans/pull/941] - that is about determining the 
module name of a binary jar. And while we in principle can query "what source 
level is assigned to this jar", that is not an important query. The important 
query is "if I use this jar in as a dependency this source root, what is the 
source level" - but the source root which uses the jar is not available at that 
point. Which, as I noted in the review, is probably not that big deal, as this 
method only reads module names, nothing else, and I would assume the module 
name does not change with the Java version.

 

> Release specific Source Package Folders
> ---
>
> Key: NETBEANS-4219
> URL: https://issues.apache.org/jira/browse/NETBEANS-4219
> Project: NetBeans
>  Issue Type: New Feature
>Affects Versions: 11.3
>Reporter: Frank Tsiang
>Priority: Major
>  Labels: multi-release
>
> Currently I don't see any way to support multi-release projects. When loading 
> multiple source package folders netbeans assigns a single "Source/Binary 
> Format" for the entire project. What is needed is to be able to specify the 
> JDK version on a per Source Package Folder. Otherwise Netbeans complains 
> about syntax errors for source code that is not for the same JDK version as 
> the project.
>  
> Additional support to run the project as a specific JDK version would be 
> useful in this scenario (eg in Run under Project properties).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

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



[jira] [Commented] (NETBEANS-4219) Release specific Source Package Folders

2020-04-29 Thread Geertjan Wielenga (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-4219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17095398#comment-17095398
 ] 

Geertjan Wielenga commented on NETBEANS-4219:
-

We're increasingly supporting Ant less, so if the problem could be expressed in 
a Maven project, the chances of there being a focus on covering your use case 
will be a lot bigger.

> Release specific Source Package Folders
> ---
>
> Key: NETBEANS-4219
> URL: https://issues.apache.org/jira/browse/NETBEANS-4219
> Project: NetBeans
>  Issue Type: New Feature
>Affects Versions: 11.3
>Reporter: Frank Tsiang
>Priority: Major
>  Labels: multi-release
>
> Currently I don't see any way to support multi-release projects. When loading 
> multiple source package folders netbeans assigns a single "Source/Binary 
> Format" for the entire project. What is needed is to be able to specify the 
> JDK version on a per Source Package Folder. Otherwise Netbeans complains 
> about syntax errors for source code that is not for the same JDK version as 
> the project.
>  
> Additional support to run the project as a specific JDK version would be 
> useful in this scenario (eg in Run under Project properties).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

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



[jira] [Commented] (NETBEANS-4219) Release specific Source Package Folders

2020-04-29 Thread Frank Tsiang (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-4219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17095392#comment-17095392
 ] 

Frank Tsiang commented on NETBEANS-4219:


We have a test case for the Multi-release Ant built script that I should be 
able to scrub and upload as an example (I can probably get it out by the 
weekend).

> Release specific Source Package Folders
> ---
>
> Key: NETBEANS-4219
> URL: https://issues.apache.org/jira/browse/NETBEANS-4219
> Project: NetBeans
>  Issue Type: New Feature
>Affects Versions: 11.3
>Reporter: Frank Tsiang
>Priority: Major
>  Labels: multi-release
>
> Currently I don't see any way to support multi-release projects. When loading 
> multiple source package folders netbeans assigns a single "Source/Binary 
> Format" for the entire project. What is needed is to be able to specify the 
> JDK version on a per Source Package Folder. Otherwise Netbeans complains 
> about syntax errors for source code that is not for the same JDK version as 
> the project.
>  
> Additional support to run the project as a specific JDK version would be 
> useful in this scenario (eg in Run under Project properties).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

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



[jira] [Commented] (NETBEANS-4219) Release specific Source Package Folders

2020-04-29 Thread Frank Tsiang (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-4219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17095390#comment-17095390
 ] 

Frank Tsiang commented on NETBEANS-4219:


Yes the source structure is the same as  
[https://blog.codefx.org/tools/multi-release-jars-multiple-java-versions/] 
except for maybe naming conventions of the source root directories. Otherwise 
what I am suggesting is really structure agnostic in that it just depends on 
Netbean's existing ability to specify multiple "Source Package Folders" under 
the project properties. The only thing missing is being able to specify source 
level / library when adding a new "Source Package Folder"

The work done under  [https://github.com/apache/netbeans/pull/941] also suggest 
having source level would help the IDE make better decisions. From the 
comments...

"_There's one thing that is not completely correct: the problematic method does 
not know the source level, so it cannot decide which versioned module-info it 
should use._"

 

> Release specific Source Package Folders
> ---
>
> Key: NETBEANS-4219
> URL: https://issues.apache.org/jira/browse/NETBEANS-4219
> Project: NetBeans
>  Issue Type: New Feature
>Affects Versions: 11.3
>Reporter: Frank Tsiang
>Priority: Major
>  Labels: multi-release
>
> Currently I don't see any way to support multi-release projects. When loading 
> multiple source package folders netbeans assigns a single "Source/Binary 
> Format" for the entire project. What is needed is to be able to specify the 
> JDK version on a per Source Package Folder. Otherwise Netbeans complains 
> about syntax errors for source code that is not for the same JDK version as 
> the project.
>  
> Additional support to run the project as a specific JDK version would be 
> useful in this scenario (eg in Run under Project properties).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

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



[jira] [Commented] (NETBEANS-4219) Release specific Source Package Folders

2020-04-29 Thread Geertjan Wielenga (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-4219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17095378#comment-17095378
 ] 

Geertjan Wielenga commented on NETBEANS-4219:
-

But, in general, the Maven approach described in the link above, and elsewhere, 
would be the standard approach to take here in terms of structuring your code, 
which is the focus of your concern.

> Release specific Source Package Folders
> ---
>
> Key: NETBEANS-4219
> URL: https://issues.apache.org/jira/browse/NETBEANS-4219
> Project: NetBeans
>  Issue Type: New Feature
>Affects Versions: 11.3
>Reporter: Frank Tsiang
>Priority: Major
>  Labels: multi-release
>
> Currently I don't see any way to support multi-release projects. When loading 
> multiple source package folders netbeans assigns a single "Source/Binary 
> Format" for the entire project. What is needed is to be able to specify the 
> JDK version on a per Source Package Folder. Otherwise Netbeans complains 
> about syntax errors for source code that is not for the same JDK version as 
> the project.
>  
> Additional support to run the project as a specific JDK version would be 
> useful in this scenario (eg in Run under Project properties).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

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



[jira] [Commented] (NETBEANS-4219) Release specific Source Package Folders

2020-04-29 Thread Geertjan Wielenga (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-4219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17095377#comment-17095377
 ] 

Geertjan Wielenga commented on NETBEANS-4219:
-

Maybe one way forward here is to put a small project that reproduces your 
problem scenario on GitHub and then explain with that actual project what the 
problem is and how you'd like it to be used in NetBeans.

> Release specific Source Package Folders
> ---
>
> Key: NETBEANS-4219
> URL: https://issues.apache.org/jira/browse/NETBEANS-4219
> Project: NetBeans
>  Issue Type: New Feature
>Affects Versions: 11.3
>Reporter: Frank Tsiang
>Priority: Major
>  Labels: multi-release
>
> Currently I don't see any way to support multi-release projects. When loading 
> multiple source package folders netbeans assigns a single "Source/Binary 
> Format" for the entire project. What is needed is to be able to specify the 
> JDK version on a per Source Package Folder. Otherwise Netbeans complains 
> about syntax errors for source code that is not for the same JDK version as 
> the project.
>  
> Additional support to run the project as a specific JDK version would be 
> useful in this scenario (eg in Run under Project properties).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

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



[jira] [Commented] (NETBEANS-4219) Release specific Source Package Folders

2020-04-29 Thread Geertjan Wielenga (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-4219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17095376#comment-17095376
 ] 

Geertjan Wielenga commented on NETBEANS-4219:
-

Here's some of the work that has been done to support multi-release JARs: 
https://github.com/apache/netbeans/pull/941

> Release specific Source Package Folders
> ---
>
> Key: NETBEANS-4219
> URL: https://issues.apache.org/jira/browse/NETBEANS-4219
> Project: NetBeans
>  Issue Type: New Feature
>Affects Versions: 11.3
>Reporter: Frank Tsiang
>Priority: Major
>  Labels: multi-release
>
> Currently I don't see any way to support multi-release projects. When loading 
> multiple source package folders netbeans assigns a single "Source/Binary 
> Format" for the entire project. What is needed is to be able to specify the 
> JDK version on a per Source Package Folder. Otherwise Netbeans complains 
> about syntax errors for source code that is not for the same JDK version as 
> the project.
>  
> Additional support to run the project as a specific JDK version would be 
> useful in this scenario (eg in Run under Project properties).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

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



[jira] [Commented] (NETBEANS-4219) Release specific Source Package Folders

2020-04-29 Thread Geertjan Wielenga (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-4219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17095372#comment-17095372
 ] 

Geertjan Wielenga commented on NETBEANS-4219:
-

Can you use a structure like this, i.e., using Maven:

https://blog.codefx.org/tools/multi-release-jars-multiple-java-versions/

> Release specific Source Package Folders
> ---
>
> Key: NETBEANS-4219
> URL: https://issues.apache.org/jira/browse/NETBEANS-4219
> Project: NetBeans
>  Issue Type: New Feature
>Affects Versions: 11.3
>Reporter: Frank Tsiang
>Priority: Major
>  Labels: multi-release
>
> Currently I don't see any way to support multi-release projects. When loading 
> multiple source package folders netbeans assigns a single "Source/Binary 
> Format" for the entire project. What is needed is to be able to specify the 
> JDK version on a per Source Package Folder. Otherwise Netbeans complains 
> about syntax errors for source code that is not for the same JDK version as 
> the project.
>  
> Additional support to run the project as a specific JDK version would be 
> useful in this scenario (eg in Run under Project properties).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

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



[jira] [Commented] (NETBEANS-4219) Release specific Source Package Folders

2020-04-29 Thread Frank Tsiang (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-4219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17095362#comment-17095362
 ] 

Frank Tsiang commented on NETBEANS-4219:


I'm not sure what Maven has to do with this suggestion (for example we have
an ant build process when building outside of the netbeans to create
Multi-release jar files). This issue here is not creating a
multi-release jar, it is working with a multi-release project where we may
have a situation as follows..

\Version 9
  \A.java<-- only compilable under jdk 9
  \B.java<-- only compilable under jdk 9..10
  \C.java<-- only compilable under jdk 9+
\Version 10
  \A.java   <-- only compilable under jdk 10+
\Version 11
  \B.java  <-- only compilable under jdk 11+

We have not found a way to work with jdk specific code within the IDE when
having a scenario like the one above. The only solution is to maintain
multiple copies of the jdk specific source code for each version thus a
version 11 directory contains copies of A.java (ver 10) and C.java (ver 9).
Then we can load the jdk agnostic code (whatever the lowest supported
version is) and version 11 source directory into the IDE.

By being able to specify the JDK source / library by source directory the
IDE should then have enough information to be able to properly compile the
source code with proper syntax highlighting, execute debugging etc
regardless of the build system.

Let me know if there is anything else I can clarify on the issue.

On Wed, Apr 22, 2020 at 12:54 PM Geertjan Wielenga (Jira) 



> Release specific Source Package Folders
> ---
>
> Key: NETBEANS-4219
> URL: https://issues.apache.org/jira/browse/NETBEANS-4219
> Project: NetBeans
>  Issue Type: New Feature
>Affects Versions: 11.3
>Reporter: Frank Tsiang
>Priority: Major
>  Labels: multi-release
>
> Currently I don't see any way to support multi-release projects. When loading 
> multiple source package folders netbeans assigns a single "Source/Binary 
> Format" for the entire project. What is needed is to be able to specify the 
> JDK version on a per Source Package Folder. Otherwise Netbeans complains 
> about syntax errors for source code that is not for the same JDK version as 
> the project.
>  
> Additional support to run the project as a specific JDK version would be 
> useful in this scenario (eg in Run under Project properties).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

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



[jira] [Commented] (NETBEANS-4219) Release specific Source Package Folders

2020-04-22 Thread Geertjan Wielenga (Jira)


[ 
https://issues.apache.org/jira/browse/NETBEANS-4219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17089856#comment-17089856
 ] 

Geertjan Wielenga commented on NETBEANS-4219:
-

How would you do it in Maven? That’s how you do it in NetBeans. 

> Release specific Source Package Folders
> ---
>
> Key: NETBEANS-4219
> URL: https://issues.apache.org/jira/browse/NETBEANS-4219
> Project: NetBeans
>  Issue Type: New Feature
>Affects Versions: 11.3
>Reporter: Frank Tsiang
>Priority: Major
>  Labels: multi-release
>
> Currently I don't see any way to support multi-release projects. When loading 
> multiple source package folders netbeans assigns a single "Source/Binary 
> Format" for the entire project. What is needed is to be able to specify the 
> JDK version on a per Source Package Folder. Otherwise Netbeans complains 
> about syntax errors for source code that is not for the same JDK version as 
> the project.
>  
> Additional support to run the project as a specific JDK version would be 
> useful in this scenario (eg in Run under Project properties).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

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