build.gradle 6.51 KB
Newer Older
1 2 3 4
apply plugin: "com.android.application"
apply plugin: "kotlin-android"
apply plugin: "kotlin-android-extensions"
apply plugin: "kotlin-kapt"
5
apply plugin: "androidx.navigation.safeargs.kotlin"
6
apply plugin: "com.diffplug.gradle.spotless"
7 8

android {
9 10
    def schema_location = "$projectDir/src/main/java/fr/chenry/android/freshrss/store/database/migrations".toString()

11 12 13 14 15
    compileSdkVersion 28
    defaultConfig {
        applicationId "fr.chenry.android.freshrss"
        minSdkVersion 21
        targetSdkVersion 28
augier's avatar
augier committed
16 17
        versionCode 11
        versionName "1.2.1"
18
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
19 20
        javaCompileOptions {
            annotationProcessorOptions {
21
                arguments = ["room.schemaLocation": schema_location]
22 23
            }
        }
24
    }
Christophe Henry's avatar
Christophe Henry committed
25

augier's avatar
augier committed
26 27 28 29 30 31 32 33 34 35
    testOptions {
        unitTests.all {
            testLogging {
                events "passed", "skipped", "failed", "standardOut", "standardError"
                outputs.upToDateWhen { false }
                showStandardStreams = true
            }
        }
    }

Christophe Henry's avatar
Christophe Henry committed
36
    lintOptions {
augier's avatar
augier committed
37
        disable "AllowBackup", "VectorPath", "GradleDependency", "MissingTranslation"
Christophe Henry's avatar
Christophe Henry committed
38 39
    }

40 41 42 43
    sourceSets {
        androidTest.assets.srcDirs += files(schema_location)
    }

44 45 46 47 48 49
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
        }
    }
50

51 52 53
    dataBinding {
        enabled = true
    }
Christophe Henry's avatar
Christophe Henry committed
54

55
    configurations.all {
56 57
        resolutionStrategy.force "com.google.code.findbugs:jsr305:1.3.9"
        exclude group: "com.google.guava", module: "listenablefuture"
58 59
    }

60 61 62 63 64 65
    applicationVariants.all { variant ->
        if (variant.name.contains("elease")) {
            variant.mergeAssetsProvider.get().doLast {
                delete new FileNameFinder().getFileNames(buildDir.absolutePath, "**/config.properties")
            }
        }
Christophe Henry's avatar
Christophe Henry committed
66
    }
67 68 69 70

    androidExtensions {
        experimental = true
    }
71 72
}

73 74 75 76 77 78 79 80 81 82 83 84 85
configurations {
    ktlint
}

spotless {
    format "misc", {
        target "**/*.gradle", "**/*.md", "**/.gitignore", "**/*.kt"
        trimTrailingWhitespace()
        endWithNewline()
    }
    kotlin {
        ktlint().userData([
            "trim_trailing_whitespace": true,
augier's avatar
augier committed
86 87
            "insert_final_newline"    : true,
            "max_line_length"         : 120,
88 89 90 91 92 93 94 95 96 97 98
        ])
    }
    format "xml", {
        target fileTree(".") {
            include "**/*.xml"
            exclude "**/build/**"
        }
        eclipseWtp("xml").configFile "$rootDir/freshrss.xmlformat.prefs".toString()
    }
}

99 100
dependencies {
    def lifecycle_version = "2.0.0"
101
    def room_version = "2.1.0-alpha04"
102
    def roomigrant_version = "0.1.7"
103
    def fuel_version = "2.0.1"
104
    def jackson_version = "2.9.6"
105 106 107 108
    def espresso_version = "3.1.1"
    def test_runnner_version = "1.1.1"
    def promise_version = "3.3.0"
    def android_support_version = "28.0.0"
Christophe Henry's avatar
Christophe Henry committed
109
    def android_navigation = "1.0.0"
110

111 112 113
    // Linter
    ktlint "com.github.shyiko:ktlint:0.31.0"

114 115
    implementation "androidx.legacy:legacy-support-v4:1.0.0"
    implementation fileTree(include: ["*.jar"], dir: "libs")
Christophe Henry's avatar
Christophe Henry committed
116 117

    // Kotlin stuff
118 119
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
Christophe Henry's avatar
Christophe Henry committed
120 121

    // Compat libraries
122 123 124 125
    implementation "com.android.support:appcompat-v7:$android_support_version"
    implementation "com.android.support:preference-v7:$android_support_version"
    implementation "com.android.support:support-core-utils:$android_support_version"
    implementation "com.android.support:support-fragment:$android_support_version"
126
    implementation "com.android.support:support-compat:$android_support_version"
127
    implementation "com.android.support:support-core-ui:$android_support_version"
Christophe Henry's avatar
Christophe Henry committed
128 129

    // AndroidX layout
Christophe Henry's avatar
Christophe Henry committed
130
    implementation "androidx.appcompat:appcompat:1.1.0-alpha04"
131
    implementation "androidx.core:core-ktx:1.1.0-alpha05"
132
    implementation "com.google.android.material:material:1.1.0-alpha05"
133 134
    implementation "androidx.constraintlayout:constraintlayout:1.1.3"
    implementation "androidx.recyclerview:recyclerview:1.0.0"
135 136

    // ViewModel and LiveData
137
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
138 139
    implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
    implementation "androidx.lifecycle:lifecycle-reactivestreams-ktx:$lifecycle_version"
140
    kapt "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
141
    androidTestImplementation "androidx.arch.core:core-testing:$lifecycle_version"
142

Christophe Henry's avatar
Christophe Henry committed
143
    // Room
144
    kapt "androidx.room:room-compiler:$room_version"
145
    implementation "androidx.room:room-runtime:$room_version"
146 147 148
    implementation "androidx.room:room-rxjava2:$room_version"
    implementation "androidx.room:room-guava:$room_version"
    implementation "androidx.room:room-coroutines:$room_version"
149 150 151 152
    androidTestImplementation "androidx.room:room-testing:$room_version"
    // roomigrant
    implementation "com.github.MatrixDev.Roomigrant:RoomigrantLib:$roomigrant_version"
    kapt "com.github.MatrixDev.Roomigrant:RoomigrantCompiler:$roomigrant_version"
153

154
    // HTTP and promises
155 156
    implementation "com.github.kittinunf.fuel:fuel:$fuel_version"
    implementation "com.github.kittinunf.fuel:fuel-android:$fuel_version"
157 158
    implementation("com.github.kittinunf.fuel:fuel-jackson:$fuel_version") { transitive = false }
    implementation "com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version"
159
    implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
160 161 162
    implementation "nl.komponents.kovenant:kovenant:$promise_version"
    implementation "nl.komponents.kovenant:kovenant-android:$promise_version"

163 164 165 166
    // Navigation
    implementation "android.arch.navigation:navigation-fragment-ktx:$android_navigation"
    implementation "android.arch.navigation:navigation-ui-ktx:$android_navigation"

Christophe Henry's avatar
Christophe Henry committed
167
    // Utils
168 169 170
    implementation "org.apache.commons:commons-text:1.4"
    implementation "joda-time:joda-time:2.10.1"
    implementation "com.squareup.picasso:picasso:2.71828"
171
    implementation "com.x5dev:chunk-templates:3.4.0"
172 173 174
    implementation "eu.davidea:flexible-adapter:5.1.0"
    implementation "eu.davidea:flexible-adapter-ui:1.0.0"

Christophe Henry's avatar
Christophe Henry committed
175
    // Tests
176
    testImplementation "junit:junit:4.12"
Christophe Henry's avatar
Christophe Henry committed
177
    androidTestImplementation "androidx.test:runner:$test_runnner_version"
178
    androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version"
179 180

    // Debug
181
    debugImplementation "com.facebook.stetho:stetho:1.5.0"
182
}