Skip to content

Commit

Permalink
build.gradle: add maven-publish plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
capdevon committed Sep 17, 2024
1 parent c6a6939 commit 4efe35e
Showing 1 changed file with 33 additions and 6 deletions.
39 changes: 33 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

plugins {
id 'application'
// Apply the java-library plugin to add support for Java Library
id 'java-library'
id 'java-library' // to build JVM libraries
id 'maven-publish' // to publish artifacts to Maven repositories
}

description = 'Navigation-mesh Toolset for jMonkeyEngine3'
group = 'com.github.capdevon'
version = '0.1.0'

// select one source-code (JDK) option
sourceCompatibility = JavaVersion.VERSION_11
Expand All @@ -13,6 +14,9 @@ targetCompatibility = JavaVersion.VERSION_11
ext {
jmeVersion = '3.6.1-stable'
recast4jVersion = '1.2.8'

artifact = 'jme-navmesh-ai'
baseName = "${artifact}-${version}" // for artifacts
}

gradle.projectsEvaluated {
Expand All @@ -36,8 +40,6 @@ gradle.projectsEvaluated {
}
}

mainClassName = 'com.jme3.recast4j.demo.Test_NavMesh'

repositories {
mavenCentral()
}
Expand Down Expand Up @@ -97,3 +99,28 @@ task cleanLogs(type: Delete) {
task cleanSOs(type: Delete) {
delete fileTree(dir: '.', include: '*.so')
}

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()

publishing {
publications {
mavenJava(MavenPublication) {
artifactId = project.ext.artifact
groupId = "${group}"
version = "${version}"
from components.java
}
}
repositories {
mavenLocal()
}
}

0 comments on commit 4efe35e

Please sign in to comment.