-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
159 lines (144 loc) · 5.25 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
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
import org.jreleaser.model.Active
import java.text.SimpleDateFormat
import java.util.*
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java library project to get you started.
* For more details on building Java & JVM projects, please refer to https://docs.gradle.org/8.10.2/userguide/building_java_projects.html in the Gradle documentation.
*/
plugins {
// Apply the java-library plugin for API and implementation separation.
`java-library`
`maven-publish`
id("org.jreleaser") version "1.14.0"
id("io.freefair.lombok") version "8.10.2"
}
description = "PE file info extractor"
group = "es.goitia.pe"
version = "2.0.0"
var mainClassName = "es.goitia.pe.PEInfo"
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
// Use JUnit Jupiter for testing.
testImplementation(libs.junit.jupiter)
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
// This dependency is exported to consumers, that is to say found on their compile classpath.
api(libs.commons.math3)
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation(libs.guava)
}
// Apply a specific Java toolchain to ease working on different environments.
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
pom {
name = "PE Info"
description.set(project.description)
url = "https://github.com/davidgoitia/pe-info"
inceptionYear = "2024"
licenses {
license {
name = "The MIT License"
url = "https://opensource.org/licenses/MIT"
}
}
developers {
developer {
id = "davidgoitia"
name = "David Goitia"
email = "[email protected]"
}
}
scm {
connection = "scm:git:git://github.com/davidgoitia/pe-info.git"
developerConnection = "scm:git:ssh://github.com/davidgoitia/pe-info.git"
url = "https://github.com/davidgoitia/pe-info"
}
}
}
}
repositories {
maven {
name = "myRepo"
url = uri(layout.buildDirectory.dir("staging-deploy"))
}
// maven {
// name = "GitHubPackages"
// url = uri("https://maven.pkg.github.com/username/repo")
// credentials {
// username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME_GITHUB")
// password = project.findProperty("gpr.token") as String? ?: System.getenv("TOKEN_GITHUB")
// }
// }
// maven {
// name = "OSSRH"
// url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
// credentials {
// username = System.getenv("OSS_MAVEN_USERNAME")
// password = System.getenv("OSS_MAVEN_PASSWORD")
// }
// }
}
}
jreleaser {
project {
copyright = "Copyright (c) 2024 David Goitia"
}
signing {
active = Active.ALWAYS
armored = true
}
deploy {
maven {
// nexus2 {
// register("maven-central") {
// active = Active.ALWAYS
// url = "https://s01.oss.sonatype.org/service/local"
// snapshotUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
// closeRepository = true
// releaseRepository = true
// stagingRepository("build/staging-deploy")
// }
// }
// Portal Publisher API
mavenCentral {
register("sonatype") {
active = Active.ALWAYS
url = "https://central.sonatype.com/api/v1/publisher"
stagingRepository("build/staging-deploy")
}
}
}
}
}
tasks.jar {
manifest.attributes(
mapOf(
"Application-Name" to project.name,
"Application-Version" to project.version,
"Build-Timestamp" to SimpleDateFormat("yyyy/MM/dd HH:mm:ss z").format(Date()),
// "Build-Revision" to versioning.info.commit,
"Created-By" to "Gradle ${gradle.gradleVersion}",
"Build-Jdk" to "${System.getProperty("java.version")} (${System.getProperty("java.vendor")} ${System.getProperty("java.vm.version")})",
"Build-OS" to "${System.getProperty("os.name")} ${System.getProperty("os.arch")} ${System.getProperty("os.version")}",
"Main-Class" to mainClassName,
// "Class-Path" to configurations.runtimeClasspath.reles.joinToString(" ") { it.name }
)
)
}
tasks.named<Test>("test") {
// Use JUnit Platform for unit tests.
useJUnitPlatform()
}