This is an automated email from the ASF dual-hosted git repository. skygo pushed a commit to branch release126 in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/release126 by this push: new 6de00b9 #3443 to release126 new 83b100e Merge pull request #3539 from ebarboni/release126api 6de00b9 is described below commit 6de00b90104db9c9b17b0220468ca41fe2cf5cc9 Author: Eric Barboni <sk...@apache.org> AuthorDate: Fri Jan 28 18:48:27 2022 +0100 #3443 to release126 --- .../org/netbeans/nbbuild/ReleaseJsonProperties.java | 20 +++++++++++++------- nbbuild/javadoctools/jsonhelp.xsl | 15 ++++----------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/ReleaseJsonProperties.java b/nbbuild/antsrc/org/netbeans/nbbuild/ReleaseJsonProperties.java index 8de5ee0..3a0bd09 100644 --- a/nbbuild/antsrc/org/netbeans/nbbuild/ReleaseJsonProperties.java +++ b/nbbuild/antsrc/org/netbeans/nbbuild/ReleaseJsonProperties.java @@ -114,9 +114,7 @@ public class ReleaseJsonProperties extends Task { } catch (ParseException | IOException ex) { throw new BuildException(ex); } - - // remove empty api doc - ri.removeIf(e -> e.apidocurl.isEmpty()); + // sort all information Collections.sort(ri); // build a sorted xml @@ -136,11 +134,12 @@ public class ReleaseJsonProperties extends Task { } if (requiredbranchinfo == null) { - throw new BuildException("No Release Information found for branch '" + branch + "', update json file section"); + throw new BuildException("No Release Information found for branch '" + branch + "', update json file section with ant -Dneedjsondownload=true"); } List<String> updateValues = new ArrayList<>(); for (ReleaseInfo releaseInfo : ri) { - if (releaseInfo.position < requiredbranchinfo.position) { + // take previous version of Apache NetBeans only if published, need for scan for old NetBeans version + if (releaseInfo.position < requiredbranchinfo.position && releaseInfo.publishapi ) { updateValues.add(releaseInfo.version); } } @@ -194,7 +193,7 @@ public class ReleaseJsonProperties extends Task { throw new BuildException("Properties File for release cannot be created"); } - log("Writing releasinfo file " + xmlFile); + log("Writing release info file " + xmlFile); xmlFile.getParentFile().mkdirs(); try (OutputStream config = new FileOutputStream(xmlFile)) { @@ -221,6 +220,7 @@ public class ReleaseJsonProperties extends Task { releasesxml.setAttribute("position", Integer.toString(releaseInfo.position)); releasesxml.setAttribute("version", releaseInfo.version); releasesxml.setAttribute("apidocurl", releaseInfo.apidocurl); + releasesxml.setAttribute("pubapidoc", Boolean.toString(releaseInfo.publishapi)); } private ReleaseInfo manageRelease(String key, Object arelease) { @@ -249,6 +249,8 @@ public class ReleaseJsonProperties extends Task { ri.setJavaApiDocurl((String) getJSONInfo(jsonrelease, "jdk_apidoc", "Apidoc: javadoc for java jdk")); ri.setUpdateUrl((String) getJSONInfo(jsonrelease, "update_url", "Update catalog")); ri.setPluginsUrl((String) getJSONInfo(jsonrelease, "plugin_url", "Plugin URL")); + // + ri.setPublishApi(Boolean.parseBoolean((String) getJSONInfo(jsonrelease, "publish_apidoc", "Should we publish this Apidoc"))); // optional section JSONObject milestone = (JSONObject) jsonrelease.get("milestones"); if (milestone != null) { @@ -284,7 +286,6 @@ public class ReleaseJsonProperties extends Task { private Object getJSONInfo(JSONObject json, String key, String info) { Object result = json.get(key); - //log("Retriving " + key); if (result == null) { throw new BuildException("Cannot retrieve key " + key + ", this is for" + info); } @@ -341,6 +342,7 @@ public class ReleaseJsonProperties extends Task { private String javaapidocurl; private String updateurl; private String pluginsurl; + private boolean publishapi; private List<MileStone> milestones; public ReleaseInfo(String key) { @@ -411,6 +413,10 @@ public class ReleaseJsonProperties extends Task { this.milestones.add(milestone); } + private void setPublishApi(boolean publishok) { + this.publishapi = publishok; + } + } } diff --git a/nbbuild/javadoctools/jsonhelp.xsl b/nbbuild/javadoctools/jsonhelp.xsl index 3b71e20..818c118 100644 --- a/nbbuild/javadoctools/jsonhelp.xsl +++ b/nbbuild/javadoctools/jsonhelp.xsl @@ -263,28 +263,21 @@ committed to the repository for legal reasons. You need to download it: <xsl:for-each select="document($releaseinfo)//release"> <xsl:sort data-type="number" select="@position" order="descending" /> <xsl:choose> - <xsl:when test="$currentversion = @position"> + <xsl:when test="$currentversion = @position and @pubapidoc='true' "> <span> <xsl:value-of select="@version"/> </span> </xsl:when> - <xsl:otherwise> + <xsl:when test="$currentversion != @position and @pubapidoc='true' "> <xsl:element name="a"> <xsl:attribute name="class">apacheversion</xsl:attribute> <xsl:attribute name="href"> <xsl:value-of select="@apidocurl"/><xsl:text>/</xsl:text><xsl:value-of select="$menukey"/><xsl:text>.html</xsl:text></xsl:attribute> <xsl:value-of select="@version"/> - </xsl:element> - </xsl:otherwise> + </xsl:element> + </xsl:when> </xsl:choose> - </xsl:for-each> - <xsl:element name="a"> - <xsl:attribute name="href"> - <xsl:text>http://bits.netbeans.org/</xsl:text> - </xsl:attribute> - 8.2 and previous - </xsl:element> </div> </div> </xsl:template> --------------------------------------------------------------------- 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