Skip to content

Commit

Permalink
Add underscore-led Asciidoc files to secondary source patterns (ascii…
Browse files Browse the repository at this point in the history
  • Loading branch information
ysb33r committed Jul 3, 2019
1 parent 207382b commit 29b10ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import static groovy.lang.Closure.DELEGATE_FIRST
class AsciidoctorUtils {

public static final OperatingSystem OS = OperatingSystem.current()
public static final String UNDERSCORE_LED_FILES = '**/_*'
public static final String UNDERSCORE_LED_FILES = '**/_*.a*'

static final Spec<? super File> ACCEPT_ONLY_FILES = new Spec<File>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,21 +739,16 @@ class AbstractAsciidoctorTask extends DefaultTask {
*/
@Internal
protected PatternSet getDefaultSourceDocumentPattern() {
PatternSet ps = new PatternSet()
ps.include '**/*.adoc'
ps.include '**/*.ad'
ps.include '**/*.asc'
ps.include '**/*.asciidoc'
ps.exclude UNDERSCORE_LED_FILES
asciidocPatterns.exclude UNDERSCORE_LED_FILES
}

/** The default pattern set for secondary sources.
*
* @return {@link #getDefaultSourceDocumentPattern} + `*docinfo*`.
* @return {@link #getDefaultSourceDocumentPattern} + {@code _*.adoc}.
*/
@Internal
protected PatternSet getDefaultSecondarySourceDocumentPattern() {
defaultSourceDocumentPattern
asciidocPatterns
}

/** The default CopySpec that will be used if {@code resources} was never called
Expand Down Expand Up @@ -1147,4 +1142,12 @@ class AbstractAsciidoctorTask extends DefaultTask {
project.configurations.getByName(StringUtils.stringize(sourceConfig))
}
}

private PatternSet getAsciidocPatterns() {
PatternSet ps = new PatternSet()
ps.include '**/*.adoc'
ps.include '**/*.ad'
ps.include '**/*.asc'
ps.include '**/*.asciidoc'
}
}

0 comments on commit 29b10ab

Please sign in to comment.