58 lines
1.2 KiB
Groovy
58 lines
1.2 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
id 'maven-publish'
|
|
}
|
|
|
|
group = 'dev.pfaff'
|
|
version = '1.0-SNAPSHOT'
|
|
|
|
apply from: "${project.gradle.gradleUserHomeDir}/local.gradle"
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
testImplementation platform('org.junit:junit-bom:5.9.1')
|
|
testImplementation 'org.junit.jupiter:junit-jupiter'
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
def targetJavaVersion = 17
|
|
tasks.withType(JavaCompile).configureEach {
|
|
it.options.release.set(targetJavaVersion)
|
|
}
|
|
|
|
java {
|
|
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
|
|
archivesBaseName = project.properties.name
|
|
withSourcesJar()
|
|
withJavadocJar()
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
unfettered(MavenPublication) {
|
|
from components.java
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
maven {
|
|
name = "Gitea"
|
|
url = uri("https://git.pfaff.dev/api/packages/michael/maven")
|
|
|
|
credentials(HttpHeaderCredentials) {
|
|
name = "Authorization"
|
|
value = "token ${project.ext.giteaAccessToken}"
|
|
}
|
|
|
|
authentication {
|
|
header(HttpHeaderAuthentication)
|
|
}
|
|
}
|
|
}
|
|
}
|