Skip to content

master apidoc links fixes (partial)#4450

Closed
ebarboni wants to merge 10 commits intoapache:masterfrom
ebarboni:fixapimasterdoc
Closed

master apidoc links fixes (partial)#4450
ebarboni wants to merge 10 commits intoapache:masterfrom
ebarboni:fixapimasterdoc

Conversation

@ebarboni
Copy link
Copy Markdown
Contributor

HI @jtulach I tried the approach on master too.

with jdk 11 some warning are now error I guess and prevent the javadoc generation
I try to fix some of the issue I encounter.

Missing element are error (i.e Bundle so I introduced) a new path element in the javadoc task

For the moment I have 63 lines of bad links.

most of them are related to https://github.com/apache/netbeans/tree/master/java/java.source.base
(as an example)
org.netbeans.modules.java.source.builder issue it that javadoc cannot find the com.sun.source.tree.CaseTree.CaseKind;
I compile on jdk 11 and this is introduced in jdk 12 or maybe with the nb-javac.

What would be a good method to handle that ?

@mbien
Copy link
Copy Markdown
Member

mbien commented Jul 30, 2022

org.netbeans.modules.java.source.builder issue it that javadoc cannot find the com.sun.source.tree.CaseTree.CaseKind;
I compile on jdk 11 and this is introduced in jdk 12 or maybe with the nb-javac.

what if we generate the javadoc with the same JDK of the current nb-javac version? So for master it would be JDK 18 right now.

Due to nb-javac, NetBeans builds a little bit of a frankenstein JDK at runtime. Since java is forward compatible API-wise, JDK 18 should hopefully cover all APIs which are used in NBs.

@ebarboni
Copy link
Copy Markdown
Contributor Author

ebarboni commented Aug 1, 2022

@mbien this could be done in a CI build but how to do that at the time you edit the module within IDE for example.

@mbien
Copy link
Copy Markdown
Member

mbien commented Aug 1, 2022

@mbien this could be done in a CI build but how to do that at the time you edit the module within IDE for example.

I don't think this is a problem. NB can be built on current JDKs thanks to the updates in 13 and 14.

We could let it print a warning and skip the javadoc build: "javadoc build of this module requires running on the same JDK version as nb-javac is based on"

but maybe this isn't even needed. Javadoc is a separate target it isn't build by default anyway - not many would notice. As long we can generate and host docs somehow its all good IMO.

edit: does it work if you build the doc with 18? ;)

@neilcsmith-net
Copy link
Copy Markdown
Member

Could "we" publish javadocs for nbjavac? And if we did, could we link to them?

@ebarboni
Copy link
Copy Markdown
Contributor Author

ebarboni commented Aug 1, 2022

@mbien building too ahead make some module not compilable (source target too low 1.6 for openide.io as an example)

I have now idea if we can mix javadoc from nbjavac + current jdk.

there are a lots of forward reference to modules that are not in build classpath and need the replace @see and @link are very strict.

@mbien
Copy link
Copy Markdown
Member

mbien commented Aug 1, 2022

@mbien building too ahead make some module not compilable (source target too low 1.6 for openide.io as an example)

i think we could rise everything to 8 if necessary. Even the profiler is using 8. Nothing is tested on 1.6.

@ebarboni ebarboni added the doc Documentation related PRs label Aug 3, 2022
@ebarboni
Copy link
Copy Markdown
Contributor Author

ebarboni commented Aug 4, 2022

I will later sqash all of that in one commit so we could resync.
on true master branch :D I've miss the -meta.branch=master I can build until the end with no more javadoc error.
Will try to fix remaining issue.

@mbien
Copy link
Copy Markdown
Member

mbien commented Aug 4, 2022

I will later sqash all of that in one commit so we could resync. on true master branch :D I've miss the -meta.branch=master I can build until the end with no more javadoc error. Will try to fix remaining issue.

this was a lot of work @ebarboni, good job!

@ebarboni ebarboni force-pushed the fixapimasterdoc branch 2 times, most recently from 9549d9b to 5cb0f24 Compare August 8, 2022 16:28
@ebarboni
Copy link
Copy Markdown
Contributor Author

removed the discussion as ported to dev.

I tried to use --patch-module but withtout success.
Xbootclasspath/a is the only allowed args but Xootclasspath/p is needed I think.

waiting for PR on website site to alter the missing link.

Introducing:
javadoc.nbjavac=true

to allow a choice in nbbuild/javadoctools/templates.xml because now
javadoc-exec-packages is composed of javadoc-exec-packages-nbjavac or javadoc-exec-packages-jdk according to the boolean.

2 modules needs the boolean set:
java.source.base
spi.java.hints

@mbien
Copy link
Copy Markdown
Member

mbien commented Aug 12, 2022

this is going to be difficult to review :/

would it be possible to split "interesting" changes like the build logic for javadoc.nbjavac=true into separate commits?

Comment on lines +359 to +363
<target name="javadoc-exec-packages" depends="javadoc-init,javadoc-generate-references,javadoc-generate-overview,javadoc-exec-condition,javadoc-check-timestamps,javadoc-make-plain-title,javadoc-make-hyperlinked-title,javadoc-exec-condition,-javadoc-set-footer,-javadoc-exec-packages-jdk,-javadoc-exec-packages-nbjavac" unless="javadoc.exec.packages">
<!-- javadoc-exec-packages-jdk -->
<!-- javadoc-exec-packages-nbjavac -->
</target>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previous target javadoc-exec-packages depends on -javadoc-exec-packages-jdk and javadoc-exec-packages-nbjavac

<arg value="-notimestamp" />
</javadoc>
</target>
<target name="-javadoc-exec-packages-jdk" depends="javadoc-init,javadoc-generate-references,javadoc-generate-overview,javadoc-exec-condition,javadoc-check-timestamps,javadoc-make-plain-title,javadoc-make-hyperlinked-title,javadoc-exec-condition,-javadoc-set-footer" unless="javadoc.nbjavac">
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

target -javadoc-exec-package-jdk is active only if javadoc.nbjavac is not set

<javadoc source="${javac.source}" author="false" destdir="${javadoc.out.dir}" packagenames="${javadoc.packages}" stylesheetfile="${javadoc.css.main}" windowtitle="${javadoc.title}" overview="${javadoc.overview}" splitindex="true" use="true" version="false" useexternalfile="true" encoding="UTF-8">


<target name="-javadoc-exec-packages-nbjavac" depends="javadoc-init,javadoc-generate-references,javadoc-generate-overview,javadoc-exec-condition,javadoc-check-timestamps,javadoc-make-plain-title,javadoc-make-hyperlinked-title,javadoc-exec-condition,-javadoc-set-footer" if="javadoc.nbjavac">
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-javadoc-exec-packages-nbjavac target only active javadoc.nbjavac
currently as mentioned only 2 modules need that. javadoc in this case not fail if error.
it's possible to test on module java.source.base. ant clean;ant build; ant javadoc.

As this target is not working cannot prepend the bootclasspath with nb-javac-jdk this lead to this module not visible in the apidoc (except their arch,apichanges)

@ebarboni
Copy link
Copy Markdown
Contributor Author

I try to put emphasis on the part that change according to the javadoc.nbjavac flag. it's if unless ant contional as done in many place in our build file.

The only issue is within the javadoc target using nbjavac I've no idea on how to make it work
-J-Xbootstrap/p is not available only -J-Xbootstrap/a but this fail. --patch-module fail too

I find it difficult to split as I would like to get the last link error done. The one linking to *netbeans.org/ and blots landing to useless 404 pages (pr in progress to website). All changes in templates.xml is because got lots of fixes to do like replacing @element@ deeper, filtering on special index files or deprecated list. Snippet was to short with only 120 line. Adding generated path to get bundle linked too.

@ebarboni
Copy link
Copy Markdown
Contributor Author

@mbien hope the commit split in enough.

@ebarboni ebarboni requested a review from mbien September 13, 2022 10:45
Copy link
Copy Markdown
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i only glanced over the first commit since it touches over 1k files which makes it hard to review.

The rest looks ok as far as I can tell. Good that the javadoc.nbjavac trick works. I left one comment inline.

Since this is such a big changeset, i would recommend to split it into two commits, one which changes ant logic and actual source code logic and another which fixes all the links and other javadoc issues. So that we don't hide important changes in all the cleanup noise.

Copy link
Copy Markdown
Member

@sdedic sdedic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed up to harness cluster ... will continue. Sorry - it's terribly long :)

* The mapping can cause the action to be <b>disabled</b>: if {@link #getReloadRule()} == {@link ReloadRule#NEVER} and
* {@link #getArgs()} == {@code null}. Such mapping had no effect in previous versions. This can be checked by a
* convenience method {@link RunUtils#isActionDisabled}.
* {@link #getArgs()} == {@code null}. Such mapping had no effect in previous versions.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reason to remove the mention to isActionDisabled ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method is no more present.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdedic is it ok to resolve this ?

* <p>
* GradleExecConfigurations can be also declared by a Plugin that implements a
* <a href="@TOP@/org/netbeans/spi/GradleActionsProvider.html#define-configuration">GradleActionsProvider</a>,
* {@link org.netbeans.modules.gradle.spi.actions.GradleActionsProvider GradleActionsProvider },
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original link points directly to the example code (using anchor)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The anchor is not working because not present that why I try to use the link to the class

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdedic is it ok to resolve this ?

* Post action on this DebuggerEngine.
* This method does not block till the action is done,
* if {@link #canPostAsynchronously} returns true.
* if <code>canPostAsynchronously</code> returns true.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better @link to the method ?

Copy link
Copy Markdown
Contributor Author

@ebarboni ebarboni Sep 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method is not existing and cannot be linked. Not sure on how to rewrite

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// cc: @entlicher ?

@ebarboni
Copy link
Copy Markdown
Contributor Author

I will later squash all this in one commit but I try to keep the commit per module for helping review

@ebarboni ebarboni added this to the NB16 milestone Sep 20, 2022
@neilcsmith-net neilcsmith-net modified the milestones: NB16, NB17 Oct 19, 2022
@ebarboni
Copy link
Copy Markdown
Contributor Author

will be reworked per clusters. Changes should be the same

@BradWalker
Copy link
Copy Markdown
Member

Hey @ebarboni , could I possibly help with this? It's interesting to me and I could learn some new stuff. I would need some guidance so that I don't already duplicate your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Documentation related PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants