Skip to content

Commit

Permalink
Merge pull request #75 from programadorthi/feature-android-plugin
Browse files Browse the repository at this point in the history
Updated android gradle plugin to 2.2.3
  • Loading branch information
oehme authored Jan 20, 2017
2 parents 3dbd577 + e5dfc14 commit 5b5cd79
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ out/
# Gradle
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Wed Dec 21 11:04:23 CET 2016
#Mon Jan 16 10:25:00 BRT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion xtext-android-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ description 'A plugin for integrating Xtext based Code generators with the Andro

dependencies {
compile project(':xtext-gradle-plugin')
compile 'com.android.tools.build:gradle:1.5.0'
compile 'com.android.tools.build:gradle:2.2.3'
integTestCompile project(path : ':xtext-gradle-plugin', configuration: 'integTestCompile')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import org.gradle.api.DomainObjectSet
import org.gradle.api.GradleException
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.tasks.compile.AbstractCompile
import org.xtext.gradle.XtextBuilderPlugin
import org.xtext.gradle.XtextJavaLanguagePlugin
import org.xtext.gradle.tasks.XtextExtension
Expand Down Expand Up @@ -86,10 +87,18 @@ class XtextAndroidBuilderPlugin implements Plugin<Project> {
sourceDirs += variant.outputs.map[processResources.sourceOutputDir]
sourceSet.srcDirs(sourceDirs)
generatorTask.bootClasspath = android.bootClasspath.join(File.pathSeparator)
generatorTask.classpath = variant.javaCompiler.classpath.plus(project.files(android.bootClasspath))
generatorTask.classesDir = variant.javaCompiler.destinationDir
generatorTask.options.encoding = android.compileOptions.encoding
variant.registerJavaGeneratingTask(generatorTask, generatorTask.outputDirectories)
if (variant.javaCompiler instanceof AbstractCompile) {
val compile = variant.javaCompiler as AbstractCompile
generatorTask.classpath = compile.classpath.plus(
project.files(android.bootClasspath)
)
generatorTask.classesDir = compile.destinationDir
generatorTask.options.encoding = android.compileOptions.encoding
variant.registerJavaGeneratingTask(generatorTask, generatorTask.outputDirectories)
} else {
throw new
GradleException('The Xtext plugin only supports using the javac compiler.')
}
]
}

Expand Down

0 comments on commit 5b5cd79

Please sign in to comment.