forked from asciidoctor/asciidoctor-maven-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resource filtering fix (asciidoctor#226)
* Fixed crash when using filtering from 'maven-filtering' module * Added small change in README for styling reasons * fixed 'resources' section documentation in README * replaced usage of 'Runs' for 'Converts' in integration tests poms' names
- Loading branch information
1 parent
76db0da
commit 46c97dc
Showing
13 changed files
with
221 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invoker.goals=clean asciidoctor:process-asciidoc -Dcommand.property=command_value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.asciidoctor</groupId> | ||
<artifactId>test</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<name>Converts Asciidoctor Article to Html adding selected resources</name> | ||
<description>Runs asciidoctor-maven-plugin:process-asciidoc</description> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<pom.property>pom_value</pom.property> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.asciidoctor</groupId> | ||
<artifactId>asciidoctor-maven-plugin</artifactId> | ||
<version>@project.version@</version> | ||
<configuration> | ||
<sourceDirectory>src/main/doc</sourceDirectory> | ||
<outputDirectory>target/docs</outputDirectory> | ||
<resources> | ||
<resource> | ||
<filtering>true</filtering> | ||
<directory>${project.build.sourceDirectory}</directory> | ||
<includes> | ||
<include>**/*.java</include> | ||
</includes> | ||
</resource> | ||
<resource> | ||
<directory>.</directory> | ||
<includes> | ||
<include>*.properties</include> | ||
</includes> | ||
<excludes> | ||
<exclude>.*</exclude> | ||
</excludes> | ||
</resource> | ||
</resources> | ||
<backend>html</backend> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Document Title | ||
============== | ||
Doc Writer <thedoc@asciidoctor.org> | ||
:idprefix: id_ | ||
|
||
Preamble paragraph. | ||
|
||
NOTE: This is test, only a test. | ||
|
||
== Section A | ||
|
||
*Section A* paragraph. | ||
|
||
=== Section A Subsection | ||
|
||
*Section A* 'subsection' paragraph. | ||
|
||
== Section B | ||
|
||
*Section B* paragraph. | ||
|
||
.Section B list | ||
* Item 1 | ||
* Item 2 | ||
* Item 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package example; | ||
|
||
/** | ||
* Using ${java.vendor} ${java.version} | ||
* | ||
* Command property: ${command.property} | ||
* POM property: ${pom.property} | ||
*/ | ||
public class StringUtils { | ||
// tag::contains[] | ||
public boolean contains(String haystack, String needle) { | ||
return haystack.contains(needle); | ||
} | ||
// end::contains[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import java.io.*; | ||
|
||
|
||
File outputDir = new File(basedir, "target/docs") | ||
|
||
String[] expectedFiles = ['sample.html', 'invoker.properties', 'StringUtils.java'] | ||
|
||
// output files should be copied | ||
for (String expectedFile : expectedFiles) { | ||
File file = new File(outputDir, expectedFile) | ||
println("Checking for existence of " + file) | ||
if (!file.isFile()) { | ||
throw new Exception("Missing file " + file) | ||
} | ||
} | ||
|
||
String fileText = new File(outputDir, 'StringUtils.java').text | ||
// properties in 'StringUtils.java' should be filtered (replaced) | ||
['java.version', 'command.property', 'pom.property'].each { | ||
if (fileText.contains(it)) { | ||
throw new Exception("Propert " + file) | ||
} | ||
} | ||
|
||
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Document Title | ||
============== | ||
Doc Writer <thedoc@asciidoctor.org> | ||
:idprefix: id_ | ||
|
||
Preamble paragraph. | ||
|
||
NOTE: This is test, only a test. | ||
|
||
== Section A | ||
|
||
*Section A* paragraph. | ||
|
||
=== Section A Subsection | ||
|
||
*Section A* 'subsection' paragraph. | ||
|
||
== Section B | ||
|
||
*Section B* paragraph. | ||
|
||
.Section B list | ||
* Item 1 | ||
* Item 2 | ||
* Item 3 | ||
|
||
[source,ruby] | ||
require 'asciidoctor' |