-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
175 lines (141 loc) · 4.94 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
175 lines (141 loc) · 4.94 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
import org.ajoberstar.grgit.Grgit
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.plugins.ide.idea.model.IdeaLanguageLevel
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val ossrhUsername: String? = System.getenv("OSSRH_USERNAME")
val ossrhPassword: String? = System.getenv("OSSRH_PASSWORD")
val signingKey: String? = System.getenv("SIGNING_KEY")
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
tasks.wrapper {
gradleVersion = "8.5"
distributionType = Wrapper.DistributionType.ALL
}
plugins {
id("com.github.ben-manes.versions") version "0.54.0"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
id("org.ajoberstar.grgit") version "5.3.3"
kotlin("jvm") version "2.1.21" apply false
idea
}
val javaVersion = JavaVersion.VERSION_11
allprojects {
group = "ru.bozaro.gitlfs"
version = "0.21.0-SNAPSHOT"
apply(plugin = "idea")
apply(plugin = "com.github.ben-manes.versions")
apply(plugin = "org.jetbrains.kotlin.jvm")
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = javaVersion.toString()
}
repositories {
mavenCentral()
}
}
idea {
project.jdkName = javaVersion.name
project.languageLevel = IdeaLanguageLevel(javaVersion)
}
subprojects {
apply(plugin = "java-library")
apply(plugin = "maven-publish")
apply(plugin = "signing")
configure<JavaPluginExtension> {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
val api by configurations
val testImplementation by configurations
dependencies {
api("com.google.code.findbugs:jsr305:3.0.2")
testImplementation("com.google.guava:guava:33.4.8-jre")
testImplementation("org.testng:testng:7.12.0")
}
idea {
module {
isDownloadJavadoc = true
isDownloadSources = true
// Workaround for https://youtrack.jetbrains.com/issue/IDEA-175172
outputDir = file("build/classes/main")
testOutputDir = file("build/classes/test")
}
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks.withType<Test> {
useTestNG {
testLogging {
exceptionFormat = TestExceptionFormat.FULL
showStandardStreams = true
}
}
}
val javadoc by tasks.getting(Javadoc::class) {
(options as? CoreJavadocOptions)?.addStringOption("Xdoclint:none", "-quiet")
}
val javadocJar by tasks.registering(Jar::class) {
from(javadoc)
archiveClassifier.set("javadoc")
}
val sourcesJar by tasks.registering(Jar::class) {
val sourceSets: SourceSetContainer by project
from(sourceSets["main"].allSource)
archiveClassifier.set("sources")
}
configure<PublishingExtension> {
publications {
create<MavenPublication>(project.name) {
from(components["java"])
artifact(sourcesJar.get())
artifact(javadocJar.get())
pom {
name.set(project.name)
val pomDescription = description
afterEvaluate {
pomDescription.set(project.description)
}
url.set("https://github.com/bozaro/git-lfs-java")
scm {
connection.set("scm:git:git://github.com/bozaro/git-lfs-java.git")
tag.set(Grgit.open(mapOf("dir" to rootDir)).head().id)
url.set("https://github.com/bozaro/git-lfs-java")
}
licenses {
license {
name.set("Lesser General Public License, version 3 or greater")
url.set("https://www.gnu.org/licenses/lgpl-3.0.html")
}
}
developers {
developer {
id.set("bozaro")
name.set("Artem V. Navrotskiy")
email.set("bozaro@yandex.ru")
}
developer {
id.set("slonopotamus")
name.set("Marat Radchenko")
email.set("marat@slonopotamus.org")
}
}
}
}
}
}
configure<SigningExtension> {
isRequired = signingKey != ""
useInMemoryPgpKeys(signingKey, signingPassword)
val publishing: PublishingExtension by project.extensions
sign(publishing.publications)
}
}
nexusPublishing {
repositories {
sonatype {
packageGroup.set("ru.bozaro")
stagingProfileId.set("365bc6dc8b7aa3")
username.set(ossrhUsername)
password.set(ossrhPassword)
}
}
}