Adam Metcalf | ca26d47 | 2013-07-19 11:42:47 -0700 | [diff] [blame] | 1 | apply plugin: 'java' |
| 2 | |
C. Sean Young | 4a42aef | 2015-06-10 10:43:26 -0500 | [diff] [blame] | 3 | import com.android.internal.BuildUtils |
| 4 | |
Adam Metcalf | ca26d47 | 2013-07-19 11:42:47 -0700 | [diff] [blame] | 5 | sourceSets { |
| 6 | main { |
| 7 | java { |
| 8 | srcDirs = ['src/'] |
| 9 | } |
| 10 | resources { |
| 11 | srcDirs = ['res/'] |
| 12 | } |
| 13 | } |
| 14 | } |
Adam Metcalf | ca26d47 | 2013-07-19 11:42:47 -0700 | [diff] [blame] | 15 | |
Adam Metcalf | ca26d47 | 2013-07-19 11:42:47 -0700 | [diff] [blame] | 16 | // TODO put this function in a plugin |
C. Sean Young | 3641c82 | 2015-06-12 12:08:41 -0500 | [diff] [blame] | 17 | // TODO remove when prebuilt's case will always properly work with BuildUtils's version. |
Adam Metcalf | ca26d47 | 2013-07-19 11:42:47 -0700 | [diff] [blame] | 18 | String findToolsJar() { |
| 19 | new ByteArrayOutputStream().withStream { os -> |
| 20 | project.exec { |
Nick Korostelev | 845d3ad | 2014-08-26 19:06:16 -0700 | [diff] [blame] | 21 | executable "../../build/core/find-jdk-tools-jar.sh" |
Adam Metcalf | ca26d47 | 2013-07-19 11:42:47 -0700 | [diff] [blame] | 22 | |
| 23 | standardOutput = os |
| 24 | } |
| 25 | return os.toString().trim() |
| 26 | } |
| 27 | } |
| 28 | |
Nick Korostelev | 845d3ad | 2014-08-26 19:06:16 -0700 | [diff] [blame] | 29 | if (project.hasProperty("usePrebuilts") && project.usePrebuilts == "true") { |
| 30 | repositories { |
| 31 | maven { url '../../prebuilts/tools/common/m2/repository' } |
| 32 | } |
| 33 | |
C. Sean Young | 3641c82 | 2015-06-12 12:08:41 -0500 | [diff] [blame] | 34 | // TODO refactor to allow referencing the "gradle way" |
Nick Korostelev | 845d3ad | 2014-08-26 19:06:16 -0700 | [diff] [blame] | 35 | 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 Young | 3641c82 | 2015-06-12 12:08:41 -0500 | [diff] [blame] | 47 | compile files(BuildUtils.findToolsJar(project)) |
Nick Korostelev | 845d3ad | 2014-08-26 19:06:16 -0700 | [diff] [blame] | 48 | compile project(path: ':antlr', configuration: 'antlrRuntime') |
| 49 | compile project(':jsilver') |
| 50 | compile project(':tagsoup') |
| 51 | } |
| 52 | } |