Add files necessary for building with gradle to external/jetty.

Change-Id: I58c24343ccbc32cd1528ca53aa717c24ff8d1238
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
new file mode 100644
index 0000000..c1ed204
--- /dev/null
+++ b/AndroidManifest.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="org.eclipse.jetty"
+    android:versionCode="1"
+    android:versionName="1.0" >
+
+    <uses-sdk
+        android:minSdkVersion="8"
+        android:targetSdkVersion="17" />
+
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+
+    <application />
+
+</manifest>
diff --git a/README.android b/README.android
index 012a796..747dcab 100644
--- a/README.android
+++ b/README.android
@@ -10,13 +10,15 @@
 code and dependencies using maven. Note, the file structure generated with pom.xml_saved will
 not match the current file structure, as noted in the Local Modifcations section. Furthermore, not
 all of the original sources are compatible with the android runtime. Incompatible source files are
-listed in the Android.mk file under "NON_ANDROID_SRC".
+listed in the Android.mk file under "NON_ANDROID_SRC" and the build.gradle file under nonAndroidSrc.
 
 Local Modifcations
 -------------------
-The complete original source code was downloaded using pom.xml_saved. The pom file creates a separate
-directory for each jetty package. the src directory of the relevant packages were merged into a single
-src directory. The relevant packages which were merged into the single src directory are:
+The complete original source code was downloaded using pom.xml_saved. The pom file creates a
+separate directory for each jetty package. the src directory of the relevant packages were merged
+into a single src directory. The relevant packages which were merged into the single src directory
+are:
+
 -jetty-client
 -jetty-continuation
 -jetty-http
@@ -34,15 +36,15 @@
 were copied from the maven repository into the lib directory. pom files and sha1 files are included
 with the prebuilt dependencies for reference.
 
-The eclipse files were created manually. The .classpath file includes the prebuilt dependencies in the
-lib directory and excludes the sources files that are not compatible with the android runtime (see
-"NON_ANDROID_SRC" in the Android.mk file). the .project file was copied from one of the .project
-files created by maven.
+The eclipse files were created manually. The .classpath file includes the prebuilt dependencies in
+the lib directory and excludes the source files that are not compatible with the android runtime
+(see "NON_ANDROID_SRC" in the Android.mk file or nonAndroidSrc in the build.gradle file). The
+.project file was copied from one of the .project files created by maven.
 
 Updating this Project
 -------------------
-To update this project, the updated packages should be fetched from maven and their src directories should
-be merged with the local src directory. Any new or updated prebuilt dependencies should be copied into
-the lib directory. The Android.mk file (.classpath file for eclipse) should be updated accordingly. It
-may be necessary to add more files to "NON_ANDROID_SRC" in the Android.mk file (the excluding element
-in .classpath for eclipse).
+To update this project, the updated packages should be fetched from maven and their src directories
+should be merged with the local src directory. Any new or updated prebuilt dependencies should be
+copied into the lib directory. The Android.mk file (.classpath file for eclipse) should be updated
+accordingly. It may be necessary to add more files to "NON_ANDROID_SRC" in the Android.mk file and
+nonAndroidSrc in the build.gradle file (the excluding element in .classpath for eclipse).
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..ba2a263
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,48 @@
+apply plugin: 'com.android.library'
+
+def nonAndroidSrc = [
+    "org/eclipse/jetty/jmx/ConnectorServer.java",
+    "org/eclipse/jetty/jmx/MBeanContainer.java",
+    "org/eclipse/jetty/jmx/ObjectMBean.java",
+    "org/eclipse/jetty/servlet/jmx/ServletMappingMBean.java",
+    "org/eclipse/jetty/servlet/jmx/FilterMappingMBean.java",
+    "org/eclipse/jetty/servlet/jmx/HolderMBean.java",
+    "org/eclipse/jetty/util/log/jmx/LogMBean.java",
+    "org/eclipse/jetty/server/jmx/ServerMBean.java",
+    "org/eclipse/jetty/server/handler/jmx/AbstractHandlerMBean.java",
+    "org/eclipse/jetty/server/handler/jmx/ContextHandlerMBean.java",
+    "org/eclipse/jetty/servlet/StatisticsServlet.java",
+    "org/eclipse/jetty/server/session/jmx/AbstractSessionManagerMBean.java",
+    "org/eclipse/jetty/security/SpnegoUserIdentity.java",
+    "org/eclipse/jetty/security/SpnegoUserPrincipal.java",
+    "org/eclipse/jetty/security/SpnegoLoginService.java",
+    "org/eclipse/jetty/server/session/JDBCSessionIdManager.java",
+    "org/eclipse/jetty/util/preventers/AppContextLeakPreventer.java",
+    "org/eclipse/jetty/util/preventers/AWTLeakPreventer.java",
+    "org/eclipse/jetty/servlet/listener/IntrospectorCleaner.java",
+    "org/eclipse/jetty/util/preventers/AppContextLeakPreventer.java",
+    "org/eclipse/jetty/util/preventers/AWTLeakPreventer.java",
+    "org/eclipse/jetty/server/session/JDBCSessionManager.java"
+]
+
+android {
+    sourceSets {
+        main {
+            manifest.srcFile 'AndroidManifest.xml'
+            java.srcDirs = ["src/java"]
+            java.exclude nonAndroidSrc
+        }
+        compileOptions {
+            sourceCompatibility JavaVersion.VERSION_1_7
+            targetCompatibility JavaVersion.VERSION_1_7
+        }
+    }
+}
+
+dependencies {
+    compile files(
+        "lib/javax.servlet-3.0.0.v201112011016.jar",
+        "lib/jetty-util-6.1.26.jar",
+        "lib/slf4j-api-1.6.1.jar",
+        "lib/slf4j-jdk14-1.6.1.jar")
+}