• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/**
2 * Base rules for building setup wizard library. This build file is not used directly but rather
3 * included in scripts like build.gradle or standalone.gradle using 'apply from'.
4 *
5 * This allows the dependencies to be configured so that for builds in the Android tree, the
6 * dependencies like support library is built directly from source, while for standalone builds they
7 * will be fetched from maven central.
8 */
9
10apply plugin: 'com.android.library'
11
12android {
13
14    publishNonDefault true
15
16    sourceSets {
17        main {
18            manifest.srcFile 'main/AndroidManifest.xml'
19            java.srcDirs = ['main/src']
20            resources.srcDirs = ['main/src']
21            res.srcDirs = ['main/res']
22        }
23
24        productFlavors {
25            // Platform version that will not include the compatibility libraries
26            platform {
27                minSdkVersion 23
28
29                dependencies {
30                    // Read the dependencies from the "deps" map in the extra properties.
31                    //
32                    // For builds in the Android tree we want to build the dependencies from source
33                    // for reproducible builds, for example in build.gradle define something like
34                    // this:
35                    //      ext {
36                    //          deps = ['project-name': project(':project-path')]
37                    //      }
38                    //
39                    // For standalone project clients, since the source may not be available, we
40                    // fetch the dependencies from maven. For example in standalone.gradle define
41                    // something like this:
42                    //      ext {
43                    //          deps = ['project-name': 'com.example.group:project-name:1.0.0']
44                    //      }
45                    //
46                    platformCompile deps['support-annotations']
47                }
48            }
49
50            // Provides backwards compatibility for Gingerbread or above, using support libraries.
51            gingerbreadCompat {
52                minSdkVersion 9
53                dependencies {
54                    gingerbreadCompatCompile deps['support-appcompat-v7']
55                    gingerbreadCompatCompile deps['support-recyclerview-v7']
56                }
57            }
58        }
59
60        platform {
61            java.srcDirs = ['platform/src']
62            res.srcDirs = ['platform/res']
63        }
64
65        gingerbreadCompat {
66            java.srcDirs = ['gingerbread/src', 'recyclerview/src']
67            res.srcDirs = ['gingerbread/res', 'recyclerview/res']
68        }
69    }
70}
71