| 1 |
<#if !(perModuleRepositories??) || perModuleRepositories> |
| 2 |
buildscript { |
| 3 |
repositories { |
| 4 |
jcenter() |
| 5 |
<#if mavenUrl != "mavenCentral"> |
| 6 |
maven { |
| 7 |
url '${mavenUrl}' |
| 8 |
} |
| 9 |
</#if> |
| 10 |
} |
| 11 |
dependencies { |
| 12 |
classpath 'com.android.tools.build:gradle:${gradlePluginVersion}' |
| 13 |
} |
| 14 |
} |
| 15 |
</#if> |
| 16 |
<#if isLibraryProject?? && isLibraryProject> |
| 17 |
apply plugin: 'com.android.library' |
| 18 |
<#else> |
| 19 |
apply plugin: 'com.android.application' |
| 20 |
</#if> |
| 21 |
<#if !(perModuleRepositories??) || perModuleRepositories> |
| 22 |
|
| 23 |
repositories { |
| 24 |
jcenter() |
| 25 |
<#if mavenUrl != "mavenCentral"> |
| 26 |
maven { |
| 27 |
url '${mavenUrl}' |
| 28 |
} |
| 29 |
</#if> |
| 30 |
} |
| 31 |
</#if> |
| 32 |
|
| 33 |
android { |
| 34 |
compileSdkVersion <#if buildApiString?matches("^\\d+$")>${buildApiString}<#else>'${buildApiString}'</#if> |
| 35 |
buildToolsVersion "${buildToolsVersion}" |
| 36 |
|
| 37 |
defaultConfig { |
| 38 |
<#if isLibraryProject?? && isLibraryProject> |
| 39 |
<#else> |
| 40 |
applicationId "${packageName}" |
| 41 |
</#if> |
| 42 |
minSdkVersion <#if minApi?matches("^\\d+$")>${minApi}<#else>'${minApi}'</#if> |
| 43 |
targetSdkVersion <#if targetApiString?matches("^\\d+$")>${targetApiString}<#else>'${targetApiString}'</#if> |
| 44 |
versionCode 1 |
| 45 |
versionName "1.0" |
| 46 |
|
| 47 |
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
| 48 |
|
| 49 |
<#if includeCppSupport!false && cppFlags != ""> |
| 50 |
externalNativeBuild { |
| 51 |
cmake { |
| 52 |
cppFlags "${cppFlags}" |
| 53 |
} |
| 54 |
} |
| 55 |
</#if> |
| 56 |
} |
| 57 |
<#if javaVersion?? && (javaVersion != "1.6" && buildApi lt 21 || javaVersion != "1.7")> |
| 58 |
|
| 59 |
compileOptions { |
| 60 |
sourceCompatibility JavaVersion.VERSION_${javaVersion?replace('.','_','i')} |
| 61 |
targetCompatibility JavaVersion.VERSION_${javaVersion?replace('.','_','i')} |
| 62 |
} |
| 63 |
</#if> |
| 64 |
<#if enableProGuard> |
| 65 |
buildTypes { |
| 66 |
release { |
| 67 |
minifyEnabled false |
| 68 |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
| 69 |
} |
| 70 |
} |
| 71 |
</#if> |
| 72 |
<#if includeCppSupport!false> |
| 73 |
externalNativeBuild { |
| 74 |
cmake { |
| 75 |
path "CMakeLists.txt" |
| 76 |
} |
| 77 |
} |
| 78 |
</#if> |
| 79 |
} |
| 80 |
|
| 81 |
dependencies { |
| 82 |
compile fileTree(dir: 'libs', include: ['*.jar']) |
| 83 |
androidTestCompile('com.android.support.test.espresso:espresso-core:${espressoVersion!"2.0"}', { |
| 84 |
exclude group: 'com.android.support', module: 'support-annotations' |
| 85 |
}) |
| 86 |
<#if WearprojectName?has_content && NumberOfEnabledFormFactors?has_content && NumberOfEnabledFormFactors gt 1 && Wearincluded> |
| 87 |
wearApp project(':${WearprojectName}') |
| 88 |
compile 'com.google.android.gms:play-services:+' |
| 89 |
</#if> |
| 90 |
} |