2014-11-14 19:27:39 +00:00
|
|
|
println """
|
|
|
|
*******************************************
|
|
|
|
You are building WorldEdit!
|
|
|
|
|
|
|
|
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 02:33:05 +00:00
|
|
|
|
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
2014-11-14 19:27:39 +00:00
|
|
|
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
|
2014-05-15 18:41:26 +00:00
|
|
|
jcenter()
|
2014-04-06 02:33:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2014-10-12 19:27:51 +00:00
|
|
|
classpath 'com.github.jengelman.gradle.plugins:shadow:1.1.1'
|
2014-11-14 19:27:39 +00:00
|
|
|
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1'
|
|
|
|
classpath 'org.ajoberstar:gradle-git:0.12.0'
|
2014-04-06 02:33:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-14 19:27:39 +00: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 02:33:05 +00:00
|
|
|
|
2014-11-14 19:27:39 +00:00
|
|
|
if (!project.hasProperty("gitCommitHash")) {
|
|
|
|
try {
|
|
|
|
def repo = Grgit.open(project.file('.'))
|
|
|
|
ext.gitCommitHash = repo.head().abbreviatedId
|
|
|
|
} catch (Exception e) {
|
|
|
|
ext.gitCommitHash = "no_git_id"
|
|
|
|
}
|
|
|
|
}
|
2014-04-06 02:33:05 +00:00
|
|
|
|
2014-11-14 19:27:39 +00:00
|
|
|
subprojects {
|
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: 'maven'
|
|
|
|
apply plugin: 'checkstyle'
|
|
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
|
|
|
apply plugin: 'com.jfrog.artifactory-upload'
|
2014-04-06 02:33:05 +00:00
|
|
|
|
2014-11-14 19:27:39 +00:00
|
|
|
group = 'com.sk89q.worldedit'
|
2014-11-15 03:30:08 +00:00
|
|
|
version = '6.0-SNAPSHOT'
|
2014-11-14 19:27:39 +00:00
|
|
|
ext.internalVersion = version + ";" + gitCommitHash
|
2014-04-06 02:33:05 +00:00
|
|
|
|
2014-11-14 19:27:39 +00:00
|
|
|
sourceCompatibility = 1.6
|
|
|
|
targetCompatibility = 1.6
|
2014-04-06 02:33:05 +00:00
|
|
|
|
2014-11-14 19:27:39 +00:00
|
|
|
checkstyle.configFile = new File(rootProject.projectDir, "config/checkstyle/checkstyle.xml")
|
2014-04-06 02:33:05 +00:00
|
|
|
|
2014-11-14 19:27:39 +00: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 02:33:05 +00:00
|
|
|
}
|
2014-04-06 06:27:10 +00:00
|
|
|
|
2014-11-14 19:27:39 +00:00
|
|
|
if (JavaVersion.current().isJava8Compatible()) {
|
|
|
|
// Java 8 turns on doclint which we fail
|
|
|
|
tasks.withType(Javadoc) {
|
|
|
|
options.addStringOption('Xdoclint:none', '-quiet')
|
|
|
|
}
|
2014-04-06 02:33:05 +00:00
|
|
|
}
|
|
|
|
|
2014-11-14 19:27:39 +00:00
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
|
|
classifier = 'sources'
|
|
|
|
from sourceSets.main.allSource
|
2014-04-06 02:33:05 +00:00
|
|
|
}
|
2014-05-15 18:41:26 +00:00
|
|
|
|
2014-11-14 19:27:39 +00:00
|
|
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
|
|
|
classifier = 'javadoc'
|
|
|
|
from javadoc.destinationDir
|
2014-05-15 18:41:26 +00:00
|
|
|
}
|
|
|
|
|
2014-11-14 19:27:39 +00:00
|
|
|
artifacts {
|
|
|
|
archives jar
|
|
|
|
archives sourcesJar
|
|
|
|
archives javadocJar
|
|
|
|
}
|
2014-05-15 18:41:26 +00:00
|
|
|
|
2014-11-14 19:27:39 +00:00
|
|
|
build.dependsOn(checkstyleMain)
|
|
|
|
build.dependsOn(checkstyleTest)
|
|
|
|
build.dependsOn(sourcesJar)
|
|
|
|
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*'
|
|
|
|
}
|
2014-05-15 18:41:26 +00:00
|
|
|
|
2014-11-14 19:27:39 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2014-05-15 18:41:26 +00:00
|
|
|
|
2014-11-14 19:27:39 +00:00
|
|
|
resolve {
|
|
|
|
repository {
|
|
|
|
repoKey = 'repo'
|
|
|
|
username = "${artifactory_user}"
|
|
|
|
password = "${artifactory_password}"
|
|
|
|
maven = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|