I tried to apply the base + WAR plugins to my Gradle 2.1+ Rails project a few different ways, mostly without success. The only way I convinced it to work was as follows, but it doesn't seem right - it looks like I am making up for an undeclared dependency in one of your plugins, but obviously I can only do that by using the old Gradle syntax where you can put a plugin on the classpath but never apply it.
It is also not clear which of the many plugins a user of your code should apply - are the com.github plugins only hosted so that they can be downloaded by dependent plugins? Is com.lookout.jruby the standalone packaged version? Or do I need to declare the base + war plugins because the war plugin does not specify its dependencies internally?
Way that works
- use old Gradle syntax
- require War plugin + com.lookout.jruby plugin on classpath
- but only apply the com.lookout.jruby plugin
buildscript {
repositories { jcenter() }
dependencies {
classpath "com.lookout:jruby-gradle-plugin:2.1.0"
classpath "com.github.jruby-gradle:jruby-gradle-war-plugin:0.1.1"
}
}
// Base tasks for using Jruby with Gradle
apply plugin: "com.lookout.jruby"
Ways that do not work
Use new Gradle syntax, use com.github.jruby-gradle plugins
plugins {
id "maven"
id "com.github.jruby-gradle.base" version "0.1.2"
id "com.github.jruby-gradle.war" version "0.1.1"
}
This fails because it cannot source a dependency in com.lookout.warbler-bootstrap.
Use new Gradle syntax, use com.lookout.jruby plugin
plugins {
id "com.lookout.jruby" version "2.1.0"
}
This fails because it cannot source the jrubyWar related packaging tasks which are located in the war plugin.
Use new Gradle syntax, use com.lookout.jruby + war plugin
plugins {
id "com.lookout.jruby" version "2.1.0"
id "com.github.jruby-gradle.war" version "0.1.1"
}
This fails because it attempts to apply the war plugin, which in turn applies the base plugin, which then conflicts with the 'jruby' task which has already been defined in 'com.lookout.jruby'.