mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-12-28 03:57:38 +01:00
134 lines
4.5 KiB
Groovy
134 lines
4.5 KiB
Groovy
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
|
|
jcenter()
|
|
}
|
|
dependencies {
|
|
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
|
|
classpath 'org.ajoberstar:grgit:1.7.0'
|
|
}
|
|
configurations.all {
|
|
resolutionStrategy {
|
|
force 'org.ow2.asm:asm:6.0_BETA'
|
|
}
|
|
}
|
|
}
|
|
|
|
task setupCIWorkspace {
|
|
// do nothing, stub method
|
|
}
|
|
|
|
apply plugin: 'java'
|
|
clean { delete "target" }
|
|
|
|
group = 'com.boydti.fawe'
|
|
|
|
def revision = ""
|
|
def buildNumber = ""
|
|
def semver = ""
|
|
def date = ""
|
|
ext {
|
|
try {
|
|
git = org.ajoberstar.grgit.Grgit.open(file(".git"))
|
|
date = git.head().date.format("yy.MM.dd")
|
|
revision = "-${git.head().abbreviatedId}"
|
|
parents = git.head().parentIds;
|
|
index = -67; // Offset to match CI
|
|
int major, minor, patch;
|
|
major = minor = patch = 0;
|
|
for (; parents != null && !parents.isEmpty(); index++) {
|
|
int majorCount, minorCount, patchCount;
|
|
patchCount = minor == 0 && major == 0 ? 1 : 0;
|
|
commit = git.getResolve().toCommit(parents.get(0));
|
|
for (String line : commit.fullMessage.tokenize("\n")) {
|
|
switch (line.replaceAll("- ", "").split(" ")[0].toLowerCase()) {
|
|
case "minor":
|
|
case "added":
|
|
case "add":
|
|
case "change":
|
|
case "changed":
|
|
case "changes":
|
|
if (major == 0) {
|
|
minorCount = 1; patchCount = 0;
|
|
}
|
|
break;
|
|
case "refactor":
|
|
case "remove":
|
|
case "major":
|
|
patchCount = minorCount = 0;
|
|
majorCount = 1;
|
|
break;
|
|
}
|
|
}
|
|
major += majorCount;
|
|
minor += minorCount;
|
|
patch += patchCount;
|
|
parents = commit.getParentIds()
|
|
}
|
|
buildNumber = "-${index}"
|
|
semver = "-${major}.${minor}.${patch}"
|
|
} catch (Throwable ignore) {
|
|
revision = "unknown";
|
|
}
|
|
}
|
|
|
|
version = date + revision + buildNumber + semver
|
|
if ( project.hasProperty("lzNoVersion") ) { // gradle build -PlzNoVersion
|
|
version = "unknown"
|
|
}
|
|
description = """FastAsyncWorldEdit"""
|
|
|
|
subprojects {
|
|
|
|
apply plugin: 'java'
|
|
apply plugin: 'maven'
|
|
apply plugin: 'eclipse'
|
|
apply plugin: 'idea'
|
|
|
|
sourceCompatibility = 1.8
|
|
targetCompatibility = 1.8
|
|
|
|
compileJava {
|
|
options.compilerArgs += ["-parameters"]
|
|
}
|
|
|
|
repositories {
|
|
maven {url "https://mvnrepository.com/artifact/"}
|
|
mavenCentral()
|
|
maven {url "http://repo.dmulloy2.net/content/groups/public/"}
|
|
maven {url "https://repo.destroystokyo.com/repository/maven-public//"}
|
|
//maven {url "http://ci.emc.gs/nexus/content/groups/aikar/" }
|
|
maven {url "http://ci.athion.net/job/PlotSquared-Legacy/ws/mvn/"}
|
|
mavenLocal()
|
|
maven {url "http://empcraft.com/maven2"}
|
|
maven {url "https://hub.spigotmc.org/nexus/content/groups/public/"}
|
|
maven {url "http://maven.sk89q.com/repo/"}
|
|
maven {url "http://repo.maven.apache.org/maven2"}
|
|
maven {url "http://ci.frostcast.net/plugin/repository/everything"}
|
|
maven {url "http://maven.sk89q.com/artifactory/repo"}
|
|
maven {url "http://repo.spongepowered.org/maven"}
|
|
maven {url "http://dl.bintray.com/tastybento/maven-repo"}
|
|
maven {url "https://repo.inventivetalent.org/content/groups/public/"}
|
|
maven {url "https://store.ttyh.ru/libraries/"}
|
|
}
|
|
}
|
|
task aggregatedJavadocs(type: Javadoc, description: 'Generate javadocs from all child projects as if it was a single project', group: 'Documentation') {
|
|
destinationDir = file("./docs/javadoc")
|
|
title = "$project.name $version API"
|
|
options.author true
|
|
options.links 'http://docs.spring.io/spring/docs/4.3.x/javadoc-api/', 'http://docs.oracle.com/javase/8/docs/api/', 'http://docs.spring.io/spring-ws/docs/2.3.0.RELEASE/api/', 'http://docs.spring.io/spring-security/site/docs/4.0.4.RELEASE/apidocs/'
|
|
options.addStringOption('Xdoclint:none', '-quiet')
|
|
|
|
delete "./docs"
|
|
|
|
subprojects.each { proj ->
|
|
proj.tasks.withType(Javadoc).each { javadocTask ->
|
|
source += javadocTask.source
|
|
classpath += javadocTask.classpath
|
|
excludes += javadocTask.excludes
|
|
includes += javadocTask.includes
|
|
}
|
|
}
|
|
}
|