Coder Social home page Coder Social logo

annawinkler / jbundler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mkristian/jbundler

0.0 2.0 0.0 2.65 MB

bundler support for jars for jruby

License: MIT License

Ruby 85.82% Java 0.29% JavaScript 0.53% CoffeeScript 0.17% CSS 1.51% HTML 1.33% Shell 5.68% Batchfile 4.67%

jbundler's Introduction

jbundler

  • Build Status #

manage jar dependencies similar to how bundler manages gem dependencies:

  • the DSL mimics the one from bundler
  • you can use maven-like version declarations or rubygems/bundler version ranges
  • it locks down the jar versions inside "Jarfile.lock"
  • you can declare jar dependencies within a gem using the requirements directive of the gem specification. jbundler will include those jar dependencies into its classpath

differences compared to bundler

  • it is just a development gem - no need for it during runtime. just add Jars.require_jars_lock! to your code and for older JRuby versions add gem 'jar-dependencies', '~> 0.1.11' as a runtime dependency.
  • you need to run bundle install first if any of the gems have jar dependencies.
  • all one command jbundle, see jbundle --help on the possible options and how to update a single jar, etc.

get started

install JBundler with

jruby -S gem install jbundler

first create a Jarfile, something like:

jar 'org.yaml:snakeyaml', '1.14'
jar 'org.slf4j:slf4j-simple', '>1.1'

Jarfile

more info about the Jarfile and about versions.

for adding a maven repository see Jarfile.

Building the jbundler gem

running the integration test

./mvnw verify

building the gem (see ./pkg)

./mvnw package -Dinvoker.skip

or just

gem build jbundler.gemspec

example

src/example/my_project has a Gemfile which uses a gem which depends on jar dependency. see src/example/gem_with_jar/gem_with_jar.gemspec how the jar gets declared.

execute src/example/my_project/info.rb to see it in action:

  cd src/example/my_project
  jbundle install
  bundle exec info.rb

limitations

since the version resolution happens in two steps - first the gems then the jars/poms - it is possible in case of a failure that there is a valid gems/jars version resolution which satisfies all version contraints. so there is plenty of space for improvements (like maven could resolve the gems as well, etc)

special thanks

the whole project actually started with a controversial discussion on a pull request on bundler. this very same pull request were the starting point of that project here. probably by now there is no much left of the original code but many thanks to ANithian for given the seed of that project.

License

Almost all code is under the MIT license but the java class (AetherSettings.java)[https://github.com/mkristian/jbundler/blob/master/src/main/java/jbundler/AetherSettings.java] which was derived from EPL licensed code.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

meta-fu

enjoy :)

jbundler's People

Contributors

mkristian avatar rosenfeld avatar atambo avatar arthurkalm-otpp avatar camertron avatar docwhat avatar xian avatar rmontgomery429 avatar

Watchers

James Cloos avatar Anna Rajendran avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.