Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apply plugin: 'com.android.application'
- //apply plugin: 'io.fabric'
- repositories {
- // maven { url 'https://maven.fabric.io/public' }
- }
- android {
- signingConfigs {
- release {
- keyAlias '********'
- storeFile file('********')
- keyPassword '********'
- storePassword '********'
- }
- }
- compileSdkVersion 27
- buildToolsVersion '27.0.2'
- def versionPropsFile = file('version.properties')
- def versionBuild, versionMajor, versionMinor, versionBugFix
- /*Setting default value for versionBuild which is the last incremented value stored in the file */
- if (versionPropsFile.canRead()) {
- def Properties versionProps = new Properties()
- versionProps.load(new FileInputStream(versionPropsFile))
- versionBuild = versionProps['VERSION_BUILD'].toInteger()
- versionMajor = versionProps['MAJOR_REVISION'].toInteger()
- versionMinor = versionProps['MINOR_REVISION'].toInteger()
- versionBugFix = versionProps['BUG_FIX'].toInteger()
- } else {
- throw new GradleException("Could not read version.properties!")
- }
- /*Wrapping inside a method avoids auto incrementing on every gradle task run. Now it runs only when we build apk*/
- ext.autoIncrementBuildNumber = {
- if (versionPropsFile.canRead()) {
- def Properties versionProps = new Properties()
- versionProps.load(new FileInputStream(versionPropsFile))
- /* increment build version */
- versionBuild = versionProps['VERSION_BUILD'].toInteger() + 1
- versionProps['VERSION_BUILD'] = versionBuild.toString()
- versionProps.store(versionPropsFile.newWriter(), null)
- /* END */
- /* increment major revision when new UI or new features */
- // versionMajor = versionProps['MAJOR_REVISION'].toInteger() + 1
- // versionMajor['MAJOR_REVISION'] = versionBuild.toString()
- // versionMajor.store(versionPropsFile.newWriter(), null)
- /* END */
- /* increment minor revision when change to a feature or 1 added feature or collection of bug fixes */
- // versionMinor = versionProps['MINOR_REVISION'].toInteger() + 1
- // versionMinor['MINOR_REVISION'] = versionBuild.toString()
- // versionMinor.store(versionPropsFile.newWriter(), null)
- /* END */
- /* increment bug fix*/
- // versionBugFix = versionProps['BUG_FIX'].toInteger() + 1
- // versionBugFix['BUG_FIX'] = versionBuild.toString()
- // versionBugFix.store(versionPropsFile.newWriter(), null)
- /* END */
- } else {
- throw new GradleException("Could not read version.properties!")
- }
- }
- defaultConfig {
- applicationId 'com.username.appname'
- minSdkVersion 16
- targetSdkVersion 27
- // multiDexEnabled true
- versionCode versionBuild
- versionName "1.0.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
- // vectorDrawables.useSupportLibrary = true
- }
- buildTypes {
- release {
- minifyEnabled false
- // shrinkResources true
- zipAlignEnabled true
- // multiDexEnabled true
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- signingConfig signingConfigs.release
- }
- debug {
- minifyEnabled false
- debuggable true
- applicationIdSuffix '.debug'
- versionNameSuffix ' (debug)'
- }
- beta {
- debuggable true
- jniDebuggable false
- // signingConfig signingConfigs.release
- renderscriptDebuggable false
- renderscriptOptimLevel 3
- minifyEnabled true
- applicationIdSuffix '.beta'
- versionNameSuffix ' (beta)'
- zipAlignEnabled true
- }
- }
- gradle.taskGraph.whenReady { taskGraph ->
- if (taskGraph.hasTask(assembleDebug)) { /* when run debug task */
- autoIncrementBuildNumber()
- }
- }
- configurations.all {
- resolutionStrategy {
- // failOnVersionConflict()
- }
- // resolutionStrategy.eachDependency { DependencyResolveDetails details ->
- // def requested = details.requested
- // if (requested.group == 'com.android.support') {
- // if (!requested.name.startsWith("multidex")) {
- // details.useVersion '26.0.0-alpha1'
- // }
- // }
- // }
- }
- }
- dependencies {
- compile fileTree(include: ['*.jar'], dir: 'libs')
- androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
- exclude group: 'com.android.support'
- })
- compile "com.android.support:support-core-utils:27.0.2"
- // compile('com.crashlytics.sdk.android:crashlytics:2.7.0@aar') {
- // transitive = true;
- // }
- compile 'com.android.support:design:25.4.0'
- compile 'com.android.support:cardview-v7:25.4.0'
- compile 'com.android.support:recyclerview-v7:25.4.0'
- compile 'com.android.support:support-v4:25.4.0'
- compile 'com.android.support:support-vector-drawable:25.4.0'
- compile 'com.android.support.constraint:constraint-layout:1.0.2'
- compile('com.yydcdut:rxmarkdown:0.1.1-beta') {
- exclude group: 'io.reactivex', module: 'rxjava'
- exclude group: 'com.android.support'
- }
- compile('io.reactivex:rxandroid:1.2.0') {
- exclude group: 'io.reactivex', module: 'rxjava'
- }
- compile('io.reactivex:rxjava:1.1.5') {
- exclude group: 'com.android.support'
- }
- compile 'com.android.support:appcompat-v7:25.4.0'
- compile('com.facebook.android:facebook-android-sdk:4.26.0') {
- exclude group: 'com.android.support'
- }
- compile('com.parse.bolts:bolts-tasks:1.4.0') {
- exclude group: 'com.android.support'
- }
- // compile('com.parse.bolts:bolts-applinks:1.4.0') {
- // exclude group: 'com.android.support'
- // }
- compile('com.google.firebase:firebase-messaging:11.0.4') {
- exclude group: 'com.google.android.gms', module: 'play-services-basement'
- exclude group: 'com.google.firebase', module: 'firebase-common'
- exclude group: 'com.android.support'
- }
- compile('com.google.android.gms:play-services-auth:11.0.4') {
- exclude group: 'com.google.android.gms', module: 'play-services-basement'
- exclude group: 'com.android.support'
- }
- compile('com.google.android.gms:play-services-ads:11.0.4') {
- exclude group: 'com.google.android.gms', module: 'play-services-basement'
- exclude group: 'com.android.support'
- }
- compile('com.parse:parse-android:1.16.2') {
- exclude group: 'com.android.support'
- }
- compile('com.squareup.picasso:picasso:2.5.2') {
- exclude group: 'com.android.support'
- }
- compile('com.nononsenseapps:filepicker:4.1.0') {
- exclude group: 'com.android.support'
- }
- compile('com.github.clans:fab:1.6.4') {
- exclude group: 'com.android.support'
- }
- compile('com.github.barteksc:android-pdf-viewer:2.7.0') {
- exclude group: 'com.android.support'
- }
- testCompile 'junit:junit:4.12'
- }
- apply plugin: 'com.google.gms.google-services'
- // Top-level build file where you can add configuration options common to all sub-projects/modules.
- buildscript {
- repositories {
- jcenter()
- // maven { url 'https://maven.fabric.io/public' }
- maven {
- url 'https://maven.google.com/'
- name 'Google'
- }
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:3.0.1'
- classpath 'com.google.gms:google-services:3.1.1'
- // classpath 'io.fabric.tools:gradle:1.24.2'
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
- }
- allprojects {
- repositories {
- jcenter()
- flatDir {
- dirs 'libs'
- }
- // maven { url "https://jitpack.io" }
- maven {
- url 'https://maven.google.com/'
- name 'Google'
- }
- }
- }
- task clean(type: Delete) {
- delete rootProject.buildDir
- }
- google()
- maven {
- url 'https://maven.google.com/'
- name 'Google'
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement