build.gradle 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. // Top-level build file where you can add configuration options common to all sub-projects/modules.
  2. buildscript {
  3. repositories {
  4. jcenter()
  5. mavenCentral()
  6. google()
  7. }
  8. dependencies {
  9. classpath 'com.android.tools.build:gradle:3.5.0'
  10. // NOTE: Do not place your application dependencies here; they belong
  11. // in the individual module build.gradle files
  12. classpath 'org.ajoberstar:grgit:1.1.0'
  13. // https://github.com/Triple-T/gradle-play-publisher#usage
  14. classpath 'com.github.triplet.gradle:play-publisher:2.4.1'
  15. }
  16. }
  17. plugins {
  18. // obtain revision from git
  19. id 'org.ajoberstar.grgit' version '1.6.0'
  20. }
  21. allprojects {
  22. repositories {
  23. mavenLocal()
  24. google()
  25. jcenter()
  26. }
  27. }
  28. /////////////// yaxim specific build rules ///////////////
  29. apply plugin: 'com.android.application'
  30. apply plugin: 'com.github.triplet.play'
  31. // gradle rule to download sources for AS (because AS can't on its own)
  32. // run as: `gradle cleanIdea idea`
  33. apply plugin: 'idea'
  34. idea {
  35. module {
  36. downloadJavadoc = true
  37. downloadSources = true
  38. }
  39. }
  40. ext {
  41. build_date = "${new Date().format('yyyy-MM-dd')}"
  42. build_revision = "${grgit.describe()}"
  43. build_version = "yaxim ${build_revision} ${build_date}"
  44. }
  45. task buildVersion (type: Copy) {
  46. from("template") {
  47. include "version.xml"
  48. expand( build_date: build_date,
  49. build_revision: build_revision,
  50. build_version: build_version)
  51. }
  52. into("res/values")
  53. outputs.upToDateWhen {
  54. false
  55. }
  56. }
  57. android {
  58. compileSdkVersion 28
  59. buildToolsVersion "28.0.3"
  60. useLibrary 'org.apache.http.legacy'
  61. flavorDimensions ("style", "distribution")
  62. defaultConfig {
  63. applicationId "org.yaxim"
  64. minSdkVersion 14
  65. //noinspection ExpiredTargetSdkVersion
  66. targetSdkVersion 28
  67. versionName "$build_revision"
  68. vectorDrawables.useSupportLibrary = true
  69. }
  70. if (project.hasProperty("RELEASE_KEY_ALIAS")) {
  71. signingConfigs {
  72. release {
  73. storeFile file(RELEASE_STORE_FILE)
  74. storePassword RELEASE_STORE_PASSWORD
  75. keyAlias RELEASE_KEY_ALIAS
  76. keyPassword RELEASE_KEY_PASSWORD
  77. }
  78. }
  79. buildTypes {
  80. release {
  81. signingConfig signingConfigs.release
  82. }
  83. }
  84. }
  85. buildTypes {
  86. debug {
  87. minifyEnabled true
  88. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
  89. }
  90. release {
  91. minifyEnabled true
  92. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
  93. }
  94. }
  95. productFlavors {
  96. yaxim {
  97. dimension "style"
  98. applicationIdSuffix "androidclient"
  99. }
  100. bruno {
  101. dimension "style"
  102. applicationIdSuffix "bruno"
  103. }
  104. play {
  105. dimension "distribution"
  106. }
  107. free {
  108. dimension "distribution"
  109. }
  110. }
  111. sourceSets {
  112. main {
  113. manifest.srcFile 'AndroidManifest.xml'
  114. java.srcDirs = ['src']
  115. resources.srcDirs = ['src']
  116. aidl.srcDirs = ['src']
  117. renderscript.srcDirs = ['src']
  118. res.srcDirs = ['res']
  119. assets.srcDirs = ['assets']
  120. }
  121. yaxim {
  122. java.srcDirs = ['yaxim/src']
  123. res.srcDirs = ['yaxim/res']
  124. assets.srcDirs = ['yaxim/assets']
  125. }
  126. bruno {
  127. java.srcDirs = ['bruno/src']
  128. res.srcDirs = ['bruno/res']
  129. assets.srcDirs = ['bruno/assets']
  130. }
  131. play {
  132. manifest.srcFile 'play/AndroidManifest.xml'
  133. java.srcDirs = ['play/src']
  134. res.srcDirs = ['play/res']
  135. assets.srcDirs = ['play/assets']
  136. }
  137. free {
  138. java.srcDirs = ['free/src']
  139. }
  140. }
  141. lintOptions {
  142. disable 'MissingTranslation'
  143. }
  144. }
  145. play {
  146. serviceAccountCredentials = file('play-publish-credentials.json')
  147. track = 'beta'
  148. }
  149. dependencies {
  150. def SMACK_VERSION = "4.3.5-SNAPSHOT"
  151. // Google Push via FCM
  152. playImplementation('com.google.firebase:firebase-messaging:17.3.4') {
  153. exclude group: 'com.google.firebase', module: 'firebase-core'
  154. exclude group: 'com.google.firebase', module: 'firebase-analytics'
  155. exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
  156. }
  157. implementation 'com.android.support:appcompat-v7:28.0.0'
  158. // implicit compile 'com.android.support:support-v4:25.+'
  159. implementation project('MemorizingTrustManager')
  160. api fileTree(include: ['*.jar'], dir: 'libs')
  161. api fileTree(include: ['*.aar'], dir: 'libs')
  162. implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
  163. implementation 'org.hsluv:hsluv:0.2'
  164. implementation 'com.koushikdutta.urlimageviewhelper:urlimageviewhelper:1.0.4'
  165. implementation 'com.google.zxing:core:3.3.3'
  166. // play referrer
  167. playImplementation 'com.android.installreferrer:installreferrer:1.1'
  168. // smack4
  169. //compile project("Smack:smack-android-extensions")
  170. //compile project("Smack:smack-tcp")
  171. //compile project("Smack:smack-im")
  172. //// for Carbons, and other
  173. //compile project("Smack:smack-experimental")
  174. implementation 'org.jxmpp:jxmpp-jid:0.6.4-SNAPSHOT'
  175. implementation "org.igniterealtime.smack:smack-android-extensions:$SMACK_VERSION"
  176. implementation "org.igniterealtime.smack:smack-tcp:$SMACK_VERSION"
  177. implementation "org.igniterealtime.smack:smack-im:$SMACK_VERSION"
  178. // for Carbons, and other
  179. implementation "org.igniterealtime.smack:smack-experimental:$SMACK_VERSION"
  180. }
  181. // for smack4
  182. configurations {
  183. all*.exclude group: 'xpp3', module: 'xpp3'
  184. }
  185. preBuild.dependsOn buildVersion
  186. // required to fill applicationId into prefs XML files
  187. afterEvaluate {
  188. android.applicationVariants.all { variant ->
  189. variant.resValue 'string', 'application_id', variant.applicationId
  190. }
  191. }