-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
99 lines (81 loc) · 2.32 KB
/
build.gradle
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
plugins {
id 'java'
id 'maven-publish'
id 'application'
}
apply from: 'version.gradle'
group 'br.dev.rplus'
version loadVersion().getVersion()
repositories {
mavenCentral()
}
dependencies {
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.17.2'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-csv:2.17.2'
implementation 'org.json:json:20240303'
implementation 'com.github.f4b6a3:uuid-creator:6.0.0'
implementation 'com.github.f4b6a3:ulid-creator:5.2.3'
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
withJavadocJar()
withSourcesJar()
}
compileJava {
options.encoding = 'UTF-8'
options.compilerArgs << '-parameters'
}
test {
useJUnitPlatform()
}
jar {
manifest {
attributes(
'Implementation-Title': 'Coffee Utilities Package',
'Implementation-Version': version,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Main-Class': 'br.dev.rplus.cup.Main'
)
}
}
tasks.register('fatJar', Jar) {
group = 'build'
description = 'Builds a JAR with dependencies (fat jar).'
manifest.from jar.manifest
archiveClassifier.set('aio')
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
tasks.named('sourcesJar') {
manifest.from jar.manifest
}
tasks.named('javadocJar') {
manifest.from jar.manifest
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifacts.clear()
artifact(tasks.jar)
artifact(tasks.named('sourcesJar'))
artifact(tasks.named('javadocJar'))
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/${githubRepository}")
credentials {
username = 'rafandoo'
password = System.getenv("GITHUB_TOKEN")
}
}
}
}