Commit da73a605 authored by John Zhang's avatar John Zhang

[pmd] properly require JDK 7

parent e7e1ee86
......@@ -40,12 +40,17 @@
<!-- set up toolchains.xml for Maven -->
<property name="mvn-toolchains-xml" value="${bm-build-top}/toolchains.xml"/>
<exec executable="${bm-files}/mvn_toolchain_setup.sh">
<arg line="${mvn-toolchains-xml}"/>
<arg value="${mvn-toolchains-xml}"/>
<arg value="${jdk7home}"/>
</exec>
<!-- execute Maven in build directory -->
<exec dir="${bm-build-top}" executable="${mvn-exe}">
<arg line="-B --global-toolchains ${mvn-toolchains-xml} -Dmaven.test.skip=true clean package"/>
<arg value="-B"/>
<arg line="--global-toolchains ${mvn-toolchains-xml}"/>
<arg value="-Dmaven.test.skip=true"/>
<arg line="-pl pmd-core,pmd-apex,pmd-java,pmd-dist"/>
<arg line="clean package"/>
</exec>
<!-- unpacks produced zip file -->
......
......@@ -7,14 +7,23 @@ extract_java_version() {
if [ ! -e $1 ]; then
jver=$(extract_java_version)
if [ $jver -ge 8 ]; then
if [ $jver -eq 8 ]; then
cat > $1 <<- EOM
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>1.$jver</version>
<version>1.7</version>
</provides>
<configuration>
<jdkHome>$2</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>1.8</version>
</provides>
<configuration>
<jdkHome>$JAVA_HOME</jdkHome>
......@@ -23,7 +32,7 @@ if [ ! -e $1 ]; then
</toolchains>
EOM
else
echo "PMD benchmark needs Java >= 1.8!" >> /dev/stderr
echo "Building PMD benchmark needs Java 8!" >> /dev/stderr
exit 1
fi
fi
\ No newline at end of file
......@@ -17,4 +17,5 @@ build.failonerror=true
# building tradebeans & tradesoap requires JDK 7
# (Geronimo deployment requirement)
# building PMD also requires JDK 7
jdk7home=/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment