build.gradle.kts
author Da Risk <da_risk@geekorum.com>
Sat, 18 Jan 2020 12:22:05 -0400
changeset 589 8399a1989189
parent 566 5f481ad9fcc6
child 591 3b5cc2a7e64d
permissions -rw-r--r--
Update firebase
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
181
5ba798c38149 Add Missing license headers
Da Risk <da_risk@geekorum.com>
parents: 162
diff changeset
     1
/*
0
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     2
 * Geekttrss is a RSS feed reader application on the Android Platform.
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     3
 *
181
5ba798c38149 Add Missing license headers
Da Risk <da_risk@geekorum.com>
parents: 162
diff changeset
     4
 * Copyright (C) 2017-2019 by Frederic-Charles Barthelery.
0
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     5
 *
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     6
 * This file is part of Geekttrss.
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     7
 *
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     8
 * Geekttrss is free software: you can redistribute it and/or modify
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
     9
 * it under the terms of the GNU General Public License as published by
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    10
 * the Free Software Foundation, either version 3 of the License, or
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    11
 * (at your option) any later version.
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    12
 *
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    13
 * Geekttrss is distributed in the hope that it will be useful,
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    16
 * GNU General Public License for more details.
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    17
 *
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    18
 * You should have received a copy of the GNU General Public License
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    19
 * along with Geekttrss.  If not, see <http://www.gnu.org/licenses/>.
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    20
 */
364
968f44db1e96 Configure Java version globally
Da Risk <da_risk@geekorum.com>
parents: 363
diff changeset
    21
import com.android.build.gradle.BaseExtension
525
e884f73f9eef build: update source-licence-checker and enable it with a flag on ci build only
Da Risk <da_risk@geekorum.com>
parents: 521
diff changeset
    22
import com.geekorum.build.SourceLicenseCheckerPlugin
364
968f44db1e96 Configure Java version globally
Da Risk <da_risk@geekorum.com>
parents: 363
diff changeset
    23
import com.geekorum.build.configureJavaVersion
161
a359009c33c3 Build: create version alignment platform for all projects
Da Risk <da_risk@geekorum.com>
parents: 147
diff changeset
    24
import com.geekorum.build.createComponentsPlatforms
101
247d5b1c0324 build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents: 60
diff changeset
    25
import com.geekorum.build.setupGoogleContent
363
217663200f13 Update to dagger 2.4
Da Risk <da_risk@geekorum.com>
parents: 353
diff changeset
    26
import org.jetbrains.kotlin.gradle.plugin.KaptExtension
280
1f5e9db3308e Update to kotlin 1.3.40
Da Risk <da_risk@geekorum.com>
parents: 233
diff changeset
    27
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
0
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    28
import java.net.URI
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    29
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    30
plugins {
566
5f481ad9fcc6 Update to gradle-6.0.1
Da Risk <da_risk@geekorum.com>
parents: 562
diff changeset
    31
    // these should not be needed but for an unknown reason they get applied
5f481ad9fcc6 Update to gradle-6.0.1
Da Risk <da_risk@geekorum.com>
parents: 562
diff changeset
    32
    // with bad ordering if not there. or they can't be applied dynamically
5f481ad9fcc6 Update to gradle-6.0.1
Da Risk <da_risk@geekorum.com>
parents: 562
diff changeset
    33
    // version used is in gradle.properties
5f481ad9fcc6 Update to gradle-6.0.1
Da Risk <da_risk@geekorum.com>
parents: 562
diff changeset
    34
    kotlin("jvm") apply false
5f481ad9fcc6 Update to gradle-6.0.1
Da Risk <da_risk@geekorum.com>
parents: 562
diff changeset
    35
    id("androidx.navigation.safeargs.kotlin")  apply false
5f481ad9fcc6 Update to gradle-6.0.1
Da Risk <da_risk@geekorum.com>
parents: 562
diff changeset
    36
    id("io.fabric") apply false
5f481ad9fcc6 Update to gradle-6.0.1
Da Risk <da_risk@geekorum.com>
parents: 562
diff changeset
    37
    id("com.google.gms.google-services") apply false
5f481ad9fcc6 Update to gradle-6.0.1
Da Risk <da_risk@geekorum.com>
parents: 562
diff changeset
    38
    id("com.google.android.gms.oss-licenses-plugin") apply false
0
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    39
}
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    40
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    41
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    42
// some extra properties
233
f105a3e36288 Update to compileSdk 29 (q)
Da Risk <da_risk@geekorum.com>
parents: 228
diff changeset
    43
extra["compileSdkVersion"] = "android-29"
0
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    44
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    45
allprojects {
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    46
    repositories {
101
247d5b1c0324 build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents: 60
diff changeset
    47
        google().setupGoogleContent()
0
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    48
        jcenter()
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    49
        // for kotlinx
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    50
        maven { url = URI("https://kotlin.bintray.com/kotlinx") }
161
a359009c33c3 Build: create version alignment platform for all projects
Da Risk <da_risk@geekorum.com>
parents: 147
diff changeset
    51
        // for geekdroid
a359009c33c3 Build: create version alignment platform for all projects
Da Risk <da_risk@geekorum.com>
parents: 147
diff changeset
    52
        flatDir {
a359009c33c3 Build: create version alignment platform for all projects
Da Risk <da_risk@geekorum.com>
parents: 147
diff changeset
    53
            dirs(rootProject.files("libs"))
a359009c33c3 Build: create version alignment platform for all projects
Da Risk <da_risk@geekorum.com>
parents: 147
diff changeset
    54
        }
a359009c33c3 Build: create version alignment platform for all projects
Da Risk <da_risk@geekorum.com>
parents: 147
diff changeset
    55
    }
a359009c33c3 Build: create version alignment platform for all projects
Da Risk <da_risk@geekorum.com>
parents: 147
diff changeset
    56
    dependencies {
a359009c33c3 Build: create version alignment platform for all projects
Da Risk <da_risk@geekorum.com>
parents: 147
diff changeset
    57
        createComponentsPlatforms()
0
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    58
    }
280
1f5e9db3308e Update to kotlin 1.3.40
Da Risk <da_risk@geekorum.com>
parents: 233
diff changeset
    59
525
e884f73f9eef build: update source-licence-checker and enable it with a flag on ci build only
Da Risk <da_risk@geekorum.com>
parents: 521
diff changeset
    60
    apply<SourceLicenseCheckerPlugin>()
e884f73f9eef build: update source-licence-checker and enable it with a flag on ci build only
Da Risk <da_risk@geekorum.com>
parents: 521
diff changeset
    61
280
1f5e9db3308e Update to kotlin 1.3.40
Da Risk <da_risk@geekorum.com>
parents: 233
diff changeset
    62
    tasks.withType<KotlinCompile> {
342
10640a083343 OnDemandModuleManager: use flow instead of channel when applicable
Da Risk <da_risk@geekorum.com>
parents: 341
diff changeset
    63
        kotlinOptions {
10640a083343 OnDemandModuleManager: use flow instead of channel when applicable
Da Risk <da_risk@geekorum.com>
parents: 341
diff changeset
    64
            jvmTarget = "1.8"
482
2a70627346a7 InAppUpdateManager: allow to collect current update state
Da Risk <da_risk@geekorum.com>
parents: 421
diff changeset
    65
            freeCompilerArgs = listOf("-Xuse-experimental=kotlin.Experimental", "-XXLanguage:+InlineClasses")
342
10640a083343 OnDemandModuleManager: use flow instead of channel when applicable
Da Risk <da_risk@geekorum.com>
parents: 341
diff changeset
    66
        }
280
1f5e9db3308e Update to kotlin 1.3.40
Da Risk <da_risk@geekorum.com>
parents: 233
diff changeset
    67
    }
363
217663200f13 Update to dagger 2.4
Da Risk <da_risk@geekorum.com>
parents: 353
diff changeset
    68
217663200f13 Update to dagger 2.4
Da Risk <da_risk@geekorum.com>
parents: 353
diff changeset
    69
    afterEvaluate {
217663200f13 Update to dagger 2.4
Da Risk <da_risk@geekorum.com>
parents: 353
diff changeset
    70
        extensions.findByType<KaptExtension>()?.arguments {
217663200f13 Update to dagger 2.4
Da Risk <da_risk@geekorum.com>
parents: 353
diff changeset
    71
            arg("dagger.formatGeneratedSource", "enabled")
217663200f13 Update to dagger 2.4
Da Risk <da_risk@geekorum.com>
parents: 353
diff changeset
    72
        }
364
968f44db1e96 Configure Java version globally
Da Risk <da_risk@geekorum.com>
parents: 363
diff changeset
    73
        extensions.findByType<BaseExtension>()?.apply {
968f44db1e96 Configure Java version globally
Da Risk <da_risk@geekorum.com>
parents: 363
diff changeset
    74
            configureJavaVersion()
968f44db1e96 Configure Java version globally
Da Risk <da_risk@geekorum.com>
parents: 363
diff changeset
    75
        }
363
217663200f13 Update to dagger 2.4
Da Risk <da_risk@geekorum.com>
parents: 353
diff changeset
    76
    }
0
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    77
}
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    78
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    79
tasks.register("clean", Delete::class.java) {
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    80
    delete(buildDir)
14443efede32 Initial commit
Da Risk <da_risk@geekorum.com>
parents:
diff changeset
    81
}