-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
70 lines (62 loc) · 1.83 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
import io.github.gradlenexus.publishplugin.NexusPublishExtension
plugins {
id(Plugins.androidApplication) apply false
id(Plugins.androidLibrary) apply false
kotlin("android") apply false
id(Plugins.nexusPublish)
}
allprojects {
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(module("org.jetbrains.trove4j:trove4j:20160824")).using(module("org.jetbrains.intellij.deps:trove4j:1.0.20181211"))
}
}
repositories {
google()
mavenCentral()
}
version = P.projectVersion
group = P.projectGroupId
description = P.projectDescription
}
subprojects {
apply {
from(rootProject.file("ktlint.gradle.kts"))
}
}
val clean by tasks.creating(Delete::class) {
group = "build"
delete(rootProject.buildDir)
}
configure<NexusPublishExtension> {
val nexusStagingProfileId: String? by project
val nexusUsername: String? by project
val nexusPassword: String? by project
packageGroup.set(group.toString())
repositories {
sonatype {
stagingProfileId.set(nexusStagingProfileId)
username.set(nexusUsername)
password.set(nexusPassword)
}
}
}
afterEvaluate {
val hookFile = File(rootProject.rootDir, "pre-commit")
val destDir = File(rootProject.rootDir, ".git/hooks")
val destFile = File(destDir, "pre-commit")
if (destDir.exists() && destDir.isDirectory) {
if (!destFile.exists()) {
println("installing pre-commit hook")
copy {
from(hookFile)
into(destDir)
fileMode = Integer.parseUnsignedInt("755", 8)
}
} else {
println("pre-commit hook already installed")
}
} else {
println("no git folder found - cannot install git hook")
}
}