aboutsummaryrefslogtreecommitdiff
path: root/build.gradle
blob: 960f7e6eeb3afba09615a08d50abb01f4fdd25fb (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
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
// 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://plugins.gradle.org/m2/" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${KOTLIN}"
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

//plugins {
//    id 'com.gladed.androidgitversion' version '0.3.4' apply false
//}

//configure(subprojects - project(':sample')) {
////    apply plugin: 'com.gladed.androidgitversion'
////    apply from: '../extra.gradle'
//    apply plugin: 'com.android.library'
//    apply plugin: 'kotlin-android'
//    apply plugin: 'com.github.dcendents.android-maven'
//
////    if (!it.plugins.hasPlugin('com.gladed.androidgitversion')) apply plugin: 'com.gladed.androidgitversion'
////    else dependencies {
////        compile project(':core')
////    }
//
//    group = project.APP_GROUP
//
//    repositories {
//        jcenter()
//        mavenCentral()
//        maven { url "https://jitpack.io" }
//        maven { url "https://maven.google.com" }
//    }
//
//    android {
//        compileSdkVersion Integer.parseInt(project.TARGET_SDK)
//        buildToolsVersion project.BUILD_TOOLS
//
////        androidGitVersion {
////            codeFormat = 'MMNNPPBB'
////            prefix 'v'
////        }
//
//        defaultConfig {
//            minSdkVersion Integer.parseInt(project.MIN_SDK)
//            targetSdkVersion Integer.parseInt(project.TARGET_SDK)
////            versionCode androidGitVersion.code()
////            versionName androidGitVersion.name()
//            consumerProguardFiles 'progress-proguard.txt'
//            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
//        }
//        buildTypes {
//            release {
//                minifyEnabled false
//                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//            }
//        }
//        lintOptions {
//            abortOnError false
//            checkReleaseBuilds false
//        }
//        resourcePrefix "kau_color"
//        sourceSets {
//            main.java.srcDirs += 'src/main/kotlin'
//            test.java.srcDirs += 'src/test/kotlin'
//        }
//    }
//}

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

task generateChangelogMd() {
    def parsedProjectXml = (new XmlParser()).parse("$project.rootDir/sample/src/main/res/xml/changelog.xml")
    def sw = new StringWriter()
    sw.append("# Changelog\n")
    parsedProjectXml.depthFirst().each {
        switch (it.name()) {
            case "version":
                sw.append("\n## ${it.@title}\n")
                break
            case "item":
                if (it.@text?.trim())
                    sw.append("* ${it.@text}\n")
        }
    }
    def changelogMd = new File("$project.rootDir/docs/Changelog.md")
    changelogMd.write(sw.toString())
}