Apply jruby plugin only to main asciidoctorj module instead of all
MODIFY
asciidoctorj-core/build.gradle
asciidoctorj-core/build.gradle
apply plugin: 'java-library'
apply plugin: 'groovy'
apply plugin: 'biz.aQute.bnd.builder'
+apply plugin: 'com.github.jruby-gradle.base'
project.ext.publicationName = "mavenAsciidoctorJ"
apply from: rootProject.file('gradle/publish.gradle')
apply from: rootProject.file('gradle/signing.gradle')
+repositories {
+ ruby.gems()
+}
+
dependencies {
api project(path: ':asciidoctorj-api')
api "org.jruby:jruby:$jrubyVersion"
@@ -38,6 +43,8 @@ def gemFiles = fileTree("${project.buildDir}/.gems") {
include "gems/asciidoctor-*/data/**"
}
+apply from: rootProject.file('gradle/versioncheck.gradle')
+
jrubyPrepare {
doLast {
copy { // bundles the gems inside this artifact
@@ -46,6 +53,32 @@ jrubyPrepare {
}
}
}
+tasks.eclipse.dependsOn jrubyPrepare
+
+
+jruby {
+ defaultRepositories = false
+ defaultVersion = jrubyVersion
+ // TODO I'd like to be able to customize the name of the gemInstallDir
+}
+
+ext {
+ // path to use for the prepared jruby gems
+ preparedGems = new File("$buildDir/preparedGems")
+}
+
+sourceSets {
+ main {
+ //let's register an output folder on the main SourceSet:
+ output.dir(preparedGems, builtBy: 'jrubyPrepare')
+ //it is now a part of the 'main' classpath and will be a part of the jar
+ }
+}
+
+// QUESTION is this the right place to insert this task dependency in the lifecycle?
+// IMPORTANT The TMP or TEMP environment variable must be set for the gem install command to work on Windows
+processResources.dependsOn jrubyPrepare
+
javadoc {
classpath = sourceSets.main.output + sourceSets.main.compileClasspath + project(':asciidoctorj-test-support').sourceSets.test.output

MODIFY
build.gradle
build.gradle
@@ -185,10 +185,6 @@ subprojects {
}
-configure(subprojects.findAll { !it.isDistribution() && it.name != 'asciidoctorj-api' && it.name != 'asciidoctorj-documentation' && it.name != 'asciidoctorj-test-support' && it.name != 'asciidoctorj-arquillian-extension' && !isIntegrationTestProject(it) }) {
- apply from: rootProject.file('gradle/versioncheck.gradle')
-}
-
boolean isIntegrationTestProject(def project) {
project.name in ['asciidoctorj-wildfly-integration-test',
'asciidoctorj-springboot-integration-test',
@@ -198,17 +194,9 @@ boolean isIntegrationTestProject(def project) {
// apply JRuby and sources/javadocs packaging stuff for all subprojects except the distribution
configure(subprojects.findAll { !it.isDistribution() }) {
- apply plugin: 'com.github.jruby-gradle.base'
apply from: rootProject.file('gradle/eclipse.gradle')
apply plugin: 'idea'
- jruby {
- defaultRepositories false
- }
-
- repositories {
- ruby.gems()
- }
javadoc {
// Oracle JDK8 likes to fail the build over spoiled HTML
@@ -224,26 +212,4 @@ configure(subprojects.findAll { !it.name.endsWith('-distribution') && ! it.name.
withSourcesJar()
}
- jruby {
- defaultRepositories = false
- defaultVersion = jrubyVersion
- // TODO I'd like to be able to customize the name of the gemInstallDir
- }
-
- ext {
- // path to use for the prepared jruby gems
- preparedGems = new File("$buildDir/preparedGems")
- }
-
- sourceSets {
- main {
- //let's register an output folder on the main SourceSet:
- output.dir(preparedGems, builtBy: 'jrubyPrepare')
- //it is now a part of the 'main' classpath and will be a part of the jar
- }
- }
-
- // QUESTION is this the right place to insert this task dependency in the lifecycle?
- // IMPORTANT The TMP or TEMP environment variable must be set for the gem install command to work on Windows
- processResources.dependsOn jrubyPrepare
}

MODIFY
gradle/eclipse.gradle
gradle/eclipse.gradle
apply plugin: 'eclipse'
-tasks.eclipse.dependsOn jrubyPrepare
eclipse {
classpath {
defaultOutputDir = file('build/eclipse')

Apply jruby plugin only to main asciidoctorj module instead of all