You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2019/02/20 16:15:22 UTC
[ignite] branch ignite-11189-java11 updated: IGNITE-11189: Java 11:
Multiple source roots
This is an automated email from the ASF dual-hosted git repository.
dpavlov pushed a commit to branch ignite-11189-java11
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/ignite-11189-java11 by this push:
new 8ba1503 IGNITE-11189: Java 11: Multiple source roots
8ba1503 is described below
commit 8ba1503a925a9a44a23f22629beaaccb2c42b717
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Wed Feb 20 19:14:58 2019 +0300
IGNITE-11189: Java 11: Multiple source roots
---
modules/tools/pom.xml | 79 +++++++++++++++-------
.../ignite/tools/javadoc/IgniteLinkTaglet11.java | 6 +-
.../ignite/tools/javadoc/IgniteLinkTaglet.java | 37 ++++------
3 files changed, 68 insertions(+), 54 deletions(-)
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index d3a2b1b..e6b2824 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -34,43 +34,70 @@
<version>2.8.0-SNAPSHOT</version>
<url>http://ignite.apache.org</url>
+
+
<profiles>
<profile>
<id>java-9-10-11</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>**/org/apache/ignite/tools/javadoc/IgniteLinkTaglet.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <activation>
+ <jdk>[1.9,)</jdk>
+ </activation>
+ <properties>
+ <src.dir>src/main/java11</src.dir>
+ </properties>
</profile>
<profile>
<id>java-8</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>**/org/apache/ignite/tools/javadoc/IgniteLinkTaglet11.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <activation>
+ <jdk>1.8</jdk>
+ </activation>
+ <properties>
+ <src.dir>src/main/java8</src.dir>
+ </properties>
</profile>
</profiles>
+ <build>
+ <sourceDirectory>src/main/java</sourceDirectory>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>src/main/java/**/*.java</include>
+ <include>${src.dir}/**/*.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>3.0.0</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${src.dir}</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+
+
+
<dependencies>
<dependency>
<groupId>org.jodd</groupId>
diff --git a/modules/tools/src/main/java/org/apache/ignite/tools/javadoc/IgniteLinkTaglet11.java b/modules/tools/src/main/java11/org/apache/ignite/tools/javadoc/IgniteLinkTaglet11.java
similarity index 97%
rename from modules/tools/src/main/java/org/apache/ignite/tools/javadoc/IgniteLinkTaglet11.java
rename to modules/tools/src/main/java11/org/apache/ignite/tools/javadoc/IgniteLinkTaglet11.java
index cc23a58..db3b916 100644
--- a/modules/tools/src/main/java/org/apache/ignite/tools/javadoc/IgniteLinkTaglet11.java
+++ b/modules/tools/src/main/java11/org/apache/ignite/tools/javadoc/IgniteLinkTaglet11.java
@@ -135,7 +135,7 @@ public class IgniteLinkTaglet11 implements Taglet {
File f = tag.position().file();
- String curClass = f == null ? "" : f.getAbsolutePath().replace(File.separator, ".");
+ String curClass = f == null ? "" : f.getAbsolutePath().replace(File.separator, "");
String packPref = "src.main.java.";
@@ -157,11 +157,11 @@ public class IgniteLinkTaglet11 implements Taglet {
String simpleClsName = lastIdx != -1 && lastIdx + 1 < tokens[0].length() ?
tokens[0].substring(lastIdx + 1) : tokens[0];
- String fullyQClsName = tokens[0].replace(".", "/");
+ String fullyQClsName = tokens[0].replace("", "/");
return "<a href=\"" + path.toString() + fullyQClsName + ".html" +
(tokens.length > 1 ? ("#" + tokens[1].replace("[]", "...")) : "") +
- "\"><code>" + simpleClsName + (tokens.length > 1 ? ("." + tokens[1]) : "") + "</code></a>";
+ "\"><code>" + simpleClsName + (tokens.length > 1 ? ("" + tokens[1]) : "") + "</code></a>";
}
/**
diff --git a/modules/tools/src/main/java/org/apache/ignite/tools/javadoc/IgniteLinkTaglet.java b/modules/tools/src/main/java8/org/apache/ignite/tools/javadoc/IgniteLinkTaglet.java
similarity index 84%
rename from modules/tools/src/main/java/org/apache/ignite/tools/javadoc/IgniteLinkTaglet.java
rename to modules/tools/src/main/java8/org/apache/ignite/tools/javadoc/IgniteLinkTaglet.java
index b4777d1..3259a19 100644
--- a/modules/tools/src/main/java/org/apache/ignite/tools/javadoc/IgniteLinkTaglet.java
+++ b/modules/tools/src/main/java8/org/apache/ignite/tools/javadoc/IgniteLinkTaglet.java
@@ -18,12 +18,7 @@
package org.apache.ignite.tools.javadoc;
import com.sun.javadoc.Tag;
-import com.sun.source.doctree.DocTree;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import javax.lang.model.element.Element;
-import jdk.javadoc.doclet.Taglet;
+import com.sun.tools.doclets.Taglet;
import java.io.File;
import java.util.Map;
@@ -43,56 +38,48 @@ public class IgniteLinkTaglet implements Taglet {
return NAME;
}
- @Override public String toString(List<? extends DocTree> tags, Element element) {
- return null;
- }
-
/**
* @return true since this tag can be used in a field doc comment.
*/
- public boolean inField() {
+ @Override public boolean inField() {
return true;
}
/**
* @return true since this tag can be used in a constructor doc comment.
*/
- public boolean inConstructor() {
+ @Override public boolean inConstructor() {
return true;
}
/**
* @return true since this tag can be used in a method doc comment.
*/
- public boolean inMethod() {
+ @Override public boolean inMethod() {
return true;
}
/**
* @return true since this tag can be used in an overview doc comment.
*/
- public boolean inOverview() {
+ @Override public boolean inOverview() {
return true;
}
/**
* @return true since this tag can be used in a package doc comment.
*/
- public boolean inPackage() {
+ @Override public boolean inPackage() {
return true;
}
/**
* @return true since this.
*/
- public boolean inType() {
+ @Override public boolean inType() {
return true;
}
- @Override public Set<Location> getAllowedLocations() {
- return new HashSet<>();
- }
-
/**
* Will return true since this is an inline tag.
*
@@ -129,13 +116,13 @@ public class IgniteLinkTaglet implements Taglet {
*
* @param tag <code>Tag</code> representation of this custom tag.
*/
- public String toString(Tag tag) {
+ @Override public String toString(Tag tag) {
if (tag.text() == null || tag.text().isEmpty())
return "";
File f = tag.position().file();
- String curClass = f == null ? "" : f.getAbsolutePath().replace(File.separator, ".");
+ String curClass = f == null ? "" : f.getAbsolutePath().replace(File.separator, "");
String packPref = "src.main.java.";
@@ -157,11 +144,11 @@ public class IgniteLinkTaglet implements Taglet {
String simpleClsName = lastIdx != -1 && lastIdx + 1 < tokens[0].length() ?
tokens[0].substring(lastIdx + 1) : tokens[0];
- String fullyQClsName = tokens[0].replace(".", "/");
+ String fullyQClsName = tokens[0].replace("", "/");
return "<a href=\"" + path.toString() + fullyQClsName + ".html" +
(tokens.length > 1 ? ("#" + tokens[1].replace("[]", "...")) : "") +
- "\"><code>" + simpleClsName + (tokens.length > 1 ? ("." + tokens[1]) : "") + "</code></a>";
+ "\"><code>" + simpleClsName + (tokens.length > 1 ? ("" + tokens[1]) : "") + "</code></a>";
}
/**
@@ -171,7 +158,7 @@ public class IgniteLinkTaglet implements Taglet {
*
* @param tags the array of <code>Tag</code>s representing of this custom tag.
*/
- public String toString(Tag[] tags) {
+ @Override public String toString(Tag[] tags) {
return null;
}
}
\ No newline at end of file