Skip to content

Commit

Permalink
Apply jruby plugin only to main asciidoctorj module instead of all
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpanzer committed Apr 9, 2022
1 parent cb8659a commit 3cba0cf
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 35 deletions.
33 changes: 33 additions & 0 deletions asciidoctorj-core/build.gradle
@@ -1,12 +1,17 @@
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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
34 changes: 0 additions & 34 deletions build.gradle
Expand Up @@ -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',
Expand All @@ -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
Expand All @@ -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
}
1 change: 0 additions & 1 deletion gradle/eclipse.gradle
@@ -1,6 +1,5 @@
apply plugin: 'eclipse'

tasks.eclipse.dependsOn jrubyPrepare
eclipse {
classpath {
defaultOutputDir = file('build/eclipse')
Expand Down

0 comments on commit 3cba0cf

Please sign in to comment.