-
Notifications
You must be signed in to change notification settings - Fork 42
/
build.gradle
executable file
·61 lines (50 loc) · 1.56 KB
/
build.gradle
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
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
task readme {
doLast {
def input = new File("./README_TEMPLATE.md")
def output = new File("./README.md")
def reader = new DataInputStream(new BufferedInputStream(new FileInputStream(input))).newReader()
def builder = new StringBuilder()
def next
while ((next = reader.readLine()) != null) {
builder.append(next).append("\n")
}
def version = project(':noise').version
def template = builder.toString().replace("{{version}}", version)
def writer = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(output))).newWriter()
writer.write(template)
writer.flush()
println("README.md generated from template")
}
}
task release(dependsOn: [":readme"]) {
doLast {
exec {
executable 'git'
args 'tag', '-a', "${project(':noise').version}", '-m', "Release ${project(':noise').version}"
}
println("Successfully tagged new release (${project(':noise').version}).")
println("Push manually!")
}
}