Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
oehme committed Dec 11, 2016
1 parent 8f6068e commit b708b0e
Showing 1 changed file with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import org.xtext.gradle.tasks.internal.IncrementalXtextBuilderProvider
import org.gradle.api.tasks.util.PatternSet

class XtextGenerate extends DefaultTask {


@Accessors XtextSourceDirectorySet sources

Expand All @@ -37,31 +37,31 @@ class XtextGenerate extends DefaultTask {
@Accessors @InputFiles @Optional FileCollection classpath

@Accessors @Input @Optional String bootClasspath

@Accessors @Input @Optional File classesDir

@Accessors XtextSourceSetOutputs sourceSetOutputs

@Accessors @Nested val XtextBuilderOptions options = new XtextBuilderOptions

IncrementalXtextBuilder builder

Collection<File> generatedFiles

@InputFiles
def getAllSources() {
sources.files
}

@InputFiles @SkipWhenEmpty
def getMainSources() {
val patterns = new PatternSet().include()
val patterns = new PatternSet
languages.filter[!generator.outlets.empty].forEach [lang |
patterns.include("**/*." + lang.fileExtension)
patterns.include("**/*." + lang.fileExtension)
]
project.files(sources.srcDirs).asFileTree.matching(patterns)
}

@OutputDirectories
def getOutputDirectories() {
sourceSetOutputs.dirs
Expand All @@ -77,7 +77,7 @@ class XtextGenerate extends DefaultTask {
val response = builder.build(request)
generatedFiles = response.generatedFiles
}

private def createBuildRequest() {
new GradleBuildRequest => [
projectName = project.name
Expand Down Expand Up @@ -113,10 +113,10 @@ class XtextGenerate extends DefaultTask {
it.logger = this.logger
]
}

private def addIncrementalInputs(GradleBuildRequest request, IncrementalTaskInputs inputs) {
request.incremental = options.incremental && inputs.incremental

inputs.outOfDate[
if (allSources.contains(file)) {
request.dirtyFiles += file
Expand All @@ -125,14 +125,14 @@ class XtextGenerate extends DefaultTask {
request.dirtyClasspathEntries += file
}
]

inputs.removed[
if (allSources.contains(file)) {
request.deletedFiles += file
}
]
}

def installDebugInfo() {
if (mainSources.isEmpty) {
return
Expand All @@ -155,23 +155,23 @@ class XtextGenerate extends DefaultTask {
]
builder.installDebugInfo(request)
}

private def initializeBuilder() {
builder = IncrementalXtextBuilderProvider.getBuilder(languageSetups, nullSafeEncoding, xtextClasspath.files)
}

private def getContainerHandle() {
project.projectDir + ':' + sources.name
}

private def getNullSafeClasspath() {
classpath ?: project.files
}

private def getNullSafeEncoding() {
options.encoding ?: Charsets.UTF_8.name //TODO probably should be default charset
}

private def getLanguageSetups() {
languages.map[setup].toSet
}
Expand Down

0 comments on commit b708b0e

Please sign in to comment.