Skip to content

Commit

Permalink
Merge pull request #5 from robertpanzer/update-gradle
Browse files Browse the repository at this point in the history
Upgrade to Gradle 7 and publish to Nexus
  • Loading branch information
robertpanzer authored May 1, 2022
2 parents bff2403 + f0f10f7 commit f49653a
Show file tree
Hide file tree
Showing 11 changed files with 338 additions and 401 deletions.
23 changes: 6 additions & 17 deletions asciidoctorj-revealjs/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
dependencies {
testCompile ("org.asciidoctor:asciidoctorj:$asciidoctorJVersion") {
testImplementation ("org.asciidoctor:asciidoctorj:$asciidoctorJVersion") {
exclude group:'org.jruby'
}

testCompile "org.jruby:jruby-complete:$jrubyVersion"
testCompile "org.jsoup:jsoup:$jsoupVersion"
testImplementation "org.jruby:jruby-complete:$jrubyVersion"
testImplementation "org.jsoup:jsoup:$jsoupVersion"


gems("rubygems:asciidoctor-revealjs:5.0.0.rc1") {
Expand Down Expand Up @@ -33,18 +33,7 @@ jrubyPrepare {
}
}

ext.publicationName = "mavenAsciidoctorJRevealJs"

task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}
apply from: rootProject.file('gradle/publish.gradle')
apply from: rootProject.file('gradle/signing.gradle')
68 changes: 40 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@
we don't need to apply the jruby and bintray plugin on the rootProject.
*/
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.0.0"
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}

// modern plugins config
plugins {
id "signing"
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
id 'com.github.jruby-gradle.base' version '2.0.0'
}


// TIP use -PpublishRelease=true to active release behavior regardless of the version
status = project.hasProperty('publishRelease') && project.publishRelease.toBoolean() ?
'release' : ((version == 'unspecified' || version.endsWith('-SNAPSHOT')) ? 'snapshot' : 'release')
Expand All @@ -32,20 +35,19 @@ ext {
arquillianVersion = '1.1.10.Final'
arquillianSpockVersion = '1.0.0.Beta3'
commonsioVersion = '2.4'
groovyVersion = '2.1.8'
guavaVersion = '18.0'
hamcrestVersion = '1.3'
jrubyVersion = '9.1.17.0'
junitVersion = '4.12'
junitVersion = '4.13.2'
jsoupVersion = '1.12.1'
saxonVersion = '9.5.1-6'
spockVersion = '0.7-groovy-2.0'
xmlMatchersVersion = '1.0-RC1'
pdfboxVersion = '1.8.10'

// gem versions
asciidoctorJVersion = project.hasProperty('asciidoctorJVersion') ? project.asciidoctorJVersion : '2.2.0'
asciidoctorJDiagramVersion = project.hasProperty('asciidoctorJDiagramVersion') ? project.asciidoctorJDiagramVersion : '2.0.0'
asciidoctorJVersion = project.hasProperty('asciidoctorJVersion') ? project.asciidoctorJVersion : '2.5.3'
asciidoctorJDiagramVersion = project.hasProperty('asciidoctorJDiagramVersion') ? project.asciidoctorJDiagramVersion : '2.2.1'
asciidoctorRevealJsGemVersion = project.hasProperty('asciidoctorRevealJsGemVersion') ? project.asciidoctorRevealJsGemVersion : project(':asciidoctorj-revealjs').version.replace('-', '.')
threadSafeGemVersion = '0.3.6'

Expand All @@ -60,17 +62,8 @@ subprojects {
// NOTE applying Java plugin changes the status; take steps to preserve value
def _status = status
apply plugin: 'java'
apply plugin: 'groovy'
apply from: "$rootDir/gradle/providedConfiguration.gradle"

apply from: rootProject.file('gradle/signing.gradle')
if (!it.name.endsWith('itest')) {
apply from: rootProject.file('gradle/publish.gradle')
}
if (statusIsRelease) {
apply from: rootProject.file('gradle/deploy.gradle')
}

status = _status

// NOTE sourceCompatibility & targetCompatibility are set in gradle.properties to meet requirements of Gradle
Expand All @@ -93,18 +86,14 @@ subprojects {
mavenLocal()
}

jcenter()
mavenCentral()
}

dependencies {
testCompile "junit:junit:$junitVersion"
testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
testCompile("org.spockframework:spock-core:$spockVersion") {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
testCompile "org.codehaus.groovy:groovy-all:$groovyVersion"
testCompile "org.jboss.arquillian.junit:arquillian-junit-container:$arquillianVersion"
testCompile "org.jboss.arquillian.spock:arquillian-spock-container:$arquillianSpockVersion"
testImplementation "junit:junit:$junitVersion"
testImplementation "org.hamcrest:hamcrest-library:$hamcrestVersion"
testImplementation "org.jboss.arquillian.junit:arquillian-junit-container:$arquillianVersion"
testImplementation "org.jboss.arquillian.spock:arquillian-spock-container:$arquillianSpockVersion"

}

Expand Down Expand Up @@ -148,6 +137,11 @@ configure(subprojects.findAll {it.name != 'itest'}) {
}
}

java {
withJavadocJar()
withSourcesJar()
}

ext {
// path to use for the prepared jruby gems
preparedGems = new File("$buildDir/preparedGems")
Expand All @@ -170,8 +164,26 @@ configure(subprojects.findAll { it.name != 'itest'}) {
jrubyVersion = jrubyVersion
}

compileJava {
options.release = 8
}

// 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
}

nexusPublishing {
repositories {
sonatype {
if (project.hasProperty("sonatypeUsername")) {
username = project.sonatypeUsername
}
if (project.hasProperty("sonatypePassword")) {
password = project.sonatypePassword
}
repositoryDescription = "Release ${project.group} ${project.version}"
}
}
clientTimeout = Duration.ofMinutes(5)
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version=4.1.0
version=5.0.0.rc1
sourceCompatibility=1.8
targetCompatibility=1.8
51 changes: 0 additions & 51 deletions gradle/deploy.gradle

This file was deleted.

Loading

0 comments on commit f49653a

Please sign in to comment.