-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.gradle.kts
121 lines (103 loc) · 3.52 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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import org.jetbrains.kotlin.konan.properties.Properties
import java.io.FileInputStream
val artifactIdVal = "dag-command"
val versionVal = "1.11.0"
val publicationName = "dagCommand"
group = "io.github.leandroborgesferreira"
version = versionVal
plugins {
kotlin("jvm") version "1.9.22"
id("java-gradle-plugin")
signing
`maven-publish`
id("com.gradle.plugin-publish") version "1.2.1"
}
sourceSets {
test {
resources {
srcDirs("src/test/resources")
}
}
}
repositories {
mavenCentral()
}
dependencies {
implementation("com.google.code.gson:gson:2.10.1")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:1.9.22")
testImplementation("org.mockito.kotlin:mockito-kotlin:5.2.1")
testImplementation("org.mockito:mockito-core:5.10.0")
}
tasks.withType<Copy>().all { duplicatesStrategy = DuplicatesStrategy.EXCLUDE }
//Publication code. It would be interesting to separate to another script.
java {
withJavadocJar()
withSourcesJar()
}
gradlePlugin {
website.set("https://github.com/leandroBorgesFerreira/dag-command/")
vcsUrl.set("https://github.com/leandroBorgesFerreira/dag-command/")
plugins {
register(rootProject.name) {
id = "$group.$artifactIdVal"
displayName = "Unit tests following the DAG"
description = "Unit tests only the changed modules in the dependencies graph"
implementationClass = "$group.dagcommand.DagCommandPlugin"
tags.set(listOf("testing", "tooling", "multi-module"))
}
}
}
publishing {
publications {
create<MavenPublication>(publicationName) {
groupId = group.toString()
artifactId = artifactIdVal
version = versionVal
from(components["java"])
pom {
name.set("Dag Command")
description.set("Affected gradle modules by branch")
url.set("https://github.com/leandroBorgesFerreira/dag-command/")
packaging = "jar"
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("leandroBorgesFerreira")
name.set("Leandro Borges Ferreira")
email.set("lehen01@gmail.com")
}
}
scm {
connection.set("scm:git:git://github.com/leandroBorgesFerreira/dag-command.git")
developerConnection.set("scm:git:ssh://github.com/leandroBorgesFerreira/dag-command.git")
url.set("https://github.com/leandroBorgesFerreira/dag-command")
}
}
}
}
}
signing {
val secretPropsFile: File = project.rootProject.file("local.properties")
if (secretPropsFile.exists()) {
val prop = Properties().apply {
load(FileInputStream(secretPropsFile))
}
useInMemoryPgpKeys(
prop.getProperty("signing.keyId"),
prop.getProperty("signing.key"),
prop.getProperty("signing.password"),
)
} else {
useInMemoryPgpKeys(
System.getenv("SIGNING_KEY_ID"),
System.getenv("SIGNING_KEY"),
System.getenv("SIGNING_PASSWORD"),
)
}
// sign(publishing.publications[publicationName])
}