Skip to content

Commit

Permalink
Make ant example's path handling work on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
cushon committed Sep 14, 2018
1 parent daf4cf2 commit 2e0d95a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,24 @@ Download the following artifacts from maven:
and add the following javac task to your project's `build.xml` file:

```xml
<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"/>
<property name="jformatstring.jar" location="${user.home}/.m2/repository/com/google/code/findbugs/jFormatString/3.0.0/jFormatString-3.0.0.jar"/>
<property name="javac.jar" location="${user.home}/.m2/repository/com/google/errorprone/javac/9+181-r4173-1/javac-9+181-r4173-1.jar"/>
<property name="javac.jar" location="${user.home}/.m2/repository/com/google/errorprone/javac/9+181-r4173-1/javac-9+181-r4173-1.jar"/>

<!-- using github.com/google/error-prone-javac is required when running on JDK 8 -->
<condition property="jdk9orlater">
<javaversion atleast="9"/>
</condition>

<path id="processorpath.ref">
<pathelement 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"/>
<pathelement location="${user.home}/.m2/repository/com/google/code/findbugs/jFormatString/3.0.0/jFormatString-3.0.0.jar"/>
<!-- Add annotation processors and Error Prone custom checks here if needed -->
</path>

<javac srcdir="src" destdir="build" fork="yes" includeantruntime="no">
<compilerarg value="-J-Xbootclasspath/p:${javac.jar}" unless:set="jdk9orlater"/>
<compilerarg line="-XDcompilePolicy=simple"/>
<compilerarg line="-processorpath ${error_prone_core.jar}:${jformatstring.jar}"/>
<compilerarg value="-processorpath"/>
<compilerarg pathref="processorpath.ref"/>
<compilerarg value="-Xplugin:ErrorProne -Xep:DeadException:ERROR" />
</javac>
</target>
Expand Down

0 comments on commit 2e0d95a

Please sign in to comment.