Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven central #988

Merged
merged 5 commits into from
Feb 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ jobs:
java:
- '1.8'
- '11.0.5'
- '15.0.2'
os:
- ubuntu-latest
- macos-latest
exclude:
- os: macos-latest
java: '1.8'
- os: macos-latest
java: '15.0.2'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ endif::[]
This document provides a high-level view of the changes introduced in AsciidoctorJ by release.
For a detailed view of what has changed, refer to the {url-repo}/commits/master[commit history] on GitHub.

== Unreleased

Build Improvement::

* Publish directly to Maven Central (#988)

== 2.4.2 (2020-11-10)

Improvement::
Expand All @@ -19,7 +25,7 @@ Improvement::
* Upgrade to Asciidoctor 2.0.12 (#972)
* Upgrade to Asciidoctor EPUB3 1.5.0-alpha.19 (#972)
* Upgrade to rouge 3.24.0 (#972)
* Upgrade to rouge 1.1.3 (#972)
* Upgrade to coderay 1.1.3 (#972)


== 2.4.1 (2020-09-10)
Expand Down
20 changes: 11 additions & 9 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1187,14 +1187,16 @@ To use a snapshot version of the the AsciidoctorJ library add this repository to
[source,xml]
----
<repositories>
<repository>
<id>oss-jfrog-artifactory</id>
<name>oss-jfrog-artifactory-releases</name>
<url>https://oss.jfrog.org/artifactory/oss-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
----

Expand All @@ -1204,7 +1206,7 @@ If you build your project using {uri-gradle}[Gradle] add the repository like thi
----
repositories {
maven {
url 'http://oss.jfrog.org/oss-snapshot-local/'
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
----
Expand Down
10 changes: 10 additions & 0 deletions asciidoctorj-api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'biz.aQute.bnd.builder'
apply plugin: 'de.marcphilipp.nexus-publish'

dependencies {
compileOnly "org.osgi:osgi.annotation:$osgiVersion"
Expand All @@ -12,4 +13,13 @@ jar {
)
}

ext.publicationName = "mavenAsciidoctorJApi"

apply from: rootProject.file('gradle/publish.gradle')
apply from: rootProject.file('gradle/signing.gradle')

publishing {
publications.findByName(project.ext.publicationName).each {
it.from(components.java)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* public Object process(StructuralNode parent, Reader reader, Map&lt;String, Object&gt; attributes) {
* List&lt;String&gt; lines = reader.readLines();
* List&lt;String&gt; newLines = new ArrayList<>();
* List&lt;String&gt; newLines = new ArrayList&lt;&gt;();
* for (String line: lines) {
* newLines.add(line.toUpperCase());
* }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* super(macroName)
* }
*
* public Object process(StructuralNode parent, String target, Map<String, Object> attributes) {
* public Object process(StructuralNode parent, String target, Map&lt;String, Object&gt; attributes) {
* assertEquals(attributes.get("section"), "7")
* }
* }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface Formatter {
* sb.append("&lt;pre class='highlight'&gt;");
* sb.append("&lt;code data-lang='").append(lang).append("'&gt;");
* sb.append(node.getContent());
* sb.append("&lt;/code&gt");
* sb.append("&lt;/code&gt;");
* sb.append("&lt;/pre&gt;\n");
* return sb.toString();
* }
Expand Down
19 changes: 16 additions & 3 deletions asciidoctorj-arquillian-extension/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
apply plugin: 'de.marcphilipp.nexus-publish'

dependencies {
compileOnly project(':asciidoctorj')
compile project(':asciidoctorj-test-support')
Expand All @@ -7,9 +9,20 @@ dependencies {
compile "org.jboss.arquillian.container:arquillian-container-test-impl-base:$arquillianVersion"
}

def javaApiUrl = "https://docs.oracle.com/javase/6/docs/api"
def junitURL = "http://junit.org/javadoc/latest/"
def javaApiUrl = "https://docs.oracle.com/javase/8/docs/api/"
def junitURL = "https://junit.org/junit4/javadoc/latest"

javadoc {
options.links( javaApiUrl, junitURL )
}
}

project.ext.publicationName = "mavenAsciidoctorJArquillianExtension"

apply from: rootProject.file('gradle/publish.gradle')
apply from: rootProject.file('gradle/signing.gradle')

publishing {
publications.findByName(project.ext.publicationName).each {
it.from(rootProject.project('asciidoctorj-arquillian-extension').components.java)
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.asciidoctor.arquillian;

import org.asciidoctor.Asciidoctor;
import org.asciidoctor.arquillian.api.Shared;
import org.asciidoctor.arquillian.api.Unshared;
import org.jboss.arquillian.core.api.Instance;
Expand Down
13 changes: 13 additions & 0 deletions asciidoctorj-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'biz.aQute.bnd.builder'

dependencies {
Expand Down Expand Up @@ -118,3 +120,14 @@ task pollutedTest(type: Test) {

test.dependsOn pollutedTest

project.ext.publicationName = "mavenAsciidoctorJ"

apply from: rootProject.file('gradle/publish.gradle')
apply from: rootProject.file('gradle/signing.gradle')

publishing {
publications.findByName(project.ext.publicationName).each {
it.from(components.java)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static AsciidoctorJRuby create(List<String> loadPaths) {
*
* <pre>
* org.jruby.javasupport.JavaEmbedUtils.initialize(Arrays.asList("uri:classloader:/gems/asciidoctor-1.5.8/lib"));
* Asciidoctor asciidoctor = Asciidoctor.Factory.create(this.getClass().getClassLoader()); <3>
* Asciidoctor asciidoctor = Asciidoctor.Factory.create(this.getClass().getClassLoader());
* </pre>
*
* @param classloader
Expand All @@ -79,7 +79,7 @@ public static AsciidoctorJRuby create(ClassLoader classloader) {
*
* <pre>
* org.jruby.javasupport.JavaEmbedUtils.initialize(Arrays.asList("uri:classloader:/gems/asciidoctor-1.5.8/lib"));
* Asciidoctor asciidoctor = Asciidoctor.Factory.create(this.getClass().getClassLoader()); <3>
* Asciidoctor asciidoctor = Asciidoctor.Factory.create(this.getClass().getClassLoader());
* </pre>
*
* @param classloader
Expand Down
29 changes: 8 additions & 21 deletions asciidoctorj-distribution/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,6 @@ dependencies {
}

jar.enabled = false
if ( !project.hasProperty('skip.signing') ) {
signPom.enabled = false
}

/*
UGLY HACK to workaround gradle-bintray-plugin compatibility with Gradle 5+

https://github.com/asciidoctor/asciidoctorj/issues/861
https://github.com/bintray/gradle-bintray-plugin/issues/300

WARNING: since the Groovy Gradle API is modified, this breaks build isolation when sharing a common Gradle daemon instance

This works because gradle-bintray-plugin is using Groovy dynamic compilation hence it is affected by Groovy runtime meta-programming

Tested with: Gradle 5.6.3 / gradle-bintray-plugin 1.8.4

TODO: remove as soon as bintray/gradle-bintray-plugin#300 is fixed and integrated
*/
Signature.metaClass.getToSignArtifact = { ->
return (delegate as Signature).source
}

configurations.archives.with {
//We need to remove the (non-existing) jar artifact, otherwise signing will fail
Expand All @@ -76,3 +55,11 @@ startScripts {
'-Xverify:none', '-XX:+TieredCompilation', '-XX:TieredStopAtLevel=1', '-XX:+DisableExplicitGC', '-Djruby.compile.mode=OFF'
]
}

project.ext.publicationName = "mavenAsciidoctorJ"

publishing {
publications.findByName(project.ext.publicationName).each {
it.artifact(distZip)
}
}
6 changes: 4 additions & 2 deletions asciidoctorj-test-support/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
apply plugin: 'java'

dependencies {
compile 'junit:junit:4.12'
}

def javaApiUrl = "https://docs.oracle.com/javase/6/docs/api"
def junitURL = "http://junit.org/javadoc/latest/"
def javaApiUrl = "https://docs.oracle.com/javase/8/docs/api/"
def junitURL = "https://junit.org/junit4/javadoc/latest"

javadoc {
options.links(javaApiUrl, junitURL)
Expand Down
57 changes: 23 additions & 34 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,42 @@ buildscript {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.10"
classpath "gradle.plugin.io.sdkman:gradle-sdkvendor-plugin:1.1.0"
classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:4.3.0"
}
}

// modern plugins config
plugins {
id "signing"
id "io.codearte.nexus-staging" version "0.22.0"
id "de.marcphilipp.nexus-publish" version "0.4.0"
id 'com.github.jruby-gradle.base' version '2.0.0'
}

apply plugin: 'io.codearte.nexus-staging'

// 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')

// using ExpandoMetaClass to add isDistribution() Method to Project instances...
Project.metaClass.isDistribution = { delegate.getName().endsWith("-distribution") }

nexusStaging {
if (project.hasProperty("sonatypeUsername")) {
username = project.sonatypeUsername
}
if (project.hasProperty("sonatypePassword")) {
password = project.sonatypePassword
}
repositoryDescription = "Release ${project.group} ${project.version}"
}


ext {
buildDateTime = new Date()
(buildDateOnly, buildTimeOnly) = new java.text.SimpleDateFormat('yyyy-MM-dd HH:mm:ss.SSSZ').format(buildDateTime).split(' ')
Expand All @@ -50,8 +65,8 @@ ext {
jcommanderVersion = '1.72'
jrubyVersion = '9.2.13.0'
jsoupVersion = '1.12.1'
junitVersion = '4.12'
nettyVersion = '4.0.33.Final'
junitVersion = '4.13.1'
nettyVersion = '4.1.58.Final'
saxonVersion = '9.9.0-2'
xmlMatchersVersion = '1.0-RC1'
pdfboxVersion = '1.8.10'
Expand Down Expand Up @@ -85,19 +100,6 @@ subprojects {
apply plugin: 'java'
apply plugin: 'groovy'

if (!it.name.endsWith('-documentation') && !it.name.endsWith('-wildfly-integration-test')) {

apply from: rootProject.file('gradle/signing.gradle')
if (!it.isDistribution()){
apply from: rootProject.file('gradle/publish.gradle')
}
if (statusIsRelease) {
apply from: rootProject.file('gradle/deploy.gradle')
} else if (it.version.endsWith('SNAPSHOT')) {
apply from: rootProject.file('gradle/deploySnapshot.gradle')
}
}

status = _status

// NOTE sourceCompatibility & targetCompatibility are set in gradle.properties to meet requirements of Gradle
Expand Down Expand Up @@ -125,8 +127,7 @@ subprojects {
if (project.hasProperty('useMavenLocal') && project.useMavenLocal.toBoolean()) {
mavenLocal()
}

jcenter()
mavenCentral()
}

apply plugin: 'codenarc'
Expand Down Expand Up @@ -207,21 +208,9 @@ configure(subprojects.findAll { !it.isDistribution() }) {

configure(subprojects.findAll { !it.name.endsWith('-distribution') && ! it.name.endsWith('-documentation')}) {

task sourcesJar(type: Jar, dependsOn: classes, group: 'Release') {
description 'Assembles a jar archive containing the main source code.'
from sourceSets.main.allSource
classifier 'sources'
}

task javadocJar(type: Jar, dependsOn: javadoc, group: 'Release') {
description 'Assembles a jar archive containing the Javadoc API documentation for the main source code.'
from javadoc.destinationDir
classifier 'javadoc'
}

// jcenter & Maven Central requires sources & javadoc jars (even if empty), so give 'em what they want
artifacts {
archives sourcesJar, javadocJar
java {
withJavadocJar()
withSourcesJar()
}

jruby {
Expand Down
22 changes: 12 additions & 10 deletions docs/modules/guides/pages/use-snapshot-version.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ To use a snapshot version of the the AsciidoctorJ library add this repository to
[source,xml]
----
<repositories>
<repository>
<id>oss-jfrog-artifactory</id>
<name>oss-jfrog-artifactory-releases</name>
<url>https://oss.jfrog.org/artifactory/oss-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
----

Expand All @@ -23,10 +25,10 @@ If you build your project using {url-gradle}[Gradle] add the repository like thi
----
repositories {
maven {
url 'http://oss.jfrog.org/oss-snapshot-local/'
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
----


You can also download a snapshot version of the distribution from here: https://oss.jfrog.org/oss-snapshot-local/org/asciidoctor/asciidoctorj-distribution.
You can also download a snapshot version of the distribution from here: https://oss.sonatype.org/service/local/repositories/snapshots/content/org/asciidoctor/asciidoctorj/2.4.3-SNAPSHOT/.
Loading