-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build.gradle: configure artifacts for publication
- Loading branch information
1 parent
985541f
commit 2e5bad4
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ plugins { | |
id 'application' // to build JVM applications | ||
id 'cpp' // to compile C++ code and link native libraries | ||
id 'java-library' // to build JVM libraries | ||
id 'maven-publish' // to publish artifacts to Maven repositories | ||
alias(libs.plugins.download) // to retrieve files from URLs | ||
} | ||
|
||
|
@@ -12,6 +13,7 @@ ext { | |
artifact = 'joltjni' | ||
version = '0.1.0' | ||
baseName = "${artifact}-${version}" // for artifacts | ||
websiteUrl = 'https://github.com/stephengold/jolt-jni' | ||
} | ||
|
||
sourceSets.main.java { | ||
|
@@ -203,6 +205,46 @@ tasks.register('sourcesJar', Jar) { | |
|
||
javadoc.dependsOn('compileTestJava') | ||
|
||
publishing { | ||
publications { | ||
maven(MavenPublication) { | ||
artifact sourcesJar | ||
artifactId artifact | ||
from components.java | ||
groupId project.ext.group | ||
pom { | ||
description = 'a JNI interface to Jolt Physics' | ||
developers { | ||
developer { | ||
email = '[email protected]' | ||
name = 'Stephen Gold' | ||
} | ||
} | ||
inceptionYear = '2024' | ||
licenses { | ||
license { | ||
distribution = 'repo' | ||
name = 'MIT License' | ||
url = 'https://opensource.org/licenses/MIT' | ||
} | ||
} | ||
name = project.ext.group + ':' + artifact | ||
scm { | ||
connection = 'scm:git:git://github.com/stephengold/jolt-jni.git' | ||
developerConnection = 'scm:git:ssh://github.com:stephengold/jolt-jni.git' | ||
url = project.ext.websiteUrl + '/tree/master' | ||
} | ||
url = project.ext.websiteUrl | ||
} | ||
version project.ext.version | ||
} | ||
} | ||
} | ||
publishMavenPublicationToMavenLocal.dependsOn('assemble') | ||
publishMavenPublicationToMavenLocal.doLast { | ||
println 'installed locally as ' + project.ext.baseName | ||
} | ||
|
||
// Download and extract archived JoltPhysics source code | ||
|
||
tasks.register('download', Download) { | ||
|