Add maven repo

closes #1394
This commit is contained in:
Jesse Boyd 2017-03-08 16:51:01 +11:00
parent aa7b770c03
commit e94adb04ea
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
3 changed files with 45 additions and 3 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ Core/build
Bukkit/build Bukkit/build
### Maven ### ### Maven ###
/mvn
/target/lib /target/lib
/target/maven-archiver /target/maven-archiver
/target/classes /target/classes

View File

@ -7,5 +7,46 @@ dependencies {
sourceCompatibility = 1.7 sourceCompatibility = 1.7
targetCompatibility = 1.7 targetCompatibility = 1.7
jar.archiveName = rootProject.name + "-Core-${parent.version}.jar"
jar.destinationDir = file '../target' processResources {
from('src/main/resources') {
include 'plotsquared.properties'
expand(
version: "${project.parent.version}",
name: project.parent.name,
)
}
}
jar.archiveName="plotsquared-api-${project.parent.version}.jar"
jar.destinationDir = file '../mvn/com/plotsquared/plotsquared-api/' + project.parent.version
task createPom << {
pom {
project {
groupId 'com.plotsquared'
artifactId 'plotsquared-api'
version project.parent.version
}
}.writeTo("../mvn/com/plotsquared/plotsquared-api/${project.parent.version}/plotsquared-api-${project.parent.version}.pom")
pom {
project {
groupId 'com.plotsquared'
artifactId 'plotsquared-api'
version 'latest'
}
}.writeTo("../mvn/com/plotsquared/plotsquared-api/latest/plotsquared-api-latest.pom")
}
task copyFiles {
doLast {
copy {
from "../mvn/com/plotsquared/plotsquared-api/${project.parent.version}/"
into '../mvn/com/plotsquared/plotsquared-api/latest/'
include('*.jar')
rename ("plotsquared-api-${project.parent.version}.jar", 'plotsquared-api-latest.jar')
}
}
}
build.finalizedBy(copyFiles)
copyFiles.dependsOn(createPom)

View File

@ -141,7 +141,7 @@ public class Load extends SubCommand {
try { try {
String schematic = schematics.get(i); String schematic = schematics.get(i);
String[] split = schematic.split("_"); String[] split = schematic.split("_");
if (split.length != 6) { if (split.length < 5) {
continue; continue;
} }
String time = secToTime((System.currentTimeMillis() / 1000) - Long.parseLong(split[0])); String time = secToTime((System.currentTimeMillis() / 1000) - Long.parseLong(split[0]));