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    flavorDimensions 'compat'
17
18    productFlavors {
19        // DEPRECATED: Platform version that will not include the compatibility libraries
20        platformDeprecated {
21            dimension 'compat'
22            // TODO(yukl): Bump this file to v28 once we can properly test that
23            minSdkVersion 27
24        }
25
26        // Provides backwards compatibility for Gingerbread or above, using support libraries.
27        gingerbreadCompat {
28            dimension 'compat'
29            minSdkVersion 14
30        }
31    }
32
33    sourceSets {
34        main {
35            manifest.srcFile 'main/AndroidManifest.xml'
36            java.srcDirs = ['main/src']
37            resources.srcDirs = ['main/src']
38            res.srcDirs = ['main/res']
39        }
40
41        platformDeprecated {
42            java.srcDirs = ['platform/src']
43            res.srcDirs = ['platform/res']
44        }
45
46        gingerbreadCompat {
47            java.srcDirs = ['gingerbread/src', 'recyclerview/src']
48            res.srcDirs = ['gingerbread/res', 'recyclerview/res']
49        }
50    }
51}
52
53dependencies {
54    // Read the dependencies from the "deps" map in the extra properties.
55    //
56    // For builds in the Android tree we want to build the dependencies from source
57    // for reproducible builds, for example in build.gradle define something like
58    // this:
59    //      ext {
60    //          deps = ['project-name': project(':project-path')]
61    //      }
62    //
63    // For standalone project clients, since the source may not be available, we
64    // fetch the dependencies from maven. For example in standalone.gradle define
65    // something like this:
66    //      ext {
67    //          deps = ['project-name': 'com.example.group:project-name:1.0.0']
68    //      }
69    //
70    platformDeprecatedCompile deps['support-annotations']
71
72    gingerbreadCompatCompile deps['support-appcompat-v7']
73    gingerbreadCompatCompile deps['support-recyclerview-v7']
74}
75