|
| 1 | +<!-- |
| 2 | + Copyright 2018 The Error Prone Authors. |
| 3 | +
|
| 4 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + you may not use this file except in compliance with the License. |
| 6 | + You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | + Unless required by applicable law or agreed to in writing, software |
| 11 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + See the License for the specific language governing permissions and |
| 14 | + limitations under the License. |
| 15 | + --> |
| 16 | +<project name="error prone example" default="compile"> |
| 17 | + <target name="compile"> |
| 18 | + <delete dir="build"/> |
| 19 | + <mkdir dir="build"/> |
| 20 | + |
| 21 | + <property name="error_prone_core.jar" location="${user.home}/.m2/repository/com/google/errorprone/error_prone_core/2.3.2-SNAPSHOT/error_prone_core-2.3.2-SNAPSHOT-with-dependencies.jar"/> |
| 22 | + <property name="jformatstring.jar" location="${user.home}/.m2/repository/com/google/code/findbugs/jFormatString/3.0.0/jFormatString-3.0.0.jar"/> |
| 23 | + <property name="javac.jar" location="${user.home}/.m2/repository/com/google/errorprone/javac/9+181-r4173-1/javac-9+181-r4173-1.jar"/> |
| 24 | + |
| 25 | + <!-- using github.com/google/error-prone-javac is required when running on JDK 8 --> |
| 26 | + <condition property="patch.javac" value="-XDempty" else="-J-Xbootclasspath/p:${javac.jar}"> |
| 27 | + <javaversion atleast="9"/> |
| 28 | + </condition> |
| 29 | + |
| 30 | + <javac srcdir="src" destdir="build" fork="yes" includeantruntime="no"> |
| 31 | + <compilerarg value="${patch.javac}"/> |
| 32 | + <compilerarg line="-XDcompilePolicy=simple"/> |
| 33 | + <compilerarg line="-processorpath ${error_prone_core.jar}:${jformatstring.jar}"/> |
| 34 | + <compilerarg value="-Xplugin:ErrorProne -Xep:DeadException:ERROR" /> |
| 35 | + </javac> |
| 36 | + </target> |
| 37 | +</project> |
0 commit comments