Skip to content

Commit

Permalink
Actions (#10)
Browse files Browse the repository at this point in the history
* Actions

* Make publish work
  • Loading branch information
alanocallaghan authored Oct 21, 2024
1 parent 1f0bbe5 commit 0bd9dc3
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id 'java-library'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '8.1.1'
// Include this plugin to avoid downloading JavaCPP dependencies for all platforms
id 'org.bytedeco.gradle-javacpp-platform'
Expand Down Expand Up @@ -74,7 +75,7 @@ tasks.register("copyDependencies", Copy) {
}

/*
* Ensure Java 17 compatibility, and include sources and javadocs when building.
* Ensure Java compatibility, and include sources and javadocs when building.
*/
java {
toolchain {
Expand Down Expand Up @@ -126,3 +127,35 @@ repositories {
url "https://maven.scijava.org/content/repositories/snapshots"
}
}


publishing {
repositories {
maven {
name = "SciJava"
def releasesRepoUrl = uri("https://maven.scijava.org/content/repositories/releases")
def snapshotsRepoUrl = uri("https://maven.scijava.org/content/repositories/snapshots")
// Use gradle -Prelease publish
url = project.hasProperty('release') ? releasesRepoUrl : snapshotsRepoUrl
credentials {
username = System.getenv("MAVEN_USER")
password = System.getenv("MAVEN_PASS")
}
}
}

publications {
mavenJava(MavenPublication) {
from components.java

pom {
licenses {
license {
name = 'Apache License v2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0'
}
}
}
}
}
}

0 comments on commit 0bd9dc3

Please sign in to comment.