Skip to content

Commit

Permalink
build.gradle: register and configure JAR tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jun 27, 2024
1 parent a108968 commit c5510ef
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,30 @@ tasks.withType(JavaExec).configureEach { // Java runtime options:
enableAssertions true
}
run.dependsOn('assemble')

test.dependsOn('assemble')

// Register publishing tasks:

jar {
archiveBaseName = project.ext.baseName
doLast {
println "using Java ${JavaVersion.current()} (${System.getProperty("java.vendor")})"
}
manifest {
attributes 'Created-By': "${JavaVersion.current()} (${System.getProperty("java.vendor")})"
}
}

java.withJavadocJar()
javadocJar { archiveBaseName = project.ext.baseName }

tasks.register('sourcesJar', Jar) {
archiveBaseName = project.ext.baseName
archiveClassifier = 'sources'
description 'Creates a JAR of Java sourcecode.'
from 'src/main/java' // default is ".allSource", which includes resources
}

javadoc.dependsOn('compileTestJava')

// Download and extract archived JoltPhysics source code
Expand Down

0 comments on commit c5510ef

Please sign in to comment.