sam / doubleshot

Build and Dependency Management for mixed Java/Ruby projects.
MIT License
19 stars 22 forks source link

What happens when your main-class is in Java? #9

Closed sam closed 12 years ago

sam commented 12 years ago

At first glance, it seems like you wouldn't ever do this. You'd always start your process with JRuby so that the classpaths could be setup properly.

What if you packaged your downstream project up as a JAR though? You'd use bootstrap.rb to require doubleshot (directly, or through the require() of your own source) I'd assume. But how do you ensure the Java classpath is correct? Does that happen by itself basically since the packaged JARs would be extracted to the same classpath? What about dependencies that have JARs? They'd be a Rubygem... which would mean you'd either need to package them, extract them into your JAR, or resolve them on deployment. (The last one being the current MO.)

This needs more thought.

sam commented 12 years ago

It can't be basically. Because if it were, you'd have to build the project before being able to execute it. And that's not how we roll.

Your main-class could be a Java class in a JAR. But then it wouldn't matter since the code is already built, and the Java dependencies are part of the JAR, so no class-path stuff to fiddle with. Also, since you're executing a Java main-class, you aren't executing a Minitest suite, so you wouldn't be calling the build hooks.

Case closed. Document this in the README and close this ticket.