Hi all.
This week I started using gradle, not for first time, but from now on I
wan't to make it my primary and only build tool. It is great and I want to
thank all commiters for creating it. Good job.
Now please forgive me if following are noobie questions, but I wasn't been
able to find answer to those by myself. It is also hard for me to judge are
my problems bugs or only my lack of knowledge about Gradle.
1. When building my project (legacy app, standard mvn layout, flat dir
libs), I get a compilation error.
After investigating I found that application uses
com.sun.istack.internal.Nullable; and .Notnull; in several places.
What Gradle fails at is finding rt.jar in classpath (it comes with jre/lib
included to JDK).
Till today, application was build inside Intellij and from what I saw, after
providing path to JDK, IDE always adds rt.jar + couple of other libs to
classpath (as far as I remember eclipse does the same). Right now I see 3
workarounds to this issue:
a) Every developer will provide, in gradle configuration file, path to
rt.jar. (what is weird for me, even if I'll provide rt jar in following
manner compile files('C:/Program Files/Java/jdk1.6.0_23/jre/lib/rt.jar');
code is still not compiling, but if I'll add rt.jar to one of flat dir libs
inside project folder, then it works.)
b) I may remove all @notnull and @nullable annotations (would want to avoid
that. I don't like to modify something that I don't fully understand and
what works)
c) I may include rt.jar in one of project flat dir libs (ugliest of all, but
working, tested that one)
As it is not huge project, every option is valiable. But I'm curious is
there any 'Gradle way' to deal with that issue.
2. I was experimenting with Intellij support and found
http://felipecypriano.com/blog/2010/04/08/synchronizing-intellij-idea-dependencies-with-gradle/
this piece of code. What it does is generating xml file in .idea dir, that
tells IDE where to find libraries handled by Gradle.
It works great and allows me to migrate dependencies from flat dirs to build
script, however there is one issue. It takes path to gradle user home dir
directly from gradle object (project.gradle.gradleUserHomeDir) That returns
File which should produce system independent path, but it fails at this and
gives me something like C:\Documents and
Settings\mgruca\.gradle\cache\commons-lang\commons-lang\jars\commons-lang-2.5.jar!/.
My workaround is to use .toUri on file object, but that should not be a
final solution.
My machine: Windows XP sp3, gradle 0.9.2, jdk 6.0.20
Same issue on second machine with windows 7, gradle 0.9.2, jdk 6.0.23
As I really want to make my gradle script working, I'll probably be visiting
here more often with more questions ;)
Thanks again for greate tool and your hard work
Regards
MichaĆ Gruca
--
View this message in context:
http://gradle.1045684.n5.nabble.com/Odd-behaviour-tp3363331p3363331.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email