How do I get tag build-0.7.478 built in Windows 7?

I am running into an issue while building from source on a Windows 7 64-Bit machine.

I checked out the tag build-0.7.478 using Git.

At first I was using Java 7(jdk1.7.0_51) and Apache Ant 1.9.3 which did not work when trying to run

$ ant -f build.xml

I tried a couple different variations and was finally successfully using Java 6(jdk1.6.0_45) and Apache Ant 1.8.0.  I then tried

$ cd libraries

$ mvn install

Which failed on the kotlin-js-tests project.  I attached to this question a trimmed down version of a log file generated while failing maven command.

I traced down what I think to be the culprit, which is:

https://github.com/JetBrains/kotlin/blob/build-0.7.478/libraries/tools/kotlin-stdlib-gen/src/generators/GenerateJavaScriptStubs.kt#L59-L73

The println containing a block quote is not correctly printing Windows formatted EOL characters in the generated files:

jsjs.librariessrccoredomEvents.kt
jsjs.librariessrccoredom.kt

Has anyone run into this issue before while building on Windows?



mvn_install_snippet.log.zip (1.72 KB)

What went wrong with "ant build -f build.xml"?

Try please update to current master.

Please let us know if it doesn’t fix your issue and feel free to ask any questions.

bashor wrote:

Try please update to current master.

Please let us know if it doesn’t fix your issue and feel free to ask any questions.

Hi bashor,  I synced with the lastest in master and was able to build everything successfully(ant build and maven install). I saw your commit.  Thank you for implementing that.

abreslav wrote:

What went wrong with “ant build -f build.xml”?

Hi Andrey, I have gotten the master branch build to work with java version “1.6.0_45” and Ant 1.8.0.  When I get more time I will retry it with JDK 7 and Ant 1.9.3.  I looked at the log from my first attempt and unfortunately it only captured stdout so the error was not there.  I will keep you appraised of my findings.

Side note; is JDK 8 supported?  When I tried to use JDK 8, IIRC the proguard Ant task complained that the max version supported was Java 7.

Message was edited by: Peter Colapietro for grammar, and spelling.

bashor made an update to the master branch that solved my issue running the Maven under libraries.

Message was edited by: Peter Colapietro.  Edited original wording because there were two separate issues in my initial question(ant build, maven build).  bashor’s changes fixed the issue I had with maven, and I clarified that with this edit.

abreslav wrote:

What went wrong with “ant build -f build.xml”?

Hi Andrey,  I tried building the master branch using the versions of Java and Ant I had originally attempted to build Kotlin with:

$ java -version

java version "1.7.0_55"

Java(TM) SE Runtime Environment (build 1.7.0_55-b13)

Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

$ ant -version

Apache Ant(TM) version 1.9.3 compiled on December 23 2013

STR what went wrong:

$ ant -f update_dependencies.xml

...full ant output omited for brevities sake...

BUILD SUCCESSFUL

Total time: 3 minutes 46 seconds

$ ant -f build.xml

...again full ant output omited for brevity...

BUILD FAILED

D:GitHubkotlinbuild.xml:242: java.lang.NoSuchMethodError: com.google.common.io.ByteStreams.limit(Ljava/io/InputStream;J)Ljava/io/InputStream;

  at com.google.javascript.jscomp.CommandLineRunner.getDefaultExterns(CommandLineRunner.java:939)

  at com.google.javascript.jscomp.ant.CompileTask.getDefaultExterns(CompileTask.java:532)

  at com.google.javascript.jscomp.ant.CompileTask.findExternFiles(CompileTask.java:470)

  at com.google.javascript.jscomp.ant.CompileTask.execute(CompileTask.java:285)

  at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)

  at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)

  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

  at java.lang.reflect.Method.invoke(Method.java:606)

  at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

  at org.apache.tools.ant.Task.perform(Task.java:348)

  at org.apache.tools.ant.Target.execute(Target.java:435)

  at org.apache.tools.ant.Target.performTasks(Target.java:456)

  at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)

  at org.apache.tools.ant.Project.executeTarget(Project.java:1364)

  at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)

  at org.apache.tools.ant.Project.executeTargets(Project.java:1248)

  at org.apache.tools.ant.Main.runBuild(Main.java:851)

  at org.apache.tools.ant.Main.startAnt(Main.java:235)

  at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)

  at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Total time: 1 minute 56 seconds

I attached the failure output snippet as a log file as well.

It seems that Ant 1.9.3 was the issue. When I used 1.9.2, Kotlin built successfully:

$ ant -version

Apache Ant(TM) version 1.9.2 compiled on July 8 2013

$ java -version

java version "1.7.0_55"

Java(TM) SE Runtime Environment (build 1.7.0_55-b13)

Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

$ ant -f build.xml

... b/c  brevity...

BUILD SUCCESSFUL

Total time: 2 minutes 3 seconds

Message was edited by: Peter Colapietro.  renamed attachment from 1.7.0_55.log to ant_1_9_3.log to avoid confusion as Java 7 seems to have nothing to do with the issue.



ant_1_9_3.log.zip (733 Bytes)

Thanks for the details. Glad you've figured it out

Hi, Peter

Could You try

  1. insert in second line of build.xml:
      <echo message=“CLASSPATH = ${java.class.path}”/>

2 run ant 1.9.3 on java 7 by:
  ant -f build.xml jslib

  1. run ant 1.9.3 on java 7 by:
      ant -f -noclasspath build.xml jslib

and tell as results.

Thanks.

Hi bashor,

I compared the echoed classpath of both the 1.9.2 and 1.9.3 executions of

ant -f build.xml jslib

and noticed that I had an extra jar in the 1.9.3 version of %ANT_HOME%lib

sonar-ant-task-2.1.jar

I removed this file from the 1.9.3 version of %ANT_HOME%lib and the build was successful.  I can include all my results, however as I have solved the issue and documented the relevant parts I think anything more would be superfluous.  Thanks for all your help.

Thanks for the results.