Skip to content

Commit

Permalink
auto download the JoltPhysics v5.0.0 source code archive from GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jun 26, 2024
1 parent cf182c2 commit 162551b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.cxx/
/downloads/
/src/main/native/auto/

# Ignore Gradle's project-specific cache directory:
Expand Down
14 changes: 13 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

plugins {
id 'java-library' // to build JVM libraries
alias(libs.plugins.download) // to retrieve files from URLs
}

ext {
Expand Down Expand Up @@ -36,10 +37,21 @@ tasks.withType(JavaCompile) { // Java compile-time options:

javadoc.dependsOn('compileTestJava')

// download archived JoltPhysics source code

tasks.register('download', Download) {
src 'https://github.com/jrouwe/JoltPhysics/archive/refs/tags/v5.0.0.zip'
dest file('downloads/JoltPhysics-5.0.0.zip')
overwrite false
}

// Register cleanup tasks:

clean.dependsOn('cleanAutoHeaders')
clean.dependsOn('cleanAutoHeaders', 'cleanDownloads')

tasks.register('cleanAutoHeaders', Delete) { // auto-generated JNI headers
delete 'src/main/native/auto'
}
tasks.register('cleanDownloads', Delete) { // downloaded files
delete 'downloads'
}
11 changes: 11 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## catalog of libraries and plugins used to build the jolt-jni project

[versions]

[libraries]

[bundles]

[plugins]

download = { id = "de.undercouch.download", version = "5.6.0" }

0 comments on commit 162551b

Please sign in to comment.