Adam Metcalf | ca26d47 | 2013-07-19 11:42:47 -0700 | [diff] [blame] | 1 | apply plugin: 'java' |
| 2 | |
| 3 | sourceSets { |
| 4 | main { |
| 5 | java { |
| 6 | srcDirs = ['src/'] |
| 7 | } |
| 8 | resources { |
| 9 | srcDirs = ['res/'] |
| 10 | } |
| 11 | } |
| 12 | } |
| 13 | // TODO put this function in a plugin |
| 14 | String findToolsJar() { |
| 15 | new ByteArrayOutputStream().withStream { os -> |
| 16 | project.exec { |
Nick Korostelev | 845d3ad | 2014-08-26 19:06:16 -0700 | [diff] [blame] | 17 | executable "../../build/core/find-jdk-tools-jar.sh" |
Adam Metcalf | ca26d47 | 2013-07-19 11:42:47 -0700 | [diff] [blame] | 18 | |
| 19 | standardOutput = os |
| 20 | } |
| 21 | return os.toString().trim() |
| 22 | } |
| 23 | } |
| 24 | |
Nick Korostelev | 845d3ad | 2014-08-26 19:06:16 -0700 | [diff] [blame] | 25 | |
| 26 | if (project.hasProperty("usePrebuilts") && project.usePrebuilts == "true") { |
| 27 | repositories { |
| 28 | maven { url '../../prebuilts/tools/common/m2/repository' } |
| 29 | } |
| 30 | |
| 31 | dependencies { |
| 32 | compile files(findToolsJar()) |
| 33 | compile files('../../prebuilts/misc/common/antlr/antlr-3.4-complete.jar') |
| 34 | compile 'com.google.jsilver:jsilver:1.0.0' |
| 35 | // TODO add tagsoup to prebuils to fully support building using prebuilts |
| 36 | compile project(':tagsoup') |
| 37 | // required by jsilver |
| 38 | compile 'com.google.guava:guava:15.0' |
| 39 | //compile project(path: ':junit', configuration: 'target') |
| 40 | } |
| 41 | } else { |
| 42 | dependencies { |
| 43 | compile files(findToolsJar()) |
| 44 | compile project(path: ':antlr', configuration: 'antlrRuntime') |
| 45 | compile project(':jsilver') |
| 46 | compile project(':tagsoup') |
| 47 | } |
| 48 | } |