-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
78 lines (66 loc) · 2.19 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
plugins {
`java-library`
`test-report-aggregation`
`maven-publish`
signing
}
val testReportTask = tasks.register<TestReport>("testReport") {
dependsOn("testAggregateTestReport")
destinationDir = file("$buildDir/reports/tests/unit-test/aggregated-results")
reportOn(subprojects.mapNotNull { it.tasks.findByPath("test") })
}
tasks.test {
finalizedBy(testReportTask)
}
allprojects {
group = "io.github.suduide"
version = System.getenv("RELEASE_VERSION") ?: "0.0.1"
apply(plugin = "java-library")
apply(plugin = "test-report-aggregation")
repositories {
mavenCentral()
}
dependencies {
implementation("org.jetbrains:annotations:23.0.0")
testImplementation("org.junit.jupiter:junit-jupiter:5.9.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.1")
}
tasks.test {
useJUnitPlatform()
}
project.afterEvaluate {
if (project.plugins.hasPlugin("maven-publish")) {
configurePublishedProject(this)
}
}
}
fun configurePublishedProject(project: Project) {
project.tasks.withType<Javadoc>() {
options {
(this as CoreJavadocOptions).addStringOption("Xdoclint:none", "-quiet")
}
}
project.apply(plugin = "signing")
project.publishing {
repositories {
maven {
name = "ghPackages"
url = uri("https://maven.pkg.github.com/SuduIDE/protogen")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
maven {
name = "sonatype"
val releasesUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl
credentials {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
}
}