Create "thin" build type and clean up previous commit.

The "thin" build type relies on system scala library, while "debug"
and "release" provide the library itself.
This commit is contained in:
Felix Ableitner 2014-12-02 19:01:32 +02:00
parent 873b7fd0bd
commit 5f123afcab
4 changed files with 52 additions and 29 deletions

View file

@ -1,6 +1,10 @@
Building
========
To build, run `./gradlew assembleDebug` or `./gradlew assembleRelease`.
To create a debug apk, run `./gradlew assembleDebug`. Alternatively, you can use
`.gradlew thinDebug` for a faster compile, but this requires Scala libraries installed
with [Android-Scala-Installer](https://github.com/Arneball/Android-Scala-Installer) on your device.
To create a release apk, run `./gradlew assembleRelease`.
License
=======

View file

@ -1,3 +1,6 @@
apply plugin: 'com.android.application'
apply plugin: 'jp.leafytree.android-scala'
buildscript {
repositories {
mavenCentral()
@ -7,11 +10,21 @@ buildscript {
classpath "jp.leafytree.gradle:gradle-android-scala-plugin:1.3.1"
}
}
repositories {
jcenter()
dependencies {
compile "com.android.support:support-v4:21.0.0"
// For `flat` debug config, as `flatProvided` is unknown.
provided "org.scala-lang:scala-library:2.11.4"
debugCompile "org.scala-lang:scala-library:2.11.4"
releaseCompile "org.scala-lang:scala-library:2.11.4"
compile("org.msgpack:msgpack-scala_2.11:0.6.11") {
transitive = false;
}
compile('org.msgpack:msgpack:0.6.11'){
transitive = false;
}
}
apply plugin: 'com.android.application'
apply plugin: 'jp.leafytree.android-scala'
android {
compileSdkVersion 21
@ -27,22 +40,22 @@ android {
sourceSets {
main {
scala {
srcDir "src/main/scala"
}
scala.srcDir "src/main/scala"
}
androidTest {
scala {
srcDir "src/androidTest/scala"
}
scala.srcDir "src/androidTest/scala"
}
}
buildTypes {
thin {
minifyEnabled false
applicationIdSuffix ".debug"
signingConfig signingConfigs.debug
}
debug {
// minifyEnabled true
proguardFile file("proguard-rules.pro")
minifyEnabled false
applicationIdSuffix ".debug"
}
release {
@ -51,6 +64,14 @@ android {
}
}
// Needed to rename `app-thin.apk` to `app-debug.apk` (because Android Studio doesn't let us
// specify a different apk name).
applicationVariants.all { variant ->
def apk = variant.outputFile;
def newName = apk.name.replace("app-thin", "app-debug");
variant.outputFile = new File(apk.parentFile, newName);
}
// Avoid duplicate file errors during packaging.
packagingOptions {
exclude 'decoder.properties'
@ -59,16 +80,3 @@ android {
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile "com.android.support:support-v4:21.+"
provided "org.scala-lang:scala-library:2.11.4"
compile("org.msgpack:msgpack-scala_2.11:0.6.11") {
transitive = false;
}
compile('org.msgpack:msgpack:0.6.11'){
transitive = false;
}
}

View file

@ -8,15 +8,13 @@
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-feature android:name="android.hardware.bluetooth" android:required="true" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<uses-library android:name="s1"/>
<uses-library android:name="s2"/>
<uses-library android:name="s3"/>
<activity
android:name=".activities.MainActivity"
android:label="@string/app_name"

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.nutomic.ensichat">
<application>
<uses-library android:name="s1" />
<uses-library android:name="s2" />
<uses-library android:name="s3" />
</application>
</manifest>