2015-11-14 01:12:55 +01:00
|
|
|
println """
|
|
|
|
*******************************************
|
|
|
|
You are building WorldGuard!
|
|
|
|
|
|
|
|
If you encounter trouble:
|
|
|
|
1) Read COMPILING.md if you haven't yet
|
|
|
|
2) Try running 'build' in a separate Gradle run
|
|
|
|
3) Use gradlew and not gradle
|
|
|
|
4) If you still need help, ask on IRC! irc.esper.net #sk89q
|
|
|
|
|
|
|
|
Output files will be in [subproject]/build/libs
|
|
|
|
*******************************************
|
|
|
|
"""
|
|
|
|
|
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
|
|
|
|
jcenter()
|
|
|
|
}
|
|
|
|
|
|
|
|
configurations.all {
|
|
|
|
resolutionStrategy {
|
2017-05-23 02:44:06 +02:00
|
|
|
force 'com.google.guava:guava:21.0'
|
2015-11-14 01:12:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2018-12-02 12:40:46 +01:00
|
|
|
classpath "com.github.jengelman.gradle.plugins:shadow:4.0.3"
|
2018-07-19 16:06:02 +02:00
|
|
|
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.7.5'
|
|
|
|
classpath 'org.ajoberstar:gradle-git:1.7.2'
|
2015-11-14 01:12:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-20 15:35:55 +02:00
|
|
|
allprojects {
|
|
|
|
group = 'com.sk89q.worldguard'
|
2019-01-22 13:17:22 +01:00
|
|
|
version = '7.0.0-SNAPSHOT'
|
2018-09-20 15:35:55 +02:00
|
|
|
}
|
|
|
|
|
2015-11-14 01:12:55 +01:00
|
|
|
if (!project.hasProperty("artifactory_contextUrl")) ext.artifactory_contextUrl = "http://localhost"
|
|
|
|
if (!project.hasProperty("artifactory_user")) ext.artifactory_user = "guest"
|
|
|
|
if (!project.hasProperty("artifactory_password")) ext.artifactory_password = ""
|
|
|
|
|
|
|
|
if (!project.hasProperty("gitCommitHash")) {
|
|
|
|
try {
|
2016-01-17 05:19:43 +01:00
|
|
|
def repo = org.ajoberstar.grgit.Grgit.open(project.file('.'))
|
2015-11-14 01:12:55 +01:00
|
|
|
ext.gitCommitHash = repo.head().abbreviatedId
|
|
|
|
} catch (Exception e) {
|
|
|
|
ext.gitCommitHash = "no_git_id"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-20 15:35:55 +02:00
|
|
|
apply plugin: 'com.jfrog.artifactory'
|
|
|
|
artifactory {
|
|
|
|
contextUrl = "${artifactory_contextUrl}"
|
|
|
|
publish {
|
|
|
|
repository {
|
|
|
|
repoKey = project.version.contains("SNAPSHOT") ? 'libs-snapshot-local' : 'libs-release-local'
|
|
|
|
username = "${artifactory_user}"
|
|
|
|
password = "${artifactory_password}"
|
|
|
|
maven = true
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
artifactoryPublish.skip = true
|
|
|
|
|
2015-11-14 01:12:55 +01:00
|
|
|
subprojects {
|
|
|
|
apply plugin: 'java'
|
2019-04-29 02:36:28 +02:00
|
|
|
apply plugin: 'java-library'
|
2015-11-14 01:12:55 +01:00
|
|
|
apply plugin: 'maven'
|
2019-01-27 22:13:34 +01:00
|
|
|
apply plugin: 'checkstyle'
|
2015-11-14 01:12:55 +01:00
|
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
2018-07-19 16:06:02 +02:00
|
|
|
apply plugin: 'com.jfrog.artifactory'
|
2015-11-14 01:12:55 +01:00
|
|
|
|
|
|
|
ext.internalVersion = version + ";" + gitCommitHash
|
|
|
|
|
2018-09-20 15:35:55 +02:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
2015-11-14 01:12:55 +01:00
|
|
|
|
2019-01-27 22:13:34 +01:00
|
|
|
checkstyle.configFile = new File(rootProject.projectDir, "config/checkstyle/checkstyle.xml")
|
|
|
|
checkstyle.toolVersion = '7.6.1'
|
2015-11-14 01:12:55 +01:00
|
|
|
|
|
|
|
repositories {
|
2018-07-19 16:06:02 +02:00
|
|
|
mavenLocal()
|
2015-11-14 01:12:55 +01:00
|
|
|
mavenCentral()
|
|
|
|
maven { url "http://repo.spongepowered.org/maven/" }
|
|
|
|
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" }
|
|
|
|
}
|
|
|
|
|
|
|
|
if (JavaVersion.current().isJava8Compatible()) {
|
|
|
|
// Java 8 turns on doclint which we fail
|
|
|
|
tasks.withType(Javadoc) {
|
|
|
|
options.addStringOption('Xdoclint:none', '-quiet')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
|
|
classifier = 'sources'
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
}
|
|
|
|
|
|
|
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
|
|
classifier = 'javadoc'
|
|
|
|
from javadoc.destinationDir
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives jar
|
|
|
|
archives sourcesJar
|
|
|
|
archives javadocJar
|
|
|
|
}
|
|
|
|
|
2019-01-27 22:13:34 +01:00
|
|
|
build.dependsOn(checkstyleMain)
|
|
|
|
build.dependsOn(checkstyleTest)
|
2015-11-14 01:12:55 +01:00
|
|
|
build.dependsOn(sourcesJar)
|
|
|
|
build.dependsOn(javadocJar)
|
|
|
|
|
|
|
|
shadowJar {
|
|
|
|
classifier 'dist'
|
|
|
|
dependencies {
|
|
|
|
include(dependency('org.khelekore:prtree:1.5.0'))
|
2018-12-23 03:47:23 +01:00
|
|
|
include(dependency('com.sk89q:squirrelid:0.2.0'))
|
2018-07-19 16:06:02 +02:00
|
|
|
include(dependency('org.flywaydb:flyway-core:3.0'))
|
2015-11-14 01:12:55 +01:00
|
|
|
}
|
|
|
|
exclude 'GradleStart**'
|
|
|
|
exclude '.cache'
|
|
|
|
exclude 'LICENSE*'
|
|
|
|
}
|
|
|
|
|
2018-09-20 15:35:55 +02:00
|
|
|
artifactoryPublish {
|
|
|
|
publishConfigs('archives')
|
2015-11-14 01:12:55 +01:00
|
|
|
}
|
|
|
|
}
|