Re: Packaging Netbeans on Gentoo

"William L. Thomson Jr." <[email protected]> Fri, 24 Nov 2017 19:39:36 -0500
Newsgroups gmane.comp.java.netbeans.devel
Organization Obsidian-Studios, Inc.
Message-ID <[email protected]>
--Sig_/0R+WLSddL8oXwM6xTjpph1b
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

On Sat, 25 Nov 2017 02:11:35 +0200
Emilian Bold <[email protected]> wrote:

> Nice email. I might have missed some info so feel free to remind me.
>=20
> Clusters are just a folder or a meta-package skeleton and they exist
> specifically for packaging on *nix. See
> http://wiki.netbeans.org/DevFaqWhatIsACluster

Thanks!

> I personally don't find clusters as valuable and if you have only
> NetBeans (and not other NetBeans-based app) having all the JARs in a
> single 'pool' / folder would look just as well to me.

Sweet as that is likely the direction I am heading. Want more
functionality, bring in more packages, that drop in more jars. To a
single master netbeans folder. Much closer to a normal install just
less stuff.

> TopLogging has these lines
>=20
>         String buildNumber =3D System.getProperty
> ("netbeans.buildnumber"); // NOI18N
>         String currentVersion =3D NbBundle.getMessage(TopLogging.class,
> "currentVersion", buildNumber );
>=20
> where it calls NbBundle expecting to find the `currentVersion` key in
> ./core.startup/src/org/netbeans/core/startup/Bundle.properties

Odd, I have that packaged but something must be up with the Bundle
generation. I am not 100% there, but new to reflection. I thought I may
need a CLI for such. It ended up being just a compiler flag/option.
Though I may need to do more there.

To process Bundle.properties and get a Bundle.java/.class I add the
following to compile.
-processor org.netbeans.modules.openide.util.NbBundleProcessor

But it seems to strip out stuff not used. Which maybe happening with
currentVersion. I see it is in the properties. But not in the generated
Bundle.class.

> Using java-pkg-simple instead of ant might be a struggle particularly
> since java-pkg-simple mentions there is no support for generating
> source files and such.

Yes I have been mastering a whole slew of things to generate Java
code... A ridiculous amount. Not sure why so many code in Java using
another language. Spring 5.x uses Kotlin. Still have to do stuff with
Scala. Less that use javacc, xjc, scomp, jflex, byaccj, and others.=20

In some cases I have made CLI wrappers.
https://github.com/javaee/jaxb-istack-commons/pull/2

I was using istack and that for Bundle.properties till I came across
the NbBundleProcessor.

> Many NetBeans annotations generate code at
> compile time (in META-INF for services, layer file or in the same
> package as Bundle.java for l10n).

Yes I need that to build many pieces. Any file with a NB_BUNDLE=3D0 is
adding the javac args/flags.
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netb=
eans.eclass#L78

> I sure hope these files are autogenerated from the project.xml files:
> https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/dev-java/netbe=
ans-options-api/netbeans-options-api-9999.ebuild

That is made by hand, but the other stuff I do in elcass since I likely
need to do that for all. One  issue I need to bring up. Resources are
mixed in with sources. Ideally resources are in their own directory
with structure. So you can just copy that over recursively.

At the moment moving them over in a flat format, all ended up in base
folder of jar. Not sure if they will be able to be found that way or
need exact paths.

I did have issues with manifest needing to be exactly
META-INF/MANIFEST.MF. So I make sure to upper case that
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netb=
eans.eclass#L65

> PS: Please use the [email protected] mailing list,
> this one is closing soon.

Ok sure thing. Should I repost this stuff on that list?

Speaking of which I am using that repo and those sources. I am working
on Nb 9 under Java 9. I was hacking Nb 8.2 for Java 9. Made decent
progress but some stuff was failing under ant via Gentoo's ant eclass.
That was not failing outside with normal ant.

Thus far having little to no issues under Java 9. Only 1 thing needed
fixing. Which I see others were already talking about on another list.
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/dev-java/netbean=
s-o-n-bootstrap/netbeans-o-n-bootstrap-9999.ebuild#L23
http://mail.openjdk.java.net/pipermail/jigsaw-dev/2017-June/012934.html

One missing import
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/dev-java/netbean=
s-o-n-core/netbeans-o-n-core-9999.ebuild#L38

So far no issues, and most of 8.2 is that way. Mostly ran into old
source/target < 1.6 Java 9 did not like. Plus some other stuff.
Example this still doesn't build.
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/dev-java/netbean=
s-platform/netbeans-platform-8.2-r11.ebuild#L113

Had to remove source from nb-javac, as that was failing. So modified
netbean's ant sources and some other stuff.


--=20
William L. Thomson Jr.

--Sig_/0R+WLSddL8oXwM6xTjpph1b
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iF0EARECAB0WIQTEeldqZjmVut8bVHJNcbKkg6ozUAUCWhi7yAAKCRBNcbKkg6oz
UFnNAJ9syXbObznkJepkTkqzbVqcHRaEjwCeOFIbCP/PR9pJhtcoUwRGV8M6Zx8=
=OT/F
-----END PGP SIGNATURE-----

--Sig_/0R+WLSddL8oXwM6xTjpph1b--