android: replace build system with gradle

This commit is contained in:
Vincent Bernat 2015-01-23 21:03:21 +01:00
parent 2a0aa5b986
commit d4d8ea9d42
6 changed files with 55 additions and 44 deletions

4
.gitignore vendored
View File

@ -1,3 +1,3 @@
/local.properties
/bin/
/gen/
/build
/.gradle

View File

@ -6,7 +6,7 @@
android:versionName="@string/app_versionName">
<uses-sdk
android:minSdkVersion="17"
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />

View File

@ -1 +0,0 @@
java.compilerargs=-Xlint:deprecation

52
build.gradle Normal file
View File

@ -0,0 +1,52 @@
import java.util.regex.Pattern
apply plugin: 'android'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.14.+'
}
}
repositories {
maven {
url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'
}
}
dependencies {
compile 'org.xwalk:xwalk_core_library:10.39.235.15'
}
android {
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
defaultConfig {
versionCode getVersionCodeFromManifest()
}
compileSdkVersion 21
buildToolsVersion "21.1.2"
}
def getVersionCodeFromManifest() {
def manifestFile = file(android.sourceSets.main.manifest.srcFile)
def pattern = Pattern.compile("versionCode=\"(\\d+)\"")
def matcher = pattern.matcher(manifestFile.getText())
matcher.find()
return Integer.parseInt(matcher.group(1))
}

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="DashKiosk" default="help">
<property file="local.properties" />
<property file="ant.properties" />
<property environment="env" />
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
<isset property="env.ANDROID_HOME" />
</condition>
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
unless="sdk.dir"
/>
<import file="custom_rules.xml" optional="true" />
<!-- version-tag: custom -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>

View File

@ -1,15 +0,0 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-19
android.library.reference.1=../../../../src/crosswalk-webview-7.35.136.0-arm/