Skip to content

Commit

Permalink
Merge branch 'master' into update-pdf-diagram-revealjs
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpanzer authored Feb 7, 2021
2 parents 7986d0f + 30671a9 commit f71fc1e
Show file tree
Hide file tree
Showing 21 changed files with 183 additions and 337 deletions.
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
4 changes: 4 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Improvement::
* Upgrade to rouge 3.26.0 (#986)
* Add constant for attribute toclevel (@l0wlik34G6) (#984)

Build Improvement::

* Publish directly to Maven Central (#988)

== 2.4.2 (2020-11-10)

Improvement::
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.14.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
6 changes: 3 additions & 3 deletions docs/modules/extensions/pages/include-processor.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

//TODO Note you can only have one include processor at a time.

Asciidoctor supports include other documents via the include directive.
Whit it, you can simply write `include::other.adoc[]` to include the contents of the file `other.adoc`.
Asciidoctor supports including other documents via the include directive.
With it, you can simply write `include::other.adoc[]` to include the contents of the file `other.adoc`.
Include Processors allow to intercept this mechanism and for instance include the content over the network.

For example, similarly to the *unix `ls` command, an Include Processor could resolve the include directive `include::ls[]`, and insert the contents of the current directory in the document.
For example, similar to the *unix `ls` command, an Include Processor could resolve the include directive `include::ls[]`, and insert the contents of the current directory in the document.
Our example will replace the include directive `include::ls[]` with the directory contents, adding one line for every file found.

// Don't know how to include this file without asciidoctor trying to process include::ls[]
Expand Down
Loading

0 comments on commit f71fc1e

Please sign in to comment.