Skip to content

Commit 0f5c4d8

Browse files
authored
Merge pull request #52 from asciidoctor/asciidoctor-diagram-2.3.1
asciidoctor-diagram 2.3.1 and asciidoctor-diagram-plantuml 1.2024.5
2 parents 0e67704 + cd18830 commit 0f5c4d8

File tree

16 files changed

+418
-13
lines changed

16 files changed

+418
-13
lines changed

.github/workflows/release.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ on:
1818
type: boolean
1919
default: true
2020
required: true
21+
publishAsciidoctorJDiagramBatik:
22+
description: "Publish asciidoctorj-diagram-batik"
23+
type: boolean
24+
default: true
25+
required: true
26+
publishAsciidoctorJDiagramJSyntrax:
27+
description: "Publish asciidoctorj-diagram-jsyntrax"
28+
type: boolean
29+
default: true
30+
required: true
2131

2232
env:
2333
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GPG_KEY_ID }}
@@ -42,6 +52,8 @@ jobs:
4252
if ${{ inputs.publishAsciidoctorJDiagram }}; then GOALS="publishMavenAsciidoctorJDiagramPublicationToSonatypeRepository "; fi
4353
if ${{ inputs.publishAsciidoctorJDiagramDitaaMini }}; then GOALS="$GOALS publishMavenAsciidoctorJDiagramDitaaminiPublicationToSonatypeRepository "; fi
4454
if ${{ inputs.publishAsciidoctorJDiagramPlantuml }}; then GOALS="$GOALS publishMavenAsciidoctorJDiagramPlantumlPublicationToSonatypeRepository "; fi
55+
if ${{ inputs.publishAsciidoctorJDiagramBatik }}; then GOALS="$GOALS publishMavenAsciidoctorJDiagramBatikPublicationToSonatypeRepository "; fi
56+
if ${{ inputs.publishAsciidoctorJDiagramJSyntrax }}; then GOALS="$GOALS publishMavenAsciidoctorJDiagramJSyntraxPublicationToSonatypeRepository "; fi
4557
echo "Publishing goals: ${GOALS}"
4658
unset GEM_PATH GEM_HOME JRUBY_OPTS
4759
./gradlew --no-daemon clean build
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
dependencies {
2+
gems("rubygems:asciidoctor-diagram-batik:${project.version}")
3+
}
4+
5+
def gemFiles = fileTree("${project.buildDir}/.gems") {
6+
include 'specifications/*.gemspec'
7+
include 'gems/*/lib/**'
8+
}
9+
10+
jrubyPrepare {
11+
doLast {
12+
println "Copy from $gemFiles into $preparedGems"
13+
copy { // bundles the gems inside this artifact
14+
from gemFiles
15+
into preparedGems
16+
}
17+
}
18+
}
19+
20+
ext.publicationName = "mavenAsciidoctorJDiagramBatik"
21+
22+
apply from: rootProject.file('gradle/publish.gradle')
23+
apply from: rootProject.file('gradle/signing.gradle')
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
properName=AsciidoctorJ Diagram Batik
2+
description=AsciidoctorJ Diagram Batik bundles the Asciidoctor Diagram Batik RubyGem (asciidoctor-diagram-batik) so it can be loaded into the JVM using JRuby.
3+
version=1.17
4+
gem_name=asciidoctor-diagram-batik
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
dependencies {
2+
gems("rubygems:asciidoctor-diagram-jsyntrax:${project.version}") {
3+
exclude module: "asciidoctor-diagram-batik"
4+
}
5+
implementation project(':asciidoctorj-diagram-batik')
6+
}
7+
8+
def gemFiles = fileTree("${project.buildDir}/.gems") {
9+
include 'specifications/*.gemspec'
10+
include 'gems/*/lib/**'
11+
}
12+
13+
jrubyPrepare {
14+
doLast {
15+
println "Copy from $gemFiles into $preparedGems"
16+
copy { // bundles the gems inside this artifact
17+
from gemFiles
18+
into preparedGems
19+
}
20+
}
21+
}
22+
23+
ext.publicationName = "mavenAsciidoctorJDiagramPlantuml"
24+
25+
apply from: rootProject.file('gradle/publish.gradle')
26+
apply from: rootProject.file('gradle/signing.gradle')
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
properName=AsciidoctorJ Diagram JSyntrax
2+
description=AsciidoctorJ Diagram JSyntrax bundles the Asciidoctor Diagram JSyntrax RubyGem (asciidoctor-diagram-jsyntrax) so it can be loaded into the JVM using JRuby.
3+
version=1.38.1
4+
gem_name=asciidoctor-diagram-jsyntrax
5+

asciidoctorj-diagram-plantuml/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
dependencies {
2-
gems("rubygems:asciidoctor-diagram-plantuml:${project.version}")
2+
gems("rubygems:asciidoctor-diagram-plantuml:${project.version}") {
3+
exclude module: "asciidoctor-diagram-batik"
4+
}
5+
implementation project(':asciidoctorj-diagram-batik')
36
}
47

58
def gemFiles = fileTree("${project.buildDir}/.gems") {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
properName=AsciidoctorJ Diagram Plantuml
22
description=AsciidoctorJ Diagram Plantuml bundles the Asciidoctor Diagram Plantuml RubyGem (asciidoctor-diagram-plantuml) so it can be loaded into the JVM using JRuby.
3-
version=1.2024.3
3+
version=1.2024.5
44
gem_name=asciidoctor-diagram-plantuml
55

asciidoctorj-diagram/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ dependencies {
1212
// Exclude gems provided by AsciidoctorJ core
1313
exclude module: 'asciidoctor'
1414
exclude module: 'thread_safe'
15+
exclude module: 'rexml'
1516
exclude module: 'asciidoctor-diagram-plantuml'
1617
exclude module: 'asciidoctor-diagram-ditaamini'
1718
}
19+
gems("rubygems:rexml:$rexmlGemVersion")
1820
}
1921

2022
def gemFiles = fileTree("${project.buildDir}/.gems") {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
properName=AsciidoctorJ Diagram
22
description=AsciidoctorJ Diagram bundles the Asciidoctor Diagram RubyGem (asciidoctor-diagram) so it can be loaded into the JVM using JRuby.
3-
version=2.3.0
3+
version=2.3.1
44
gem_name=asciidoctor-diagram

build.gradle

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,18 @@ ext {
3131
statusIsRelease = (status == 'release')
3232

3333
// jar versions
34-
jrubyVersion = '9.4.2.0'
34+
jrubyVersion = '9.4.7.0'
3535
junitVersion = '5.8.2'
3636
assertjVersion = '3.22.0'
37-
jsoupVersion = '1.15.3'
37+
jsoupVersion = '1.17.2'
3838

3939
// gem versions
4040
asciidoctorJVersion = project.hasProperty('asciidoctorJVersion') ? project.asciidoctorJVersion : '2.5.10'
4141
asciidoctorDiagramGemVersion = project.hasProperty('asciidoctorDiagramGemVersion') ? project.asciidoctorDiagramGemVersion : project(':asciidoctorj-diagram').version.replace('-', '.')
42-
barbyGemVersion = "0.6.8"
42+
asciidoctorDiagramBatikGemVersion = "1.17"
43+
barbyGemVersion = "0.6.9"
4344
rqrcodeGemVersion = "2.2.0"
45+
rexmlGemVersion = '3.2.6'
4446
}
4547

4648
allprojects {
@@ -56,11 +58,16 @@ subprojects {
5658

5759
status = _status
5860

61+
def _javaVersion = 8
62+
if (project.name == "itest"
63+
|| project.name == "asciidoctorj-diagram-jsyntrax") {
64+
_javaVersion = 11
65+
}
5966
project.tasks.withType(JavaCompile).configureEach { task ->
60-
task.options.release = 8
67+
task.options.release = _javaVersion
6168
}
6269
project.tasks.withType(GroovyCompile).configureEach {task ->
63-
task.options.release = 8
70+
task.options.release = _javaVersion
6471
}
6572

6673
repositories {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=2.3.0
1+
version=2.3.1
22
gem_name=asciidoctor-diagram

itest/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ dependencies {
33
testImplementation ("org.asciidoctor:asciidoctorj:$asciidoctorJVersion")
44

55
testImplementation project(':asciidoctorj-diagram')
6+
testImplementation project(':asciidoctorj-diagram-jsyntrax')
67
}
78

89
jar.enabled = false
910

10-
configurations.all {
11+
configurations.configureEach {
1112
artifacts.clear()
1213
}

itest/src/test/java/org.asciidoctor/WhenDocumentContainsDitaaDiagram.java renamed to itest/src/test/java/org.asciidoctor/WhenDocumentContainsDiagrams.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
import static org.assertj.core.api.Assertions.assertThat;
88

9-
public class WhenDocumentContainsDitaaDiagram {
9+
public class WhenDocumentContainsDiagrams {
1010

11-
private Asciidoctor asciidoctor = Asciidoctor.Factory.create();
11+
private final Asciidoctor asciidoctor = Asciidoctor.Factory.create();
1212

1313
@Test
1414
public void png_should_be_rendered_for_diagram() {
@@ -19,10 +19,22 @@ public void png_should_be_rendered_for_diagram() {
1919
File expectedDiagram = new File(sourceDir, "asciidoctor-diagram-process.png");
2020
File expectedDiagramCache = new File(sourceDir, ".asciidoctor/diagram/asciidoctor-diagram-process.png.cache");
2121

22+
File expectedPlantumlDiagram = new File(sourceDir, "plantuml-test.svg");
23+
File expectedPlantumlDiagramCache = new File(sourceDir, ".asciidoctor/diagram/plantuml-test.svg.cache");
24+
25+
File expectedJSyntraxDiagram = new File(sourceDir, "jsyntrax-test.svg");
26+
File expectedJSyntraxDiagramCache = new File(sourceDir, ".asciidoctor/diagram/jsyntrax-test.svg.cache");
27+
2228
asciidoctor.requireLibrary("asciidoctor-diagram");
2329
asciidoctor.convertFile(sourceDocument, Options.builder().backend("html5").build());
2430

2531
assertThat(expectedDiagram).isNotEmpty();
2632
assertThat(expectedDiagramCache).isNotEmpty();
33+
34+
assertThat(expectedPlantumlDiagram).isNotEmpty();
35+
assertThat(expectedPlantumlDiagramCache).isNotEmpty();
36+
37+
assertThat(expectedJSyntraxDiagram).isNotEmpty();
38+
assertThat(expectedJSyntraxDiagramCache).isNotEmpty();
2739
}
2840
}

itest/src/test/resources/sample.adoc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,18 @@
2020
+-----------------------------------+
2121
....
2222

23+
[plantuml,plantuml-test,svg]
24+
----
25+
class A
26+
class B
27+
A --> B
28+
----
29+
30+
[syntrax,jsyntrax-test,svg]
31+
----
32+
indentstack(10,
33+
line(opt('-'), choice('0', line('1-9', loop(None, '0-9'))),
34+
opt('.', loop('0-9', None))),
35+
line(opt(choice('e', 'E'), choice(None, '+', '-'), loop('0-9', None)))
36+
)
37+
----

0 commit comments

Comments
 (0)