[and, build] Gradle build files.

This commit is contained in:
d-kunin 2013-08-16 13:41:37 +03:00
parent 840d0d392e
commit 50a48cc791
6 changed files with 222 additions and 0 deletions

34
3rdparty/android-mwm/build.gradle vendored Normal file
View file

@ -0,0 +1,34 @@
apply plugin: 'android-library'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
android {
compileSdkVersion 17
buildToolsVersion "18.0.1"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}

View file

@ -0,0 +1,35 @@
apply plugin: 'android-library'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':3rdparty:play_licensing')
}
android {
compileSdkVersion 18
buildToolsVersion "18.0.1"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}

View file

@ -0,0 +1,34 @@
apply plugin: 'android-library'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
android {
compileSdkVersion 18
buildToolsVersion "18.0.1"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}

111
android/build.gradle Normal file
View file

@ -0,0 +1,111 @@
buildscript {
repositories { mavenCentral() }
dependencies { classpath 'com.android.tools.build:gradle:0.5.+' }
}
// need it for :clean
apply plugin:'base'
task ndkBuild(type:Exec) {
// TODO: add NDK_DEBUG=1
commandLine 'ndk-build', '-j', Runtime.runtime.availableProcessors(), 'V=1'
}
task ndkBuildClean(type:Exec) {
commandLine 'ndk-build','clean'
}
task copyNativeLibs(type: Copy, dependsOn: 'ndkBuild') {
from(new File('libs')) { include '**/*.so' }
into new File(buildDir, 'native-libs')
}
tasks.withType(Compile) { compileTask -> compileTask.dependsOn ndkBuild }
tasks.withType(Compile) { compileTask -> compileTask.dependsOn copyNativeLibs }
clean.dependsOn 'cleanCopyNativeLibs'
clean.dependsOn 'ndkBuildClean'
tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->
pkgTask.jniDir new File(buildDir, 'native-libs')
}
apply plugin: 'android'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':android-mwm')
compile project(':3rdparty:expansion_downloader')
}
def getVersionName() {
propVersionName
}
def getVersionCode() {
propVersionCode
}
def getPackageName() {
propPackageName
}
def getBaseName() {
propApkName + '_' + getVersionName()
}
android {
compileSdkVersion 18
buildToolsVersion "18.0.1"
project.archivesBaseName = getBaseName()
signingConfigs {
guidewithme {
storeFile file("debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}
buildTypes {
debug { jniDebugBuild true }
release { signingConfig signingConfigs.guidewithme }
}
defaultConfig {
versionCode getVersionCode()
versionName getVersionName()
minSdkVersion 9
targetSdkVersion 18
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}

View file

@ -0,0 +1,4 @@
propVersionCode=3
propVersionName=1.0.2
propPackageName=com.guidewithme.uk
propApkName=UK_GuideWithMe

4
android/settings.gradle Normal file
View file

@ -0,0 +1,4 @@
include ':3rdparty:play_licensing'
include ':3rdparty:expansion_downloader'
include ':android-mwm'
project(':android-mwm').projectDir = new File(settingsDir, '../3rdparty/android-mwm')