Skip to content

Commit

Permalink
Merge pull request #145 from xtext/issue_144
Browse files Browse the repository at this point in the history
Use class instead of lambda
  • Loading branch information
oehme authored Feb 25, 2019
2 parents 22c04d0 + 59cba63 commit 3ec57ea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import com.android.build.gradle.LibraryExtension
import com.android.build.gradle.LibraryPlugin
import com.android.build.gradle.api.BaseVariant
import com.android.build.gradle.internal.api.TestedVariant
import org.gradle.api.Action
import org.gradle.api.DomainObjectSet
import org.gradle.api.GradleException
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.compile.AbstractCompile
import org.xtext.gradle.XtextBuilderPlugin
import org.xtext.gradle.XtextJavaLanguagePlugin
Expand Down Expand Up @@ -74,7 +76,11 @@ class XtextAndroidBuilderPlugin implements Plugin<Project> {
variant.generateBuildConfig
)
generatorTask.dependsOn(variant.outputs.map[processResources])
variant.javaCompiler.doLast[generatorTask.installDebugInfo]
variant.javaCompiler.doLast(new Action<Task>() {
override void execute(Task it) {
generatorTask.installDebugInfo()
}
})
val sourceDirs = newArrayList
val javaDirs = variant.sourceSets.map[javaDirectories].flatten.filter[directory]
sourceDirs += javaDirs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import java.io.File
import java.util.Set
import java.util.concurrent.Callable
import org.eclipse.xtext.xbase.lib.Functions.Function0
import org.gradle.api.Action
import org.gradle.api.GradleException
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.Configuration
import org.gradle.api.file.FileCollection
import org.gradle.api.plugins.BasePlugin
Expand Down Expand Up @@ -158,9 +160,11 @@ class XtextBuilderPlugin implements Plugin<Project> {
]
if (!javaOutlets.isEmpty) {
javaCompile.dependsOn(generatorTask)
javaCompile.doLast[
generatorTask.installDebugInfo
]
javaCompile.doLast(new Action<Task>() {
override void execute(Task it) {
generatorTask.installDebugInfo()
}
})
}
generatorTask.options.encoding = generatorTask.options.encoding ?: javaCompile.options.encoding
generatorTask.classpath = generatorTask.classpath ?: javaSourceSet.compileClasspath
Expand Down

0 comments on commit 3ec57ea

Please sign in to comment.