LUCENE-4493: Autodetect Java versions and JVM before linting javadocs

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1400053 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2012-10-19 11:52:20 +00:00
parent 5455c64a19
commit fd1200c1c7
1 changed files with 28 additions and 17 deletions

View File

@ -62,13 +62,33 @@
</sequential> </sequential>
</target> </target>
<target name="documentation-lint" description="Validates the generated documentation (HTML errors, broken links,...)"> <target name="documentation-lint" depends="-documentation-lint,-documentation-lint-unsupported"
<sequential> description="Validates the generated documentation (HTML errors, broken links,...)"/>
<condition property="documentation-lint.supported">
<and>
<or>
<contains string="${java.vm.name}" substring="hotspot" casesensitive="false"/>
<contains string="${java.vm.name}" substring="openjdk" casesensitive="false"/>
<contains string="${java.vm.name}" substring="jrockit" casesensitive="false"/>
</or>
<or>
<equals arg1="${ant.java.version}" arg2="1.6"/>
<equals arg1="${ant.java.version}" arg2="1.7"/>
<equals arg1="${ant.java.version}" arg2="1.8"/>
</or>
</and>
</condition>
<target name="-documentation-lint" if="documentation-lint.supported">
<subant target="documentation-lint" inheritall="false" failonerror="true"> <subant target="documentation-lint" inheritall="false" failonerror="true">
<fileset dir="lucene" includes="build.xml" /> <fileset dir="lucene" includes="build.xml" />
<fileset dir="solr" includes="build.xml" /> <fileset dir="solr" includes="build.xml" />
</subant> </subant>
</sequential> </target>
<target name="-documentation-lint-unsupported" unless="documentation-lint.supported">
<echo level="warning" message="WARN: Linting documentation is not supported on this Java version (${ant.java.version}) / JVM (${java.vm.name}). Nothing done!"/>
</target> </target>
<target name="validate" description="Validate dependencies, licenses, etc." depends="-validate-source-patterns"> <target name="validate" description="Validate dependencies, licenses, etc." depends="-validate-source-patterns">
@ -359,18 +379,9 @@
</target> </target>
<!-- Jenkins tasks --> <!-- Jenkins tasks -->
<target name="jenkins-hourly" depends="clean,test-with-heapdumps,validate,-jenkins-documentation-lint,jar-checksums,check-svn-working-copy"/> <target name="jenkins-hourly" depends="clean,test-with-heapdumps,validate,documentation-lint,jar-checksums,check-svn-working-copy"/>
<target name="jenkins-maven-nightly" depends="clean,remove-maven-artifacts,run-maven-build,generate-maven-artifacts,validate-maven-dependencies"/> <target name="jenkins-maven-nightly" depends="clean,remove-maven-artifacts,run-maven-build,generate-maven-artifacts,validate-maven-dependencies"/>
<target name="jenkins-clover" depends="run-clover"/> <target name="jenkins-clover" depends="run-clover"/>
<!-- we need this extra condition, as we want to match only on "true", not solely if property is set: -->
<property name="disable.documentation-lint" value="false" />
<condition property="-disable.documentation-lint">
<istrue value="${disable.documentation-lint}"/>
</condition>
<target name="-jenkins-documentation-lint" unless="-disable.documentation-lint">
<antcall target="documentation-lint"/>
</target>
</project> </project>