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 10 apply plugin: 'com.android.library' 11 12 android { 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 21 28 } 29 30 // Compatibility build that provides the L layout for SDK versions ICS+ 31 icsCompat { 32 minSdkVersion 14 33 dependencies { 34 // Read the dependencies from the "deps" map in the extra properties. 35 // 36 // For builds in the Android tree we want to build the dependencies from source 37 // for reproducible builds, for example in build.gradle define something like 38 // this: 39 // ext { 40 // deps = ['project-name': project(':project-path')] 41 // } 42 // 43 // For standalone project clients, since the source may not be available, we 44 // fetch the dependencies from maven. For example in standalone.gradle define 45 // something like this: 46 // ext { 47 // deps = ['project-name': 'com.example.group:project-name:1.0.0'] 48 // } 49 // 50 icsCompatCompile deps['support-appcompat-v7'] 51 } 52 } 53 54 // Compatibility build that provides the L layout for SDK versions Eclair MR1+ 55 eclairMr1Compat { 56 minSdkVersion 7 57 dependencies { 58 eclairMr1CompatCompile deps['support-appcompat-v7'] 59 } 60 } 61 } 62 63 platform { 64 res.srcDirs = ['platform/res'] 65 } 66 67 icsCompat { 68 res.srcDirs = ['eclair-mr1/res'] 69 } 70 71 eclairMr1Compat { 72 res.srcDirs = ['eclair-mr1/res'] 73 } 74 75 androidTest { 76 manifest.srcFile 'test/AndroidManifest.xml' 77 java.srcDirs = ['test/src'] 78 res.srcDirs = ['test/res'] 79 } 80 } 81 } 82