Author: Kai-Chung Yan <seamlikok@gmail.com>
Last-Update: 2016-06-07
Description: Prepare the build script
 This patch modifies build.gradle so that it can be used by Debian's build
 system. It does the following:
   * Set artifactId, groupId and version
   * Specify offline dependencies
   * Generate POMs
   * Generate classpaths
--- a/build.gradle
+++ b/build.gradle
@@ -1,6 +1,11 @@
 apply plugin: 'java'
 
-import com.android.internal.BuildUtils
+group = 'com.google.doclava'
+version = "android-$androidVersion"
+archivesBaseName = 'doclava'
+
+sourceCompatibility = 1.7
+targetCompatibility = 1.7
 
 sourceSets {
     main {
@@ -13,40 +18,13 @@
     }
 }
 
-// TODO put this function in a plugin
-// TODO remove when prebuilt's case will always properly work with BuildUtils's version.
-String findToolsJar() {
-    new ByteArrayOutputStream().withStream { os ->
-        project.exec {
-            executable "../../build/core/find-jdk-tools-jar.sh"
-
-            standardOutput = os
-        }
-        return os.toString().trim()
-    }
+dependencies {
+    compile 'com.google.guava:guava:debian'
+    compile 'com.google.jsilver:jsilver:debian'
+    compile 'org.antlr:antlr-runtime:3.x'
+    compile 'org.ccil.cowan.tagsoup:tagsoup:debian'
+    compile files('/usr/lib/jvm/default-java/lib/tools.jar')
 }
 
-if (project.hasProperty("usePrebuilts") && project.usePrebuilts == "true") {
-    repositories {
-        maven { url '../../prebuilts/tools/common/m2/repository' }
-    }
-
-    // TODO refactor to allow referencing the "gradle way"
-    dependencies {
-        compile files(findToolsJar())
-        compile files('../../prebuilts/misc/common/antlr/antlr-3.4-complete.jar')
-        compile 'com.google.jsilver:jsilver:1.0.0'
-        // TODO add tagsoup to prebuils to fully support building using prebuilts
-        compile project(':tagsoup')
-        // required by jsilver
-        compile 'com.google.guava:guava:15.0'
-        //compile project(path: ':junit', configuration: 'target')
-    }
-} else {
-    dependencies {
-        compile files(BuildUtils.findToolsJar(project))
-        compile project(path: ':antlr', configuration: 'antlrRuntime')
-        compile project(':jsilver')
-        compile project(':tagsoup')
-    }
-}
+apply from: 'debian/generateClasspaths.gradle'
+apply from: 'debian/generatePom.gradle'
\ No newline at end of file
