From 968d6db3b8947e39d7c62d1f3309a9f48cd00bdc Mon Sep 17 00:00:00 2001 From: Nico Alt Date: Fri, 10 Apr 2015 11:49:10 +0200 Subject: [PATCH] add Gradle/Android Studio support --- .gitignore | 46 ++++++++++++++++++++--- README.md | 17 +++++++-- build.gradle | 49 ++++++++++++++++++++++++ build.xml | 104 --------------------------------------------------- 4 files changed, 102 insertions(+), 114 deletions(-) create mode 100644 build.gradle delete mode 100644 build.xml diff --git a/.gitignore b/.gitignore index 8d9e3380..e9489c99 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,44 @@ +# Source: https://raw.githubusercontent.com/github/gitignore/master/Android.gitignore + +# Built application files *.apk -bin -gen -.* +*.ap_ + +# Files for the Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ + +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) local.properties -*.ipr -*.iws + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + +# Source: http://stackoverflow.com/a/17803964 +.DS_Store + +# Source: https://gitlab.com/fdroid/fdroidclient/raw/master/.gitignore +build.xml +gradlew +gradlew.bat +gradle-wrapper.jar +gradle-wrapper.properties +*~ +*.swp +.idea/ *.iml out -doc +.settings/ diff --git a/README.md b/README.md index 322369e4..7ec236f9 100644 --- a/README.md +++ b/README.md @@ -20,15 +20,24 @@ Building ======== To build you will need: - * A Java compiler compatible with Java 1.6 - * The Android SDK with platform 16 (JellyBean) installed + * A Java compiler compatible with Java 1.8 + * The Android SDK with platform 22 (Lollipop) installed -Building from command-line +Building from command-line #1 +-------------------------- + * `gradle build` to build the APK + * Optional: `gradle installDebug` to install the APK to a connected device + +Building from command-line #2 -------------------------- * `android update project --path .` to generate local.properties * `ant debug` to build the APK at bin/VanillaMusic-debug.apk * Optional: `ant installd` to install the APK to a connected device +Building with Android Studio +--------------------- +You can also build with Android Studio by importing this project into it. + Building from Eclipse --------------------- You can also build from Eclipse. Create a new Android Project, choosing "Create @@ -37,7 +46,7 @@ in project settings. Documentation ============= -Javadocs can be generated using `ant doc` +Javadocs can be generated using `gradle javadoc` or `ant doc` [1]: https://www.transifex.com/projects/p/vanilla-music-1/ diff --git a/build.gradle b/build.gradle new file mode 100644 index 00000000..4c18c0e7 --- /dev/null +++ b/build.gradle @@ -0,0 +1,49 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.1.0' + } +} + +allprojects { + repositories { + jcenter() + } +} + +apply plugin: 'com.android.application' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + applicationId "ch.blinkenlights.android.vanilla" + minSdkVersion 15 + targetSdkVersion 22 + } + + + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + java.srcDirs = ['src'] + resources.srcDirs = ['src'] + aidl.srcDirs = ['src'] + renderscript.srcDirs = ['src'] + res.srcDirs = ['res'] + assets.srcDirs = ['assets'] + } + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' + } + } +} diff --git a/build.xml b/build.xml deleted file mode 100644 index fd59f803..00000000 --- a/build.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Install "Documentation for Android SDK" from the Android SDK Manager to generate links to SDK documentation. - - - - -