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:
@@ -1,10 +1,9 @@
|
||||
plugins {
|
||||
id 'buildlogic.java-application-conventions'
|
||||
id 'com.palantir.git-version' version '4.0.0'
|
||||
id 'com.palantir.git-version'
|
||||
}
|
||||
|
||||
group 'org.egothor'
|
||||
version gitVersion(prefix:'release@')
|
||||
|
||||
dependencies {
|
||||
implementation 'org.apache.commons:commons-text'
|
||||
@@ -20,33 +19,41 @@ application {
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes(
|
||||
'Main-Class': application.mainClass,
|
||||
'Implementation-Title': rootProject.name,
|
||||
'Implementation-Version': "${version}"
|
||||
)
|
||||
}
|
||||
|
||||
// Include compiled classes from main source set
|
||||
from sourceSets.main.output
|
||||
|
||||
dependsOn configurations.runtimeClasspath
|
||||
from {
|
||||
configurations.runtimeClasspath.collect { dep ->
|
||||
if (dep.isDirectory()) {
|
||||
dep
|
||||
} else {
|
||||
zipTree(dep).matching {
|
||||
exclude 'META-INF/LICENSE.*'
|
||||
exclude 'META-INF/*.SF'
|
||||
exclude 'META-INF/*.DSA'
|
||||
exclude 'META-INF/*.RSA'
|
||||
manifest {
|
||||
attributes(
|
||||
'Main-Class': application.mainClass,
|
||||
'Implementation-Title': rootProject.name,
|
||||
'Implementation-Version': "${version}"
|
||||
)
|
||||
}
|
||||
|
||||
from sourceSets.main.output
|
||||
|
||||
dependsOn configurations.runtimeClasspath
|
||||
|
||||
// Include each JAR dependency
|
||||
configurations.runtimeClasspath.findAll { it.exists() && it.name.endsWith('.jar') }.each { jarFile ->
|
||||
def jarName = jarFile.name.replaceAll(/\.jar$/, '')
|
||||
|
||||
from(zipTree(jarFile)) {
|
||||
// Exclude signature-related files
|
||||
exclude 'META-INF/*.SF', 'META-INF/*.DSA', '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
|
||||
|
||||
}
|
||||
|
||||
javadoc {
|
||||
options.links("https://www.egothor.org/javadoc/zeroecho/lib")
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,14 @@ plugins {
|
||||
id 'java'
|
||||
id 'maven-publish'
|
||||
id 'pmd'
|
||||
id 'com.palantir.git-version'
|
||||
}
|
||||
|
||||
import java.time.LocalDate
|
||||
|
||||
def currentYear = LocalDate.now().getYear()
|
||||
def version = gitVersion(prefix:'release@')
|
||||
|
||||
repositories {
|
||||
|
||||
maven {
|
||||
@@ -26,7 +32,7 @@ dependencies {
|
||||
implementation 'org.apache.commons:commons-text:1.11.0'
|
||||
implementation 'commons-cli:commons-cli:1.9.0'
|
||||
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'
|
||||
}
|
||||
|
||||
@@ -73,10 +79,28 @@ javadoc {
|
||||
options.tags('factory')
|
||||
options.tags('see')
|
||||
|
||||
options.bottom = "Copyright © 2025 Egothor"
|
||||
options.bottom = "Copyright © ${currentYear} Egothor - Version ${version}"
|
||||
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') {
|
||||
// Use JUnit Platform for unit tests.
|
||||
useJUnitPlatform()
|
||||
@@ -87,6 +111,7 @@ if (project.hasProperty('giteaToken') && project.giteaToken) {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
from components.java
|
||||
artifactId = "${rootProject.name}-${project.name}"
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g
|
||||
javadocPath=/var/www/html/javadoc/zeroecho/
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
plugins {
|
||||
id 'buildlogic.java-library-conventions'
|
||||
id 'com.palantir.git-version' version '4.0.0'
|
||||
id 'com.palantir.git-version'
|
||||
}
|
||||
|
||||
group 'org.egothor'
|
||||
version gitVersion(prefix:'release@')
|
||||
|
||||
dependencies {
|
||||
implementation 'org.bouncycastle:bcpkix-jdk18on'
|
||||
implementation 'org.egothor:conflux'
|
||||
implementation 'org.apache.commons:commons-imaging'
|
||||
}
|
||||
|
||||
javadoc {
|
||||
options.links("https://www.egothor.org/javadoc/conflux")
|
||||
}
|
||||
@@ -1,3 +1,9 @@
|
||||
pluginManagement {
|
||||
plugins {
|
||||
id 'com.palantir.git-version' version '4.0.0' // Define the plugin version globally
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
// Apply the foojay-resolver plugin to allow automatic download of JDKs
|
||||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
|
||||
|
||||
Reference in New Issue
Block a user