-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle.kts
70 lines (57 loc) · 2.24 KB
/
build.gradle.kts
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
plugins {
id("com.android.application") version Versions.AGP apply false
id("com.android.library") version Versions.AGP apply false
id("androidx.benchmark") version Versions.BENCHMARK apply false
kotlin("android") version Versions.KOTLIN apply false
id("se.ascp.gradle.gradle-versions-filter") version Versions.VERSIONS apply false
id("com.diffplug.spotless") version Versions.SPOTLESS apply false
id("org.jetbrains.dokka") version Versions.DOKKA apply false
}
subprojects {
apply {
plugin("se.ascp.gradle.gradle-versions-filter")
plugin("com.diffplug.spotless")
}
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
target(
project.fileTree(project.projectDir) {
include("**/app/redwarp/gif/**/*.kt")
},
)
licenseHeaderFile("${project.rootDir}/license_header.txt")
}
}
}
tasks.register("clean", Delete::class.java) {
dependsOn(gradle.includedBuild("decoder").task(":clean"))
delete(rootProject.buildDir)
}
buildscript {
dependencies {
classpath("com.android.tools.build:gradle:${Versions.AGP}")
}
}
tasks.register("testLibraries") {
description = "Run tests on both libraries"
dependsOn(gradle.includedBuild("decoder").task(":test"))
dependsOn(":android-drawable:test")
}
tasks.register("uploadLibraries") {
description = "Upload both decoder and gif-drawable artifact to maven central"
dependsOn(gradle.includedBuild("decoder").task(":publishReleasePublicationToNexusRepository"))
dependsOn(":android-drawable:publishReleasePublicationToNexusRepository")
}
tasks.register("buildLibrariesLocal") {
description = "Build both libraries and publish locally"
dependsOn(gradle.includedBuild("decoder").task(":publishToMavenLocal"))
dependsOn(":android-drawable:publishToMavenLocal")
}
tasks.register("addLicenseHeader") {
description = "Make sure the license header is applied to every files"
dependsOn(gradle.includedBuild("decoder").task(":spotlessApply"))
val spotlessTasks = subprojects.map { project ->
project.tasks.filter { it.name == "spotlessApply" }
}.flatten().toTypedArray()
dependsOn(*spotlessTasks)
}