jtulach opened a new pull request, #5609:
URL: https://github.com/apache/netbeans/pull/5609

   With #5550 in, there is a time to start _"consuming our own dog food"_. 
NetBeans [relies on 
nb-javac](https://cwiki.apache.org/confluence/display/NETBEANS/Overview:+nb-javac)
 to provide *WYSIWYG Java editing experience* supporting the **latest Java 
language features** regardless the JDK the IDE runs on. Reliable, compatible 
and well tested [nb-javac](https://github.com/JaroslavTulach/nb-javac) JARs are 
essential for delivering such an experience and ensuring the same behavior as 
when running NetBeans IDE on the latest JDK without nb-javac.
   
   There are many ways to ensure 
[nb-javac](https://github.com/JaroslavTulach/nb-javac) is compatible with JDK's 
javac including its unique [automatic generation 
process](https://cwiki.apache.org/confluence/display/NETBEANS/Overview:+nb-javac#Overview:nbjavac-AutomaticallyGeneratingnb-javac).
 However nothing can beat a real world experience: Let's *use nb-javac to build 
some real* world project! Let's use it to **build NetBeans**! NetBeans is a 
huge, long running, well established software project using various aspects of 
the Java language - by building it with 
[nb-javac](https://github.com/JaroslavTulach/nb-javac) we can proof the 
compiler is good enough (at least for building NetBeans).
   
   To build NetBeans with this PR use:
   ```bash
   $ ant download-all-extbins
   $ ant build -Dnbjavac.class.path=java/libs.javacapi/external/*.jar
   ```
   
   Without specifying the `nbjavac.class.path` property the build runs as 
normal. When the `nbjavac.class.path` property is specified, it uses the 
provided location to find 
[nb-javac](https://github.com/JaroslavTulach/nb-javac) JARs and load the 
compiler from there - a bit of `ClassLoader` magic is necessary to make sure 
the [nb-javac](https://github.com/JaroslavTulach/nb-javac) takes precedence 
over JDK's javac and is cached between subsequent compiler invocations in the 
Ant `nbbuild/build.xml` script, but everything seems to work across JDKs.
   
   The [nb-javac](https://github.com/JaroslavTulach/nb-javac) JARs are 
intentionally specified via a property to simplify providing different version 
of `nb-javac`. Maintainers of 
[nb-javac](https://github.com/JaroslavTulach/nb-javac) project (e.g. me and 
DuĊĦan) are encouraged to include build of NetBeans into their own CI pipeline 
to verify new versions of 
[nb-javac](https://github.com/JaroslavTulach/nb-javac) remain compatible with 
NetBeans sources.
   
   Similarly the NetBeans CI shall be extended with a job to verify `ant build 
-Dnbjavac.class.path=java/libs.javacapi/external/*.jar` continues to work. Here 
I rely on @mbien guidance as the CI configuration changed a lot since the last 
time I played with it.


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

To unsubscribe, e-mail: [email protected]

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

Reply via email to