-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
124 lines (109 loc) · 3.54 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
121
122
123
124
plugins {
java
jacoco
`maven-publish`
signing
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
id("org.sonarqube") version "6.0.1.5171"
}
group = "org.fugerit.java"
version = "1.0.1-SNAPSHOT"
val freemarkerVersion = "2.3.34"
val graalSdkVersion = "24.1.1"
val junitJupiterVersion = "5.11.4"
val profile = findProperty("profile") as String? ?: "default"
repositories {
mavenCentral()
}
dependencies {
implementation("org.freemarker:freemarker:$freemarkerVersion")
compileOnly("org.graalvm.sdk:graal-sdk:$graalSdkVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
withJavadocJar()
}
tasks.test {
useJUnitPlatform()
testLogging {
events("PASSED", "FAILED", "SKIPPED")
}
}
jacoco {
toolVersion = "0.8.12"
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
html.required.set(true)
xml.required.set(true)
csv.required.set(false)
}
}
object Meta {
const val desc = "GraalVM support for ApacheFreemarker."
const val githubRepo = "fugerit-org/freemarker-native"
const val release = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
const val snapshot = "https://oss.sonatype.org/content/repositories/snapshots/"
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
pom {
name.set("Freemarker Native")
description.set(Meta.desc)
url.set("https://github.com/${Meta.githubRepo}")
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("fugerit79")
name.set("Matteo Franci a.k.a. Fugerit")
email.set("[email protected]")
url.set("https://github.com/fugerit79")
organization.set("Fugerit")
organizationUrl.set("https://github.com/fugerit-org")
}
}
scm {
connection.set("scm:git:git://github.com/your-repo/freemarker-native.git")
developerConnection.set("scm:git:ssh://github.com/your-repo/freemarker-native.git")
url.set("https://github.com/your-repo/freemarker-native")
}
}
}
}
}
nexusPublishing {
repositories {
sonatype {
val ossrhUsername = providers.environmentVariable("MAVEN_USERNAME")
val ossrhPassword = providers.environmentVariable("MAVEN_PASSWORD")
if (ossrhUsername.isPresent && ossrhPassword.isPresent) {
username.set(ossrhUsername.get())
password.set(ossrhPassword.get())
}
}
}
}
signing {
useGpgCmd()
sign(publishing.publications["mavenJava"])
}
sonar {
properties {
property("sonar.sourceEncoding", "UTF-8")
property("sonar.projectKey", "fugerit-org_freemarker-native")
property("sonar.organization", "fugerit-org")
property("sonar.host.url", "https://sonarcloud.io")
}
}