Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.22 KB | None | 0 0
  1. apply plugin: 'com.android.application'
  2. //apply plugin: 'io.fabric'
  3.  
  4. repositories {
  5. // maven { url 'https://maven.fabric.io/public' }
  6. }
  7. android {
  8. signingConfigs {
  9. release {
  10. keyAlias '********'
  11. storeFile file('********')
  12. keyPassword '********'
  13. storePassword '********'
  14. }
  15. }
  16. compileSdkVersion 27
  17. buildToolsVersion '27.0.2'
  18. def versionPropsFile = file('version.properties')
  19. def versionBuild, versionMajor, versionMinor, versionBugFix
  20. /*Setting default value for versionBuild which is the last incremented value stored in the file */
  21. if (versionPropsFile.canRead()) {
  22. def Properties versionProps = new Properties()
  23. versionProps.load(new FileInputStream(versionPropsFile))
  24. versionBuild = versionProps['VERSION_BUILD'].toInteger()
  25. versionMajor = versionProps['MAJOR_REVISION'].toInteger()
  26. versionMinor = versionProps['MINOR_REVISION'].toInteger()
  27. versionBugFix = versionProps['BUG_FIX'].toInteger()
  28. } else {
  29. throw new GradleException("Could not read version.properties!")
  30. }
  31. /*Wrapping inside a method avoids auto incrementing on every gradle task run. Now it runs only when we build apk*/
  32. ext.autoIncrementBuildNumber = {
  33.  
  34. if (versionPropsFile.canRead()) {
  35. def Properties versionProps = new Properties()
  36. versionProps.load(new FileInputStream(versionPropsFile))
  37. /* increment build version */
  38. versionBuild = versionProps['VERSION_BUILD'].toInteger() + 1
  39. versionProps['VERSION_BUILD'] = versionBuild.toString()
  40. versionProps.store(versionPropsFile.newWriter(), null)
  41. /* END */
  42.  
  43. /* increment major revision when new UI or new features */
  44. // versionMajor = versionProps['MAJOR_REVISION'].toInteger() + 1
  45. // versionMajor['MAJOR_REVISION'] = versionBuild.toString()
  46. // versionMajor.store(versionPropsFile.newWriter(), null)
  47. /* END */
  48.  
  49. /* increment minor revision when change to a feature or 1 added feature or collection of bug fixes */
  50. // versionMinor = versionProps['MINOR_REVISION'].toInteger() + 1
  51. // versionMinor['MINOR_REVISION'] = versionBuild.toString()
  52. // versionMinor.store(versionPropsFile.newWriter(), null)
  53. /* END */
  54.  
  55. /* increment bug fix*/
  56. // versionBugFix = versionProps['BUG_FIX'].toInteger() + 1
  57. // versionBugFix['BUG_FIX'] = versionBuild.toString()
  58. // versionBugFix.store(versionPropsFile.newWriter(), null)
  59. /* END */
  60.  
  61. } else {
  62. throw new GradleException("Could not read version.properties!")
  63. }
  64. }
  65. defaultConfig {
  66. applicationId 'com.username.appname'
  67. minSdkVersion 16
  68. targetSdkVersion 27
  69. // multiDexEnabled true
  70. versionCode versionBuild
  71. versionName "1.0.0"
  72. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  73. // vectorDrawables.useSupportLibrary = true
  74. }
  75. buildTypes {
  76. release {
  77. minifyEnabled false
  78. // shrinkResources true
  79. zipAlignEnabled true
  80. // multiDexEnabled true
  81. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  82. signingConfig signingConfigs.release
  83. }
  84. debug {
  85. minifyEnabled false
  86. debuggable true
  87. applicationIdSuffix '.debug'
  88. versionNameSuffix ' (debug)'
  89. }
  90. beta {
  91. debuggable true
  92. jniDebuggable false
  93. // signingConfig signingConfigs.release
  94. renderscriptDebuggable false
  95. renderscriptOptimLevel 3
  96. minifyEnabled true
  97. applicationIdSuffix '.beta'
  98. versionNameSuffix ' (beta)'
  99. zipAlignEnabled true
  100. }
  101. }
  102.  
  103. gradle.taskGraph.whenReady { taskGraph ->
  104. if (taskGraph.hasTask(assembleDebug)) { /* when run debug task */
  105. autoIncrementBuildNumber()
  106. }
  107. }
  108.  
  109. configurations.all {
  110. resolutionStrategy {
  111. // failOnVersionConflict()
  112. }
  113. // resolutionStrategy.eachDependency { DependencyResolveDetails details ->
  114. // def requested = details.requested
  115. // if (requested.group == 'com.android.support') {
  116. // if (!requested.name.startsWith("multidex")) {
  117. // details.useVersion '26.0.0-alpha1'
  118. // }
  119. // }
  120. // }
  121. }
  122. }
  123.  
  124. dependencies {
  125. compile fileTree(include: ['*.jar'], dir: 'libs')
  126. androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
  127. exclude group: 'com.android.support'
  128. })
  129. compile "com.android.support:support-core-utils:27.0.2"
  130. // compile('com.crashlytics.sdk.android:crashlytics:2.7.0@aar') {
  131. // transitive = true;
  132. // }
  133. compile 'com.android.support:design:25.4.0'
  134. compile 'com.android.support:cardview-v7:25.4.0'
  135. compile 'com.android.support:recyclerview-v7:25.4.0'
  136. compile 'com.android.support:support-v4:25.4.0'
  137. compile 'com.android.support:support-vector-drawable:25.4.0'
  138. compile 'com.android.support.constraint:constraint-layout:1.0.2'
  139. compile('com.yydcdut:rxmarkdown:0.1.1-beta') {
  140. exclude group: 'io.reactivex', module: 'rxjava'
  141. exclude group: 'com.android.support'
  142. }
  143. compile('io.reactivex:rxandroid:1.2.0') {
  144. exclude group: 'io.reactivex', module: 'rxjava'
  145. }
  146. compile('io.reactivex:rxjava:1.1.5') {
  147. exclude group: 'com.android.support'
  148. }
  149. compile 'com.android.support:appcompat-v7:25.4.0'
  150. compile('com.facebook.android:facebook-android-sdk:4.26.0') {
  151. exclude group: 'com.android.support'
  152. }
  153. compile('com.parse.bolts:bolts-tasks:1.4.0') {
  154. exclude group: 'com.android.support'
  155. }
  156. // compile('com.parse.bolts:bolts-applinks:1.4.0') {
  157. // exclude group: 'com.android.support'
  158. // }
  159. compile('com.google.firebase:firebase-messaging:11.0.4') {
  160. exclude group: 'com.google.android.gms', module: 'play-services-basement'
  161. exclude group: 'com.google.firebase', module: 'firebase-common'
  162. exclude group: 'com.android.support'
  163. }
  164. compile('com.google.android.gms:play-services-auth:11.0.4') {
  165. exclude group: 'com.google.android.gms', module: 'play-services-basement'
  166. exclude group: 'com.android.support'
  167. }
  168. compile('com.google.android.gms:play-services-ads:11.0.4') {
  169. exclude group: 'com.google.android.gms', module: 'play-services-basement'
  170. exclude group: 'com.android.support'
  171. }
  172. compile('com.parse:parse-android:1.16.2') {
  173. exclude group: 'com.android.support'
  174. }
  175. compile('com.squareup.picasso:picasso:2.5.2') {
  176. exclude group: 'com.android.support'
  177. }
  178. compile('com.nononsenseapps:filepicker:4.1.0') {
  179. exclude group: 'com.android.support'
  180. }
  181. compile('com.github.clans:fab:1.6.4') {
  182. exclude group: 'com.android.support'
  183. }
  184. compile('com.github.barteksc:android-pdf-viewer:2.7.0') {
  185. exclude group: 'com.android.support'
  186. }
  187. testCompile 'junit:junit:4.12'
  188. }
  189. apply plugin: 'com.google.gms.google-services'
  190.  
  191. // Top-level build file where you can add configuration options common to all sub-projects/modules.
  192.  
  193. buildscript {
  194. repositories {
  195. jcenter()
  196. // maven { url 'https://maven.fabric.io/public' }
  197. maven {
  198. url 'https://maven.google.com/'
  199. name 'Google'
  200. }
  201. }
  202. dependencies {
  203. classpath 'com.android.tools.build:gradle:3.0.1'
  204. classpath 'com.google.gms:google-services:3.1.1'
  205. // classpath 'io.fabric.tools:gradle:1.24.2'
  206.  
  207. // NOTE: Do not place your application dependencies here; they belong
  208. // in the individual module build.gradle files
  209. }
  210. }
  211.  
  212. allprojects {
  213. repositories {
  214. jcenter()
  215. flatDir {
  216. dirs 'libs'
  217. }
  218. // maven { url "https://jitpack.io" }
  219. maven {
  220. url 'https://maven.google.com/'
  221. name 'Google'
  222. }
  223. }
  224. }
  225.  
  226. task clean(type: Delete) {
  227. delete rootProject.buildDir
  228. }
  229.  
  230. google()
  231.  
  232. maven {
  233. url 'https://maven.google.com/'
  234. name 'Google'
  235. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement