How do you build error-prone-javac

88 views
Skip to first unread message

John Edmonds

unread,
Jan 19, 2018, 4:49:59 PM1/19/18
to error-prone-discuss
I was trying to make some changes to https://github.com/google/error-prone-javac but it doesn't look like there are any instructions to compile the jar file used by error-prone. Does anyone know how to do it?

Eddie Aftandilian

unread,
Jan 22, 2018, 3:00:51 PM1/22/18
to error-pro...@googlegroups.com
I believe following the directions for upstream langtools will work:

Can you give that a try and and let us know?

On Fri, Jan 19, 2018 at 1:49 PM, John Edmonds <john.a....@gmail.com> wrote:
I was trying to make some changes to https://github.com/google/error-prone-javac but it doesn't look like there are any instructions to compile the jar file used by error-prone. Does anyone know how to do it?

--
Googlers: This an external list. Please be careful when posting.
---
You received this message because you are subscribed to the Google Groups "error-prone-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to error-prone-discuss+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/error-prone-discuss.
To view this discussion on the web visit https://groups.google.com/d/msgid/error-prone-discuss/f67752dc-548e-4612-9e92-43ee56a1a603%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Edmonds

unread,
Jan 22, 2018, 4:58:42 PM1/22/18
to error-prone-discuss
Thanks for the reply!

I tried that and got
Target "build-javac" does not exist in the project "langtools".

So what I've found so far:

I guess the more specific question is how was the jar for http://www.mvnrepository.com/artifact/com.google.errorprone/javac/9-dev-r4023-1 produced?

Eddie Aftandilian

unread,
Jan 22, 2018, 7:53:22 PM1/22/18
to error-pro...@googlegroups.com
OK, I looked into this and found the commands we use to build.  The exact commands change from version to version, but I can confirm that these commands successfully build a jar from the "9+181-r4173-1" branch on our Github repo.  This will leave a JAR in the current directory that should match what you see on Maven Central.  Note that you will need both a JDK8 and JDK9 to successfully build.  

VERSION=9+181-r4173-1
JDK8=<path_to_jdk_8>
JDK9=<path_to_jdk_9>
(
set -eux

ant -buildfile make/build.xml -Dboot.java.home=${JDK8} -Dlangtools.jdk.home=${JDK9} clean build
mkdir out
${JDK8}/bin/javac $(find build/gensrc/jdk.compiler/ -name '*.java') $(find src/java.compiler/share/classes/ -name '*.java' | grep -v module-info.java) $(find src/jdk.compiler/share/classes/ -name '*.java' | grep -v module-info.java | grep -v JavacToolProvider.java) -d out

cp -R ./src/jdk.compiler/share/classes/META-INF out/

(cd out && jar cvf0 ../javac-${VERSION}.jar .)
)



On Mon, Jan 22, 2018 at 1:58 PM, John Edmonds <john.a....@gmail.com> wrote:
Thanks for the reply!

I tried that and got
Target "build-javac" does not exist in the project "langtools".

So what I've found so far:

I guess the more specific question is how was the jar for http://www.mvnrepository.com/artifact/com.google.errorprone/javac/9-dev-r4023-1 produced?


On Monday, January 22, 2018 at 3:00:51 PM UTC-5, Eddie Aftandilian wrote:
I believe following the directions for upstream langtools will work:

Can you give that a try and and let us know?
On Fri, Jan 19, 2018 at 1:49 PM, John Edmonds <john.a....@gmail.com> wrote:
I was trying to make some changes to https://github.com/google/error-prone-javac but it doesn't look like there are any instructions to compile the jar file used by error-prone. Does anyone know how to do it?

--
Googlers: This an external list. Please be careful when posting.
---
You received this message because you are subscribed to the Google Groups "error-prone-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to error-prone-discuss+unsubscribe...@googlegroups.com.

--
Googlers: This an external list. Please be careful when posting.
---
You received this message because you are subscribed to the Google Groups "error-prone-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to error-prone-discuss+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/error-prone-discuss.

John Edmonds

unread,
Jan 23, 2018, 9:48:35 AM1/23/18
to error-prone-discuss
Thank you so much this is exactly what I wanted. I can confirm it generates the jar.
To unsubscribe from this group and stop receiving emails from it, send an email to error-prone-discuss+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/error-prone-discuss.
To view this discussion on the web visit https://groups.google.com/d/msgid/error-prone-discuss/f67752dc-548e-4612-9e92-43ee56a1a603%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages