aboutsummaryrefslogtreecommitdiff
path: root/build.gradle
blob: db5deb920b3ad472cd51a7ac28ded1b128ba9c36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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
38
39
40
41
42
43
44
45
46
47
buildscript {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
        maven { url "https://plugins.gradle.org/m2/" }
    }

    dependencies {
        classpath kau.Plugins.android
//        classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02'
//        classpath "com.android.tools.build:gradle:${ANDROID_GRADLE}"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${KOTLIN}"
        classpath "com.bugsnag:bugsnag-android-gradle-plugin:${BUGSNAG_PLUGIN}"
        classpath "com.diffplug.spotless:spotless-plugin-gradle:${SPOTLESS}"
        classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:${DEX_PLUGIN}"
        classpath "com.gladed.androidgitversion:gradle-android-git-version:${GIT_PLUGIN}"
    }

    wrapper.setDistributionType(Wrapper.DistributionType.ALL)
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

task generateChangelogMd() {
    def changelog = kau.ChangelogGenerator.generate("${project.rootDir}/app/src/main/res/xml/frost_changelog.xml", "${project.rootDir}/docs/Changelog.md")
    // If we have no changelog, something is wrong
    def entry = changelog[0]
    def whatsNewFile = new File("${project.rootDir}/app/src/main/play/en-US/whatsnew")
    if (!whatsNewFile.exists()) {
        // Throw exceptions so that moving this file will require us to update the script
        throw new RuntimeException("Whatsnew file not found")
    }
    whatsNewFile.withWriter { writer ->
        writer.write(entry.version)
        writer.write("\n")
        entry.items.each {
            writer.write("\n* ${it}")
        }
    }
}

task fullRelease(type: GradleBuild) {
    tasks = ['clean', 'lintRelease', 'test', 'assembleRelease']
}