FastAsyncWorldedit/build.gradle

95 lines
2.9 KiB
Groovy
Raw Normal View History

2016-04-02 06:06:24 +02:00
buildscript {
repositories {
mavenCentral()
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
2016-05-14 15:38:07 +02:00
classpath 'org.ajoberstar:grgit:1.7.0'
2016-04-02 06:06:24 +02:00
}
}
2017-01-15 15:58:24 +01:00
task setupCIWorkspace {
// do nothing, stub method
}
apply plugin: 'java'
clean { delete "target" }
2016-04-02 06:06:24 +02:00
group = 'com.boydti.fawe'
def revision = ""
def buildNumber = ""
def semver = ""
def date = ""
ext {
2016-05-14 15:38:07 +02:00
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 = -87; // Offset to mach CI
int major, minor, patch;
major = minor = patch = 0;
for (;parents != null && !parents.isEmpty();index++) {
int majorCount, minorCount, patchCount;
2016-09-25 18:42:23 +02:00
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":
2016-09-25 18:42:23 +02:00
if (major == 0) {minorCount = 1; patchCount = 0;}
break;
case "refactor":
case "remove":
case "major":
2016-09-25 18:42:23 +02:00
patchCount = minorCount = 0;
majorCount = 1;
break;
}
}
major += majorCount;
minor += minorCount;
patch += patchCount;
parents = commit.getParentIds()
}
buildNumber = "-${index}"
semver = "-${major}.${minor}.${patch}"
}
version = date + revision + buildNumber + semver
if ( project.hasProperty("lzNoVersion") ) { // gradle build -PlzNoVersion
version = "unknown";
}
2016-04-02 06:06:24 +02:00
description = """FastAsyncWorldEdit"""
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
sourceCompatibility = 1.8
targetCompatibility = 1.8
2016-06-10 06:08:37 +02:00
2016-04-02 06:06:24 +02:00
repositories {
mavenCentral()
maven { url = "https://mvnrepository.com/artifact/"}
maven {url "http://ci.emc.gs/nexus/content/groups/aikar/" }
2016-09-04 17:34:38 +02:00
maven {url "http://ci.regularbox.com/plugin/repository/everything/"}
2016-04-02 06:06:24 +02:00
maven {url "http://empcraft.com/maven2"}
maven {url "https://hub.spigotmc.org/nexus/content/groups/public/"}
maven {url "http://maven.sk89q.com/repo/"}
2016-08-15 00:08:21 +02:00
maven {url "http://nexus.hc.to/content/repositories/pub_releases"}
2016-04-02 06:06:24 +02:00
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"}
}
2016-08-15 00:08:21 +02:00
}