2014-11-15 03:27:39 +08:00
|
|
|
println """
|
|
|
|
*******************************************
|
2016-06-18 15:32:17 +08:00
|
|
|
You are building WorldEdit!
|
2014-11-15 03:27:39 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
*******************************************
|
|
|
|
"""
|
2014-04-06 10:33:05 +08:00
|
|
|
|
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
2014-11-15 03:27:39 +08:00
|
|
|
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
|
2014-05-16 02:41:26 +08:00
|
|
|
jcenter()
|
2014-04-06 10:33:05 +08:00
|
|
|
}
|
|
|
|
|
2015-02-13 05:30:49 +08:00
|
|
|
configurations.all {
|
|
|
|
resolutionStrategy {
|
2017-05-23 04:00:50 +08:00
|
|
|
force 'com.google.guava:guava:21.0'
|
2015-02-13 05:30:49 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-06 10:33:05 +08:00
|
|
|
dependencies {
|
2016-02-23 09:40:18 +08:00
|
|
|
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
|
2016-08-06 17:29:56 +08:00
|
|
|
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.3.0'
|
|
|
|
classpath 'org.ajoberstar:gradle-git:1.5.1'
|
2014-04-06 10:33:05 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-06 17:29:56 +08:00
|
|
|
allprojects {
|
|
|
|
group = 'com.sk89q.worldedit'
|
2017-08-06 00:18:52 +08:00
|
|
|
version = '6.1.9-SNAPSHOT'
|
2016-08-06 17:29:56 +08:00
|
|
|
}
|
|
|
|
|
2014-11-15 03:27:39 +08: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 = ""
|
2014-04-06 10:33:05 +08:00
|
|
|
|
2016-02-23 10:21:46 +08:00
|
|
|
if (!project.hasProperty("gitCommitHash") && !JavaVersion.current().isJava6()) {
|
2014-11-15 03:27:39 +08:00
|
|
|
try {
|
2016-08-23 08:19:52 +08:00
|
|
|
def repo = org.ajoberstar.grgit.Grgit.open(dir: '.')
|
2014-11-15 03:27:39 +08:00
|
|
|
ext.gitCommitHash = repo.head().abbreviatedId
|
|
|
|
} catch (Exception e) {
|
2016-02-23 11:13:08 +08:00
|
|
|
println "Error getting commit hash: " + e.getMessage()
|
2014-11-15 03:27:39 +08:00
|
|
|
}
|
|
|
|
}
|
2016-02-23 11:16:14 +08:00
|
|
|
if (!project.hasProperty("gitCommitHash")) {
|
|
|
|
ext.gitCommitHash = "no_git_id"
|
|
|
|
}
|
2014-04-06 10:33:05 +08:00
|
|
|
|
2016-06-18 15:32:17 +08: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
|
2016-08-06 17:29:56 +08:00
|
|
|
ivy = false
|
2016-06-18 15:32:17 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resolve {
|
|
|
|
repository {
|
|
|
|
repoKey = 'repo'
|
|
|
|
username = "${artifactory_user}"
|
|
|
|
password = "${artifactory_password}"
|
|
|
|
maven = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-08-06 17:29:56 +08:00
|
|
|
artifactoryPublish.skip = true
|
2016-06-18 15:32:17 +08:00
|
|
|
|
2014-11-15 03:27:39 +08:00
|
|
|
subprojects {
|
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: 'maven'
|
|
|
|
apply plugin: 'checkstyle'
|
|
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
2016-06-18 15:32:17 +08:00
|
|
|
apply plugin: 'com.jfrog.artifactory'
|
2014-04-06 10:33:05 +08:00
|
|
|
|
2014-11-15 03:27:39 +08:00
|
|
|
ext.internalVersion = version + ";" + gitCommitHash
|
2014-04-06 10:33:05 +08:00
|
|
|
|
2016-03-20 00:51:00 +08:00
|
|
|
sourceCompatibility = 1.7
|
|
|
|
targetCompatibility = 1.7
|
2014-04-06 10:33:05 +08:00
|
|
|
|
2014-11-15 03:27:39 +08:00
|
|
|
checkstyle.configFile = new File(rootProject.projectDir, "config/checkstyle/checkstyle.xml")
|
2017-08-02 14:01:12 +08:00
|
|
|
checkstyle.toolVersion = '7.6.1'
|
2014-04-06 10:33:05 +08:00
|
|
|
|
2014-11-15 03:27:39 +08:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven { url "http://repo.bukkit.org/content/groups/public" }
|
|
|
|
maven { url "http://maven.sk89q.com/repo/" }
|
|
|
|
maven { url "http://repo.maven.apache.org/maven2" }
|
2014-04-06 10:33:05 +08:00
|
|
|
}
|
2014-04-06 14:27:10 +08:00
|
|
|
|
2014-11-15 03:27:39 +08:00
|
|
|
if (JavaVersion.current().isJava8Compatible()) {
|
|
|
|
// Java 8 turns on doclint which we fail
|
|
|
|
tasks.withType(Javadoc) {
|
|
|
|
options.addStringOption('Xdoclint:none', '-quiet')
|
|
|
|
}
|
2014-04-06 10:33:05 +08:00
|
|
|
}
|
|
|
|
|
2014-11-15 03:27:39 +08:00
|
|
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
|
|
classifier = 'javadoc'
|
|
|
|
from javadoc.destinationDir
|
2014-05-16 02:41:26 +08:00
|
|
|
}
|
|
|
|
|
2014-11-15 03:27:39 +08:00
|
|
|
artifacts {
|
|
|
|
archives jar
|
|
|
|
archives javadocJar
|
|
|
|
}
|
2014-05-16 02:41:26 +08:00
|
|
|
|
2016-02-03 04:12:54 +08:00
|
|
|
if (!(name.equals('worldedit-forge') || name.equals('worldedit-sponge'))) {
|
2016-01-13 07:32:58 +08:00
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
|
|
classifier = 'sources'
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives sourcesJar
|
|
|
|
}
|
|
|
|
build.dependsOn(sourcesJar)
|
|
|
|
}
|
|
|
|
|
2014-11-15 03:27:39 +08:00
|
|
|
build.dependsOn(checkstyleMain)
|
|
|
|
build.dependsOn(checkstyleTest)
|
|
|
|
build.dependsOn(javadocJar)
|
|
|
|
|
|
|
|
shadowJar {
|
|
|
|
classifier 'dist'
|
|
|
|
dependencies {
|
|
|
|
include(dependency('com.sk89q:jchronic:0.2.4a'))
|
|
|
|
include(dependency('com.thoughtworks.paranamer:paranamer:2.6'))
|
|
|
|
include(dependency('com.sk89q.lib:jlibnoise:1.0.0'))
|
|
|
|
}
|
|
|
|
exclude 'GradleStart**'
|
|
|
|
exclude '.cache'
|
|
|
|
exclude 'LICENSE*'
|
|
|
|
}
|
2016-08-06 17:29:56 +08:00
|
|
|
|
|
|
|
artifactoryPublish {
|
|
|
|
publishConfigs('archives')
|
|
|
|
}
|
2015-01-11 09:09:29 +08:00
|
|
|
}
|