forked from chibatching/Kotpref
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
67 lines (57 loc) · 2.03 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
62
63
64
65
66
67
import dependencies.Deps
import dependencies.Versions
apply plugin: 'org.jetbrains.dokka'
buildscript {
ext.versionName = Versions.versionName
ext.groupName = 'com.chibatching.kotpref'
repositories {
jcenter()
google()
}
dependencies {
classpath Deps.androidGradlePlugin
classpath Deps.Kotlin.gradlePlugin
classpath Deps.bintrayGradlePlugin
classpath Deps.androidMavenGradlePlugin
classpath Deps.dokkaGradlePlugin
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task replaceVersionInReadme {
doLast {
ant.replaceregexp(match: 'com\\.chibatching\\.kotpref:(.+):([0-9\\.]+)', replace: "com.chibatching.kotpref:\\1:${Versions.versionName}", flags: 'g') {
fileset(dir: project.projectDir, includes: 'README.md')
}
ant.replaceregexp(match: 'androidx\\.lifecycle:lifecycle-livedata:([0-9\\.]+)', replace: "androidx.lifecycle:lifecycle-livedata:${Versions.AndroidX.liveData}", flags: 'g') {
fileset(dir: project.projectDir, includes: 'README.md')
}
ant.replaceregexp(match: 'com\\.google\\.code\\.gson:gson:([0-9\\.]+)', replace: "com.google.code.gson:gson:${Versions.gson}", flags: 'g') {
fileset(dir: project.projectDir, includes: 'README.md')
}
ant.replaceregexp(match: 'kotlin-([0-9\\.]+)-blue\\.svg', replace: "kotlin-${Versions.kotlin}-blue.svg", flags: 'g') {
fileset(dir: project.projectDir, includes: 'README.md')
}
}
}
dokka {
outputFormat = 'html'
outputDirectory = 'docs/api'
subProjects = ["kotpref", "enum-support", "gson-support", "initializer", "livedata-support", "preference-screen-dsl"]
configuration {
moduleName = project.name
sourceLink {
path = "./"
url = "https://github.com/chibatching/Kotpref/tree/v${Versions.versionName}"
lineSuffix = "#L"
}
}
}
task cleanApiDocs(type: Delete) {
delete 'docs/api'
}
dokka.dependsOn cleanApiDocs