Skip to content

Commit

Permalink
GG-19512 Build scaladoc only if javadoc profile is active (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlukhin committed Jun 17, 2019
1 parent d908c50 commit 390a6fb
Showing 1 changed file with 113 additions and 101 deletions.
214 changes: 113 additions & 101 deletions modules/scalar/pom.xml
Expand Up @@ -84,112 +84,124 @@

<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<executions>
<execution>
<id>scaladoc</id>
<phase>prepare-package</phase>
<goals>
<goal>doc</goal>
</goals>
<configuration>
<doctitle>Ignite Scalar</doctitle>
<windowtitle>Ignite Scalar</windowtitle>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<dependencies>
<dependency>
<groupId>org.gridgain</groupId>
<artifactId>ignite-tools</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>scaladoc-postprocessing</id>
<goals>
<goal>run</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<target>
<copy todir="target/site/scaladocs">
<fileset dir="../../assembly/docfiles">
<include name="img/**" />
<include name="*.js" />
</fileset>
</copy>

<taskdef name="doctask" classname="org.apache.ignite.tools.ant.beautifier.GridJavadocAntTask" />

<doctask css="dotted" dir="target/site/scaladocs" verify="false">
<include name="**/*.html" />
</doctask>

<property name="footer">
<![CDATA[
<table style="padding: 0px 10px 10px 10px; width: 100%" border="0">
<tr>
<td>
<nobr>Ignite&#153; - Scalar DSL, ver. <strong>${project.version}</strong></nobr>
<br>
<a target=_blank href="https://ignite.apache.org"><nobr>2019 Copyright &#169; Apache Software Foundation</nobr></a>
</td>
</tr>
</table>
]]>
</property>

<replace dir="target/site/scaladocs" token="&lt;!--FOOTER--&gt;" value="${footer}">
<include name="**/*.html" />
</replace>

<replace dir="target/site/scaladocs">
<replacetoken>src="package.html"</replacetoken>
<replacevalue>src=org/apache/ignite/scalar/scalar$.html</replacevalue>
<include name="**/index.html" />
</replace>

<replace dir="target/site/scaladocs">
<replacetoken>location.replace("package.html")</replacetoken>
<replacevalue>location.replace("org/apache/ignite/scalar/scalar$.html")</replacevalue>
<include name="**/index.js" />
</replace>

<replace dir="target/site/scaladocs">
<replacetoken>docs.scala-lang.org/overviews/scaladoc/usage.html#members</replacetoken>
<replacevalue>docs.scala-lang.org/overviews/scaladoc/interface.html</replacevalue>
<fileset dir="target/site/scaladocs" />
</replace>

<replaceregexp byline="true" flags="im" encoding="UTF-8">
<regexp pattern="(&lt;dt&gt;Attributes&lt;/dt&gt;&lt;dd&gt;protected\[)&lt;a.+&gt;(.+)&lt;/a&gt;(\]\s+&lt;/dd&gt;)" />
<substitution expression="\1\2\3" />
<fileset dir="target/site/scaladocs" />
</replaceregexp>

<zip destfile="target/ignite-scalar-${project.version}-javadoc.jar" basedir="target/site/scaladocs" encoding="UTF-8" />
</target>
</configuration>
</execution>
</executions>
</plugin>

<!-- Generate the OSGi MANIFEST.MF for this bundle. -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>

<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>javadoc</id>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<executions>
<execution>
<id>scaladoc</id>
<phase>prepare-package</phase>
<goals>
<goal>doc</goal>
</goals>
<configuration>
<doctitle>Ignite Scalar</doctitle>
<windowtitle>Ignite Scalar</windowtitle>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<dependencies>
<dependency>
<groupId>org.gridgain</groupId>
<artifactId>ignite-tools</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>scaladoc-postprocessing</id>
<goals>
<goal>run</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<target>
<copy todir="target/site/scaladocs">
<fileset dir="../../assembly/docfiles">
<include name="img/**" />
<include name="*.js" />
</fileset>
</copy>

<taskdef name="doctask" classname="org.apache.ignite.tools.ant.beautifier.GridJavadocAntTask" />

<doctask css="dotted" dir="target/site/scaladocs" verify="false">
<include name="**/*.html" />
</doctask>

<property name="footer">
<![CDATA[
<table style="padding: 0px 10px 10px 10px; width: 100%" border="0">
<tr>
<td>
<nobr>Ignite&#153; - Scalar DSL, ver. <strong>${project.version}</strong></nobr>
<br>
<a target=_blank href="https://ignite.apache.org"><nobr>2019 Copyright &#169; Apache Software Foundation</nobr></a>
</td>
</tr>
</table>
]]>
</property>

<replace dir="target/site/scaladocs" token="&lt;!--FOOTER--&gt;" value="${footer}">
<include name="**/*.html" />
</replace>

<replace dir="target/site/scaladocs">
<replacetoken>src="package.html"</replacetoken>
<replacevalue>src=org/apache/ignite/scalar/scalar$.html</replacevalue>
<include name="**/index.html" />
</replace>

<replace dir="target/site/scaladocs">
<replacetoken>location.replace("package.html")</replacetoken>
<replacevalue>location.replace("org/apache/ignite/scalar/scalar$.html")</replacevalue>
<include name="**/index.js" />
</replace>

<replace dir="target/site/scaladocs">
<replacetoken>docs.scala-lang.org/overviews/scaladoc/usage.html#members</replacetoken>
<replacevalue>docs.scala-lang.org/overviews/scaladoc/interface.html</replacevalue>
<fileset dir="target/site/scaladocs" />
</replace>

<replaceregexp byline="true" flags="im" encoding="UTF-8">
<regexp pattern="(&lt;dt&gt;Attributes&lt;/dt&gt;&lt;dd&gt;protected\[)&lt;a.+&gt;(.+)&lt;/a&gt;(\]\s+&lt;/dd&gt;)" />
<substitution expression="\1\2\3" />
<fileset dir="target/site/scaladocs" />
</replaceregexp>

<zip destfile="target/ignite-scalar-${project.version}-javadoc.jar" basedir="target/site/scaladocs" encoding="UTF-8" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 390a6fb

Please sign in to comment.