klaas1979 / ivy4r Goto Github PK
View Code? Open in Web Editor NEWApache Ivy wrapper for Ruby.
Apache Ivy wrapper for Ruby.
Using an Ivy-Configuration for the package-task will overwrite everything additionally added.
ivy.conf :package => 'prod'
package(:war).with :libs => project('client')
Will only add the prod-libs to the war, the client-artifacts will be ignored.
If you don't set any publish options, ivy4r's buildr extension will throw an exception like this when you invoke {project}:ivy:publish
:
undefined method `*' for nil:NilClass
/Users/rsutphin/.rvm/gems/jruby-1.4.0@buildr/gems/ivy4r-0.10.5/lib/buildr/ivy_extension.rb:201:in `__publish__'
/Users/rsutphin/.rvm/gems/jruby-1.4.0@buildr/gems/ivy4r-0.10.5/lib/buildr/ivy_extension.rb:728:in `after_define'
If the default options are never sufficient, it would be nice if ivy4r would tell you that you need to set publish options rather than failing in this way.
With buildr 1.3.5 and ivy4r 0.10.5, I'm seeing an exception whenever I do ivy:resolve
. I put a minimal sample project as a gist. The trace output for the exception is there, but here's the short version:
[ivy_resolve] :: resolution report :: resolve 128ms :: artifacts dl 4ms
---------------------------------------------------------------------
| | modules || artifacts |
| conf | number| search|dwnlded|evicted|| number|dwnlded|
---------------------------------------------------------------------
| compile | 1 | 0 | 0 | 0 || 2 | 0 |
---------------------------------------------------------------------
Buildr aborted!
Fail: unknown method name `map'
If you have a buildr project with nested projects, ivy4r seems to always use the ivy.xml
for the root project, even if the child has its own. A sample project to demonstrate.
Line 9 of the output shows the problem:
child ivy module: sample
The expected output would be
child ivy module: child
There is another use of java-via-JRuby code in ivy/target.rb on line 155, preventing ivy4r from being used on MRI:
undefined method `to_string' for ["compile", "runtime", "unit-test"]:Array
/Users/rsutphin/.rvm/gems/ruby-1.8.6-p383/gems/ivy4r-0.11.0/lib/ivy/target.rb:155:in `java_map_to_ruby_hash'
/Users/rsutphin/.rvm/gems/ruby-1.8.6-p383/gems/ivy4r-0.11.0/lib/ivy/target.rb:146:in `ant_references'
/Users/rsutphin/.rvm/gems/ruby-1.8.6-p383/gems/ivy4r-0.11.0/lib/ivy/cachepath.rb:20:in `create_return_values'
/Users/rsutphin/.rvm/gems/ruby-1.8.6-p383/gems/ivy4r-0.11.0/lib/ivy/target.rb:62:in `execute_target'
/Users/rsutphin/.rvm/gems/ruby-1.8.6-p383/gems/ivy4r-0.11.0/lib/ivy/target.rb:33:in `execute'
/Users/rsutphin/.rvm/gems/ruby-1.8.6-p383/gems/ivy4r-0.11.0/lib/ivy4r.rb:145:in `cachepath'
/Users/rsutphin/.rvm/gems/ruby-1.8.6-p383/gems/ivy4r-0.11.0/lib/buildr/ivy_extension.rb:125:in `deps'
/Users/rsutphin/.rvm/gems/ruby-1.8.6-p383/gems/ivy4r-0.11.0/lib/buildr/ivy_extension.rb:406:in `filter'
/Users/rsutphin/.rvm/gems/ruby-1.8.6-p383/gems/ivy4r-0.11.0/lib/buildr/ivy_extension.rb:529:in `add_ivy_deps_to_java_tasks'
If you package a war with a type:
package(:war)
everything is fine. but when the type should be infered by the filename
package(:file => "somewar.war")
all the libs are missing
https://issues.apache.org/jira/browse/BUILDR-494
Is this a buildr issue or an ivy4r issue?
This works:
ivy.ivy4r.property['ivy.home'] = path_to('lib')
but shouldn't this also work?:
ivy.ivy4r.property['ivy.lib.dir'] = path_to('lib')
I want a folder with the jars not the whole ivy cache
In certain circumstances, ivy4r will raise this exception during ivy:resolve
:
Buildr aborted!
undefined methodsize' for nil:NilClass /Users/rsutphin/.rvm/gems/jruby-1.4.0@buildr/gems/ivy4r-0.10.5/lib/buildr/ivy_extension.rb:164:in
resolve'
/Users/rsutphin/.rvm/gems/jruby-1.4.0@buildr/gems/ivy4r-0.10.5/lib/buildr/ivy_extension.rb:720:in `after_define'
From inspecting the code in ivy_extension.rb, it appears that this will happen when you have two buildr projects with a parent-child relationship where both of them have ivy.xmls.
Buildr::Ivy::IvyConfig#enabled?
is implemented such that it will always return true. This is a side effect of using ||
for a default value:
nil || true # => true
false || true # => also true
When the defaultable value is boolean, you need to explictly check whether the setting is nil before using the default value:
@enabled ||= Ivy.setting('enabled').nil? ? true : Ivy.setting('enabled')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.