]> gitweb.fperrin.net Git - Dictionary.git/blob - build.gradle
Add comment to gradle bug workaround.
[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:22.2.1'
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("$buildDir/icu4j-55.1.small.jar") {
25         builtBy 'makesmallicu'
26     }
27 }
28
29 task makesmallicu (type:Exec, dependsOn: configurations.smallicu) {
30     inputs.file "mksmallicu.sh"
31     inputs.file "${configurations.smallicu.resolve()[0]}"
32     outputs.dir "$buildDir"
33     outputs.file "$buildDir/icu4j-55.1.small.jar"
34     // necessary due to gradle bug: GRADLE-2638
35     new File("$buildDir").mkdirs()
36     commandLine "./mksmallicu.sh", "${configurations.smallicu.resolve()[0]}", "$buildDir/icu4j-55.1.small.jar"
37 }
38
39 android {
40     compileSdkVersion 22
41     buildToolsVersion "23.0.1"
42     buildTypes {
43         debug {
44             applicationIdSuffix ".debug"
45         }
46         release {
47             minifyEnabled true
48             shrinkResources true
49         }
50     }
51     sourceSets {
52         main {
53             manifest.srcFile 'AndroidManifest.xml'
54             java.srcDirs = ['src', '../Util/src']
55             res.srcDirs = ['res']
56             assets.srcDirs = ['assets']
57         }
58
59         // Move the tests to tests/java, tests/res, etc...
60         instrumentTest.setRoot('tests')
61
62         // Move the build types to build-types/<type>
63         // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
64         // This moves them out of them default location under src/<type>/... which would
65         // conflict with src/ being used by the main source set.
66         // Adding new build types or product flavors should be accompanied
67         // by a similar customization.
68         debug.setRoot('build-types/debug')
69         release.setRoot('build-types/release')
70     }
71     defaultConfig {
72         applicationId 'de.reimardoeffinger.quickdic'
73         targetSdkVersion 22
74     }
75 }