mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 14:38:53 +00:00
Add JitPack integration and maven publishing
This commit is contained in:
1 parent
4fbc117792
commit
e6f4e4f997
4 files changed
+66
-4
No files matched your search
Executable
+19
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
JV=$(java -version 2>&1 >/dev/null | head -1)
|
||||||
|
echo "$JV" | sed -E 's/^.*version "([^".]*)\.[^"]*".*$/\1/'
|
||||||
|
|
||||||
|
if [ "$JV" != 16 ]; then
|
||||||
|
case "$1" in
|
||||||
|
install)
|
||||||
|
echo "installing sdkman..."
|
||||||
|
curl -s "https://get.sdkman.io" | bash
|
||||||
|
source ~/.sdkman/bin/sdkman-init.sh
|
||||||
|
sdk install java 16.0.1-open
|
||||||
|
;;
|
||||||
|
use)
|
||||||
|
echo "must source ~/.sdkman/bin/sdkman-init.sh"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
+32
-2
@@ -2,6 +2,7 @@ plugins {
|
|||||||
id 'com.github.johnrengelman.shadow' version '7.1.2'
|
id 'com.github.johnrengelman.shadow' version '7.1.2'
|
||||||
id 'org.ajoberstar.grgit' version '5.0.0'
|
id 'org.ajoberstar.grgit' version '5.0.0'
|
||||||
id 'java'
|
id 'java'
|
||||||
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
group 'net.william278'
|
group 'net.william278'
|
||||||
@@ -22,9 +23,9 @@ allprojects {
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
|
||||||
compileJava.options.encoding = 'UTF-8'
|
compileJava.options.encoding = 'UTF-8'
|
||||||
javadoc.options.encoding = 'UTF-8'
|
|
||||||
|
|
||||||
compileJava.options.release.set 16
|
compileJava.options.release.set 16
|
||||||
|
javadoc.options.encoding = 'UTF-8'
|
||||||
|
javadoc.options.addStringOption('Xdoclint:none', '-quiet')
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
@@ -65,6 +66,35 @@ subprojects {
|
|||||||
destinationDirectory.set(file("$rootDir/target"))
|
destinationDirectory.set(file("$rootDir/target"))
|
||||||
archiveClassifier.set('')
|
archiveClassifier.set('')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// API publishing
|
||||||
|
if ('bukkit'.contains(project.name)) {
|
||||||
|
java {
|
||||||
|
withSourcesJar()
|
||||||
|
withJavadocJar()
|
||||||
|
}
|
||||||
|
sourcesJar {
|
||||||
|
destinationDirectory.set(file("$rootDir/target"))
|
||||||
|
}
|
||||||
|
javadocJar {
|
||||||
|
destinationDirectory.set(file("$rootDir/target"))
|
||||||
|
}
|
||||||
|
shadowJar.dependsOn(sourcesJar, javadocJar)
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
mavenJava(MavenPublication) {
|
||||||
|
groupId = 'net.william278'
|
||||||
|
artifactId = 'huskhomes'
|
||||||
|
version = "$rootProject.version"
|
||||||
|
artifact shadowJar
|
||||||
|
artifact javadocJar
|
||||||
|
artifact sourcesJar
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
jar.dependsOn shadowJar
|
jar.dependsOn shadowJar
|
||||||
clean.delete "$rootDir/target"
|
clean.delete "$rootDir/target"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ import java.util.Objects;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The HuskHomes API implementation for the Bukkit platform, providing methods to access player data, homes, warps
|
* The HuskHomes API implementation for the Bukkit platform, providing methods to access player data, homes, warps
|
||||||
* & process teleports
|
* and process teleports
|
||||||
* </p>
|
* <p>
|
||||||
* Retrieve an instance of the API class via {@link #getInstance()}.
|
* Retrieve an instance of the API class via {@link #getInstance()}.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
@@ -97,6 +97,7 @@ public class HuskHomesAPI extends BaseHuskHomesAPI {
|
|||||||
*
|
*
|
||||||
* @param location the bukkit location to get the {@link Position} instance for
|
* @param location the bukkit location to get the {@link Position} instance for
|
||||||
* @param server the {@link Server} the position is on
|
* @param server the {@link Server} the position is on
|
||||||
|
* @return the {@link Position} instance for the given bukkit {@link Location} on the given {@link Server}
|
||||||
* @see Position#server
|
* @see Position#server
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
|||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
# This file ensures jitpack builds HuskSync correctly by setting the JDK to 16
|
||||||
|
jdk:
|
||||||
|
- 'openjdk16'
|
||||||
|
before_install:
|
||||||
|
- 'git clone https://github.com/WiIIiam278/HuskHomes2.git --recurse-submodules'
|
||||||
|
- 'chmod +x gradlew'
|
||||||
|
- 'chmod +x ./.scripts/ensure-java-16'
|
||||||
|
- 'bash ./.scripts/ensure-java-16 install'
|
||||||
|
install:
|
||||||
|
- 'if ! ./.scripts/ensure-java-16 use; then source ~/.sdkman/bin/sdkman-init.sh; fi'
|
||||||
|
- 'java -version'
|
||||||
|
- './gradlew publishToMavenLocal'
|
||||||
Reference in new issue
Block a user