8205627: Replace hardcoded spec version value in build.tools.ExtLink taglet

Reviewed-by: jjg, erikj
This commit is contained in:
Mandy Chung 2018-06-25 22:27:09 -07:00
parent 5ef2f98d35
commit 140e7415ff
2 changed files with 13 additions and 3 deletions

View File

@ -327,7 +327,8 @@ define SetupApiDocsGenerationBody
)
ifeq ($$($1_JAVADOC_CMD), )
$1_JAVADOC_CMD := $$(JAVA) -Djava.awt.headless=true $$($1_JAVA_ARGS) \
$1_JAVADOC_CMD := $$(JAVA) -Djava.awt.headless=true \
-Dextlink.spec.version=$$(VERSION_SPECIFICATION) $$($1_JAVA_ARGS) \
$$(NEW_JAVADOC)
endif

View File

@ -37,7 +37,6 @@ import com.sun.source.doctree.UnknownInlineTagTree;
import jdk.javadoc.doclet.Taglet;
import static com.sun.source.doctree.DocTree.Kind.*;
import static jdk.javadoc.doclet.Taglet.Location.*;
/**
* An inline tag to conveniently insert an external link.
@ -53,13 +52,23 @@ import static jdk.javadoc.doclet.Taglet.Location.*;
* }
*/
public class ExtLink implements Taglet {
static final String SPEC_VERSION;
static {
SPEC_VERSION = System.getProperty("extlink.spec.version");
if (SPEC_VERSION == null) {
throw new RuntimeException("extlink.spec.version property not set");
}
}
static final String TAG_NAME = "extLink";
static final String URL = "https://www.oracle.com/pls/topic/lookup?ctx=javase10&id=";
static final String URL = "https://www.oracle.com/pls/topic/lookup?ctx=javase" +
SPEC_VERSION + "&id=";
static final Pattern TAG_PATTERN = Pattern.compile("(?s)(\\s*)(?<name>\\w+)(\\s+)(?<desc>.*)$");
/**
* Returns the set of locations in which the tag may be used.
*/