Skip to content

Commit

Permalink
build.gradle: configure artifacts for publication
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jun 27, 2024
1 parent 985541f commit 2e5bad4
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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 {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 2e5bad4

Please sign in to comment.