]> gitweb.fperrin.net Git - Dictionary.git/blob - build.gradle
Add a few hacks to reduce size of ICU library.
[Dictionary.git] / build.gradle
1 buildscript {
2     repositories {
3         jcenter()
4     }
5     dependencies {
6         classpath 'com.android.tools.build:gradle:1.2.3'
7     }
8 }
9
10 apply plugin: 'com.android.application'
11
12 repositories {
13     jcenter()
14 }
15 configurations {
16     smallicu
17 }
18 dependencies {
19     compile 'com.android.support:appcompat-v7:21.0.3'
20     // Note: you can just replace "smallicu" by compile
21     // and remove the "compile files" part if you do not
22     // care about the size of the apk
23     smallicu 'com.ibm.icu:icu4j:55.1'
24     compile files('build/icu4j-55.1.small.jar') {
25         builtBy 'makesmallicu'
26     }
27 }
28
29 task makesmallicu (dependsOn: configurations.smallicu) << {
30     exec {
31         commandLine "./mksmallicu.sh", "${configurations.smallicu.resolve()[0]}", "build/icu4j-55.1.small.jar"
32     }
33 }
34
35 android {
36     compileSdkVersion 21
37     buildToolsVersion "22.0.1"
38     buildTypes {
39         debug {
40             applicationIdSuffix ".debug"
41         }
42         release {
43             minifyEnabled true
44         }
45     }
46     sourceSets {
47         main {
48             manifest.srcFile 'AndroidManifest.xml'
49             java.srcDirs = ['src', '../Util/src']
50             res.srcDirs = ['res']
51             assets.srcDirs = ['assets']
52         }
53
54         // Move the tests to tests/java, tests/res, etc...
55         instrumentTest.setRoot('tests')
56
57         // Move the build types to build-types/<type>
58         // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
59         // This moves them out of them default location under src/<type>/... which would
60         // conflict with src/ being used by the main source set.
61         // Adding new build types or product flavors should be accompanied
62         // by a similar customization.
63         debug.setRoot('build-types/debug')
64         release.setRoot('build-types/release')
65     }
66     defaultConfig {
67         applicationId 'de.reimardoeffinger.quickdic'
68         targetSdkVersion 22
69     }
70 }