Build process modification

feat: Javadoc footer improvement, deployment to a website
chore: build process clean-up

Signed-off-by: Leo Galambos <lg@hq.egothor.org>
This commit is contained in:
2025-08-04 02:08:52 +02:00
parent 62d2947142
commit db011ab6da
5 changed files with 71 additions and 29 deletions

View File

@@ -1,10 +1,9 @@
plugins { plugins {
id 'buildlogic.java-application-conventions' id 'buildlogic.java-application-conventions'
id 'com.palantir.git-version' version '4.0.0' id 'com.palantir.git-version'
} }
group 'org.egothor' group 'org.egothor'
version gitVersion(prefix:'release@')
dependencies { dependencies {
implementation 'org.apache.commons:commons-text' implementation 'org.apache.commons:commons-text'
@@ -28,25 +27,33 @@ jar {
) )
} }
// Include compiled classes from main source set
from sourceSets.main.output from sourceSets.main.output
dependsOn configurations.runtimeClasspath dependsOn configurations.runtimeClasspath
from {
configurations.runtimeClasspath.collect { dep -> // Include each JAR dependency
if (dep.isDirectory()) { configurations.runtimeClasspath.findAll { it.exists() && it.name.endsWith('.jar') }.each { jarFile ->
dep def jarName = jarFile.name.replaceAll(/\.jar$/, '')
} else {
zipTree(dep).matching { from(zipTree(jarFile)) {
exclude 'META-INF/LICENSE.*' // Exclude signature-related files
exclude 'META-INF/*.SF' exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA' // Rename license/notice files to avoid conflicts
eachFile { file ->
if (file.path ==~ /META-INF\/(LICENSE|NOTICE)(\..*)?/) {
file.path = "META-INF/licenses-from-${jarName}/${file.name}"
} }
} }
includeEmptyDirs = false
} }
} }
duplicatesStrategy = DuplicatesStrategy.EXCLUDE duplicatesStrategy = DuplicatesStrategy.EXCLUDE
} }
javadoc {
options.links("https://www.egothor.org/javadoc/zeroecho/lib")
}

View File

@@ -7,8 +7,14 @@ plugins {
id 'java' id 'java'
id 'maven-publish' id 'maven-publish'
id 'pmd' id 'pmd'
id 'com.palantir.git-version'
} }
import java.time.LocalDate
def currentYear = LocalDate.now().getYear()
def version = gitVersion(prefix:'release@')
repositories { repositories {
maven { maven {
@@ -26,7 +32,7 @@ dependencies {
implementation 'org.apache.commons:commons-text:1.11.0' implementation 'org.apache.commons:commons-text:1.11.0'
implementation 'commons-cli:commons-cli:1.9.0' implementation 'commons-cli:commons-cli:1.9.0'
implementation 'org.bouncycastle:bcpkix-jdk18on:1.81' implementation 'org.bouncycastle:bcpkix-jdk18on:1.81'
implementation 'org.egothor:conflux:1.1.0' implementation 'org.egothor:conflux:[1.0,2.0)'
implementation 'org.apache.commons:commons-imaging:1.0.0-alpha6' implementation 'org.apache.commons:commons-imaging:1.0.0-alpha6'
} }
@@ -73,10 +79,28 @@ javadoc {
options.tags('factory') options.tags('factory')
options.tags('see') options.tags('see')
options.bottom = "Copyright &copy; 2025 Egothor" options.bottom = "Copyright &copy; ${currentYear} Egothor - Version ${version}"
source = sourceSets.main.allJava source = sourceSets.main.allJava
} }
task uploadJavadoc(type: Exec) {
dependsOn javadoc
doFirst {
def javadocDir = tasks.javadoc.destinationDir
def relativeJavadocDir = project.projectDir.toPath().relativize(javadocDir.toPath()).toString()
def moduleName = project.name // Dynamically get the module name
println "Uploading Javadoc for module: ${moduleName}"
println "Uploading from relative path: $relativeJavadocDir"
// Upload to a folder named after the module
commandLine "rsync", "-avz", "--delete",
"-e", "ssh -i ${javadocKeyPath} -o IdentitiesOnly=yes",
relativeJavadocDir + '/', "${javadocUser}@${javadocHost}:${javadocPath}/${project.name}"
}
}
tasks.named('test') { tasks.named('test') {
// Use JUnit Platform for unit tests. // Use JUnit Platform for unit tests.
useJUnitPlatform() useJUnitPlatform()
@@ -87,6 +111,7 @@ if (project.hasProperty('giteaToken') && project.giteaToken) {
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {
from components.java from components.java
artifactId = "${rootProject.name}-${project.name}"
} }
} }
repositories { repositories {

View File

@@ -1 +1,2 @@
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g
javadocPath=/var/www/html/javadoc/zeroecho/

View File

@@ -1,13 +1,16 @@
plugins { plugins {
id 'buildlogic.java-library-conventions' id 'buildlogic.java-library-conventions'
id 'com.palantir.git-version' version '4.0.0' id 'com.palantir.git-version'
} }
group 'org.egothor' group 'org.egothor'
version gitVersion(prefix:'release@')
dependencies { dependencies {
implementation 'org.bouncycastle:bcpkix-jdk18on' implementation 'org.bouncycastle:bcpkix-jdk18on'
implementation 'org.egothor:conflux' implementation 'org.egothor:conflux'
implementation 'org.apache.commons:commons-imaging' implementation 'org.apache.commons:commons-imaging'
} }
javadoc {
options.links("https://www.egothor.org/javadoc/conflux")
}

View File

@@ -1,3 +1,9 @@
pluginManagement {
plugins {
id 'com.palantir.git-version' version '4.0.0' // Define the plugin version globally
}
}
plugins { plugins {
// Apply the foojay-resolver plugin to allow automatic download of JDKs // Apply the foojay-resolver plugin to allow automatic download of JDKs
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'