blob: 0fdc5d1eb4840a5958e7585de276c50e6cec826e [file] [log] [blame]
Adam Metcalfca26d472013-07-19 11:42:47 -07001apply plugin: 'java'
2
C. Sean Young4a42aef2015-06-10 10:43:26 -05003import com.android.internal.BuildUtils
4
Adam Metcalfca26d472013-07-19 11:42:47 -07005sourceSets {
6 main {
7 java {
8 srcDirs = ['src/']
9 }
10 resources {
11 srcDirs = ['res/']
12 }
13 }
14}
Adam Metcalfca26d472013-07-19 11:42:47 -070015
Adam Metcalfca26d472013-07-19 11:42:47 -070016// TODO put this function in a plugin
C. Sean Young3641c822015-06-12 12:08:41 -050017// TODO remove when prebuilt's case will always properly work with BuildUtils's version.
Adam Metcalfca26d472013-07-19 11:42:47 -070018String findToolsJar() {
19 new ByteArrayOutputStream().withStream { os ->
20 project.exec {
Nick Korostelev845d3ad2014-08-26 19:06:16 -070021 executable "../../build/core/find-jdk-tools-jar.sh"
Adam Metcalfca26d472013-07-19 11:42:47 -070022
23 standardOutput = os
24 }
25 return os.toString().trim()
26 }
27}
28
Nick Korostelev845d3ad2014-08-26 19:06:16 -070029if (project.hasProperty("usePrebuilts") && project.usePrebuilts == "true") {
30 repositories {
31 maven { url '../../prebuilts/tools/common/m2/repository' }
32 }
33
C. Sean Young3641c822015-06-12 12:08:41 -050034 // TODO refactor to allow referencing the "gradle way"
Nick Korostelev845d3ad2014-08-26 19:06:16 -070035 dependencies {
36 compile files(findToolsJar())
37 compile files('../../prebuilts/misc/common/antlr/antlr-3.4-complete.jar')
38 compile 'com.google.jsilver:jsilver:1.0.0'
39 // TODO add tagsoup to prebuils to fully support building using prebuilts
40 compile project(':tagsoup')
41 // required by jsilver
42 compile 'com.google.guava:guava:15.0'
43 //compile project(path: ':junit', configuration: 'target')
44 }
45} else {
46 dependencies {
C. Sean Young3641c822015-06-12 12:08:41 -050047 compile files(BuildUtils.findToolsJar(project))
Nick Korostelev845d3ad2014-08-26 19:06:16 -070048 compile project(path: ':antlr', configuration: 'antlrRuntime')
49 compile project(':jsilver')
50 compile project(':tagsoup')
51 }
52}