build.gradle 4.86 KB
Newer Older
Toni Beier's avatar
Toni Beier committed
1 2 3 4 5 6 7 8 9 10 11
apply plugin: 'com.android.library'
apply plugin: 'idea'

idea {
    module {
        downloadJavadoc = true
        downloadSources = true
    }
}

repositories {
12
    google()
Toni Beier's avatar
Toni Beier committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
    mavenCentral()
    jcenter()
}


android {
    publishNonDefault true
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src/main/java']
            resources.srcDirs = ['src/main/java']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['src/main/res']
            assets.srcDirs = ['assets']
        }

        androidTest.setRoot('tests')
    }
    compileSdkVersion 'Google Inc.:Google APIs:24'
    buildToolsVersion '25.0.3'
    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 19
38
        useLibrary 'org.apache.http.legacy'
Toni Beier's avatar
Toni Beier committed
39 40
        versionCode 1
        versionName '1.0'
41
        vectorDrawables.useSupportLibrary = true
Toni Beier's avatar
Toni Beier committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }

    buildTypes {
        /*doFirst {
            def configFilePath = System.getProperty("app.asist.config.file")
            File configFile
            if( configFilePath == null ) {
                configFile = rootProject.file( "app.configuration.properties" )
                if( !configFile.exists() ) {
                    configFile =
                }
            }
        }*/

        release {


            buildConfigField "boolean", "ASIST_DEBUG", "false"
            minifyEnabled true
            proguardFile '../proguard.cfg'
        }

        debug {
            buildConfigField "boolean", "ASIST_DEBUG", "true"
            minifyEnabled true
            proguardFile '../proguard.cfg'
            versionNameSuffix ' dev'
            copy {
                from('res/') {
                    include '**/*.xml'
                    filter { String line -> line.replaceAll('asistUrl', 'com.example.rev.flavor1.permission.MAPS_RECEIVE') }
                }
                into "$buildDir/res"
            }
        }
    }
    lintOptions {
        abortOnError false
    }

102

Toni Beier's avatar
Toni Beier committed
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
}

android.libraryVariants.all { variant ->
    variant.mergeResources.doLast {
        ext.env = System.getenv()
        //parseFile("${buildDir}/intermediates/res/${variant.dirName}/values/values.xml")
        //parseFile("${buildDir}/intermediates/incremental/mergeResources/${variant.dirName}/merger.xml")
        //parseFile("${buildDir}/intermediates/bundles/${variant.dirName}/res/values/values.xml")
        //parseFile("res/values/settings.xml")
    }
    variant.outputs[0].processResources.doLast {

    }
}

def version = '1.0'


def parseFile(name) {
    File valuesFile = file(name)
    println("Replacing revision number in " + valuesFile)
124
    println("Build number = " + $ { rootUrl })
Toni Beier's avatar
Toni Beier committed
125
    String content = valuesFile.getText('UTF-8')
126
    content = content.replaceAll('asistUrl', $ { rootUrl })
Toni Beier's avatar
Toni Beier committed
127 128 129 130 131 132 133 134
    valuesFile.write(content, 'UTF-8')
}

dependencies {
    compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
    compile 'me.dm7.barcodescanner:zxing:1.9.8'
    compile 'com.j256.ormlite:ormlite-android:4.48'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.9.4'
135 136 137 138
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:support-annotations:25.3.1'
Toni Beier's avatar
Toni Beier committed
139 140
    //simply compile google maps only
    //compile 'com.google.android.gms:play-services:11.8.0'
141 142 143 144
    compile 'com.google.android.gms:play-services-maps:12.0.1'
    compile 'com.google.android.gms:play-services-location:12.0.1'
    compile 'com.google.firebase:firebase-core:12.0.1'
    compile 'com.google.firebase:firebase-messaging:12.0.1'
Toni Beier's avatar
Toni Beier committed
145 146 147 148 149 150
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    compile 'com.jjoe64:graphview:3.1.3'
    compile 'com.github.machinarius:preferencefragment:0.1.2'
    compile 'com.loopj.android:android-async-http:1.4.5'
    compile 'org.greenrobot:eventbus:3.0.0'
    compile fileTree(include: ['*.jar'], dir: 'libs')
151
    compile 'com.android.support:support-vector-drawable:25.3.1'
152 153
    compile 'com.android.support.constraint:constraint-layout:1.1.3'
    compile 'com.android.support:preference-v7:25.3.1'
Toni Beier's avatar
Toni Beier committed
154 155 156 157 158 159 160
}

allprojects {
    tasks.withType(JavaCompile) {
        options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
    }
}