All checks were successful
Release / release (push) Successful in 44s
chore: finalizing javadoc footer and other params Signed-off-by: Leo Galambos <lg@hq.egothor.org>
141 lines
4.0 KiB
Groovy
141 lines
4.0 KiB
Groovy
plugins {
|
|
// Apply the java-library plugin for API and implementation separation.
|
|
id 'java-library'
|
|
id 'maven-publish'
|
|
id 'com.palantir.git-version' version '4.0.0'
|
|
id 'pmd'
|
|
}
|
|
|
|
import java.time.LocalDate
|
|
|
|
def currentYear=LocalDate.now().getYear()
|
|
|
|
group 'org.egothor'
|
|
version gitVersion(prefix:'release@')
|
|
|
|
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")
|
|
}
|
|
|
|
pmd {
|
|
consoleOutput = true
|
|
toolVersion = '7.16.0'
|
|
sourceSets = [sourceSets.main]
|
|
ruleSetFiles = files(rootProject.file(".ruleset"))
|
|
}
|
|
|
|
// Apply a specific Java toolchain to ease working on different environments.
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(21)
|
|
}
|
|
|
|
withJavadocJar()
|
|
withSourcesJar()
|
|
}
|
|
|
|
javadoc {
|
|
failOnError = false
|
|
|
|
options.addBooleanOption('html5', true)
|
|
options.tags('apiNote:a:API Note:')
|
|
options.tags('implSpec:a:Implementation Requirements:')
|
|
options.tags('implNote:a:Implementation Note:')
|
|
options.tags('param')
|
|
options.tags('return')
|
|
options.tags('throws')
|
|
options.tags('since')
|
|
options.tags('version')
|
|
options.tags('serialData')
|
|
options.tags('factory')
|
|
options.tags('see')
|
|
|
|
options.use = true
|
|
options.author = true
|
|
options.version = true
|
|
options.windowTitle = 'Conflux'
|
|
|
|
options.bottom = '<div style="text-align: right; padding: 5px;">Copyright © ' + currentYear +
|
|
' Egothor - Version ' + version +
|
|
' - <a href="https://gitea.egothor.org/Egothor/conflux/raw/branch/main/LICENSE">License</a>' +
|
|
'</div>'
|
|
source = sourceSets.main.allJava}
|
|
|
|
tasks.named('test') {
|
|
// Use JUnit Platform for unit tests.
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
task uploadJavadoc(type: Exec) {
|
|
dependsOn javadoc
|
|
|
|
doFirst {
|
|
def javadocDir = tasks.javadoc.destinationDir
|
|
def relativeJavadocDir = project.projectDir.toPath().relativize(javadocDir.toPath()).toString()
|
|
|
|
println "Uploading Javadoc with key: ${javadocKeyPath}"
|
|
println " from relative path: $relativeJavadocDir"
|
|
|
|
commandLine "rsync", "-avz", "--delete",
|
|
"-e", "ssh -i ${javadocKeyPath} -o IdentitiesOnly=yes",
|
|
relativeJavadocDir + '/', "${javadocUser}@${javadocHost}:${javadocPath}"
|
|
}
|
|
|
|
}
|
|
|
|
if (project.hasProperty('giteaToken') && project.giteaToken) {
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
from components.java
|
|
}
|
|
}
|
|
repositories {
|
|
maven {
|
|
name = "GiteaMaven"
|
|
url = uri("https://gitea.egothor.org/api/packages/Egothor/maven")
|
|
|
|
credentials(HttpHeaderCredentials) {
|
|
name = "Authorization"
|
|
value = "token ${giteaToken}"
|
|
}
|
|
|
|
authentication {
|
|
header(HttpHeaderAuthentication)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
println "No giteaToken defined - skipping publishing configuration"
|
|
}
|
|
|
|
gradle.taskGraph.whenReady { taskGraph ->
|
|
def banner = """
|
|
\u001B[34m
|
|
|
|
8888888888 .d8888b. .d88888b. 88888888888 888 888 .d88888b. 8888888b.
|
|
888 d88P Y88b d88P" "Y88b 888 888 888 d88P" "Y88b 888 Y88b
|
|
888 888 888 888 888 888 888 888 888 888 888 888
|
|
8888888 888 888 888 888 8888888888 888 888 888 d88P
|
|
888 888 88888 888 888 888 888 888 888 888 8888888P"
|
|
888 888 888 888 888 888 888 888 888 888 888 T88b
|
|
888 Y88b d88P Y88b. .d88P 888 888 888 Y88b. .d88P 888 T88b
|
|
8888888888 "Y8888P88 "Y88888P" 888 888 888 "Y88888P" 888 T88b
|
|
|
|
\u001B[36m
|
|
Project : ${project.name}
|
|
Version : ${project.version}
|
|
\u001B[0m
|
|
"""
|
|
println banner
|
|
}
|