Hi again,
ignore my last mail. try this buildscript:
--------
apply(plugin:'java')
buildscript {
repositories {
mavenCentral()
mavenRepo(urls:'http://google-gson.googlecode.com/svn/mavenrepo')
}
dependencies {
classpath('com.google.code.gson:gson:1.4')
}
}
task testGson<< {
gson = new com.google.gson.Gson()
map = [a:'aaa',i:123,o:new Object()]
println(gson.toJson(map))
}
--------
Running this script via gradle testGson throws an
IllegalArgumentException: "condition failed: false" I'm not familiar
with the Gson lib, but I think it's a pure Gson usage error.
regards
René
Am 20.06.10 19:57, schrieb saltnlight5:
Hello Steve, I am a new user, and I don't know where to add "buildscript{"
part. Do you mean that as my build.gradle script file, or actually add
"buildscript {" literally to my build.gradle file?
I have changed my script to this, and it still doesn't work:
apply(plugin:'java')
repositories {
mavenCentral()
mavenRepo(urls:'http://google-gson.googlecode.com/svn/mavenrepo')
}
dependencies {
classpath('com.google.code.gson:gson:1.4')
}
task testGson<< {
gson = new com.google.gson.Gson()
map = [a:'aaa',i:123,o:new Object()]
println(gson.toJson(map))
}
$ gradle testGson
FAILURE: Build failed with an exception.
* Where:
Build file '/home/zemian/source/myapp/build.gradle' line: 10
* What went wrong:
Could not compile build file '/home/zemian/source/myapp/build.gradle'.
Cause: startup failed:
build_gradle_64933bc2989646b749941b0b058be111: 10: unable to resolve class
com.google.gson.Gson
@ line 10, column 10.
gson = new com.google.gson.Gson()
^
1 error
* Try:
Run with -s or -d option to get more details. Run with -S option to get the
full (very verbose) stacktrace.
BUILD FAILED
Total time: 2.171 secs
-----
----
Zemian Deng
--
------------------------------------
Rene Groeschke
[email protected]
http://www.breskeby.com
http://twitter.com/breskeby
------------------------------------
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email