Add experimental support for standalone builds
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..f4cf756
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,55 @@
+import groovy.xml.XmlUtil
+
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 26
+ buildToolsVersion '26.0.2'
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ lintOptions {
+ abortOnError false
+ }
+ compileOptions {
+ targetCompatibility 1.8
+ sourceCompatibility 1.8
+ }
+}
+
+gradle.projectsEvaluated {
+ tasks.withType(JavaCompile) {
+ options.compilerArgs.add('-Xbootclasspath/p:app/libs/android.jar:app/libs/libcore.jar')
+ }
+}
+
+preBuild {
+
+ doLast {
+ def imlFile = file(project.name + ".iml")
+
+ try {
+ def parsedXml = (new XmlParser()).parse(imlFile)
+ def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
+ parsedXml.component[1].remove(jdkNode)
+
+ def sdkString = "Android API " + android.compileSdkVersion.substring("android-".length()) + " Platform"
+ new Node(parsedXml.component[1], 'orderEntry', ['type': 'jdk', 'jdkName': sdkString, 'jdkType': 'Android SDK'])
+ XmlUtil.serialize(parsedXml, new FileOutputStream(imlFile))
+
+ } catch (FileNotFoundException ex) {
+ ex.printStackTrace()
+ }
+ }
+}
+
+dependencies {
+ provided fileTree(include: ['*.jar'], dir: 'libs')
+
+ compile group: 'commons-io', name: 'commons-io', version: '2.6'
+}