Skip to content

Commit

Permalink
Merge pull request #427 from ysb33r/underscores-410-2.x
Browse files Browse the repository at this point in the history
Add underscore-led Asciidoc files to secondary source patterns (#410)
  • Loading branch information
ysb33r committed Jul 4, 2019
2 parents fd1994c + 29b10ab commit edb1c4b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
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
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 edb1c4b

Please sign in to comment.