2018-10-04 07:29:34 +00:00
|
|
|
plugins {
|
|
|
|
id 'net.minecrell.licenser' version '0.4.1' apply false
|
2019-07-10 18:07:00 +00:00
|
|
|
id "org.ajoberstar.grgit" version "3.1.1"
|
|
|
|
id "com.github.johnrengelman.shadow" version "5.1.0"
|
|
|
|
id "com.jfrog.artifactory" version "4.9.7"
|
2018-10-04 07:29:34 +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
|
2019-06-27 12:25:02 +00:00
|
|
|
4) If you still need help, ask on Discord! https://discord.gg/enginehub
|
2018-10-04 07:29:34 +00:00
|
|
|
|
|
|
|
Output files will be in [subproject]/build/libs
|
|
|
|
*******************************************
|
|
|
|
"""
|
|
|
|
|
2016-08-06 09:29:56 +00:00
|
|
|
allprojects {
|
|
|
|
group = 'com.sk89q.worldedit'
|
2019-06-11 11:38:53 +00:00
|
|
|
version = '7.0.1-SNAPSHOT'
|
2016-08-06 09:29:56 +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
|
|
|
|
2016-02-23 02:21:46 +00:00
|
|
|
if (!project.hasProperty("gitCommitHash") && !JavaVersion.current().isJava6()) {
|
2014-11-14 19:27:39 +00:00
|
|
|
try {
|
2018-12-15 08:57:37 +00:00
|
|
|
def repo = grgit.open()
|
2014-11-14 19:27:39 +00:00
|
|
|
ext.gitCommitHash = repo.head().abbreviatedId
|
|
|
|
} catch (Exception e) {
|
2016-02-23 03:13:08 +00:00
|
|
|
println "Error getting commit hash: " + e.getMessage()
|
2014-11-14 19:27:39 +00:00
|
|
|
}
|
|
|
|
}
|
2016-02-23 03:16:14 +00:00
|
|
|
if (!project.hasProperty("gitCommitHash")) {
|
|
|
|
ext.gitCommitHash = "no_git_id"
|
|
|
|
}
|
2014-04-06 02:33:05 +00:00
|
|
|
|
2016-06-18 07:32:17 +00: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 09:29:56 +00:00
|
|
|
ivy = false
|
2016-06-18 07:32:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-08-06 09:29:56 +00:00
|
|
|
artifactoryPublish.skip = true
|
2016-06-18 07:32:17 +00:00
|
|
|
|
2014-11-14 19:27:39 +00:00
|
|
|
subprojects {
|
2019-04-21 06:11:39 +00:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven { url "http://maven.sk89q.com/repo/" }
|
2019-04-22 12:05:20 +00:00
|
|
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
2019-04-21 06:11:39 +00:00
|
|
|
}
|
2019-04-29 00:35:28 +00:00
|
|
|
configurations.all {
|
|
|
|
resolutionStrategy {
|
|
|
|
cacheChangingModulesFor 5, 'minutes'
|
|
|
|
}
|
|
|
|
}
|
2019-04-21 06:11:39 +00:00
|
|
|
}
|
|
|
|
|
2019-06-27 12:25:02 +00:00
|
|
|
configure(['core', 'bukkit', 'forge', 'sponge', 'fabric'].collect { project(":worldedit-$it") }) {
|
2014-11-14 19:27:39 +00:00
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: 'maven'
|
|
|
|
apply plugin: 'checkstyle'
|
|
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
2016-06-18 07:32:17 +00:00
|
|
|
apply plugin: 'com.jfrog.artifactory'
|
2018-10-04 07:29:34 +00:00
|
|
|
apply plugin: 'net.minecrell.licenser'
|
2014-04-06 02:33:05 +00:00
|
|
|
|
2014-11-14 19:27:39 +00:00
|
|
|
ext.internalVersion = version + ";" + gitCommitHash
|
2014-04-06 02:33:05 +00:00
|
|
|
|
2018-06-16 06:36:55 +00:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
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")
|
2017-08-02 06:01:12 +00:00
|
|
|
checkstyle.toolVersion = '7.6.1'
|
2014-04-06 02:33:05 +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 javadocJar(type: Jar, dependsOn: javadoc) {
|
2019-07-10 18:07:00 +00:00
|
|
|
getArchiveClassifier().set('javadoc')
|
2014-11-14 19:27:39 +00:00
|
|
|
from javadoc.destinationDir
|
2014-05-15 18:41:26 +00:00
|
|
|
}
|
|
|
|
|
2014-11-14 19:27:39 +00:00
|
|
|
artifacts {
|
|
|
|
archives jar
|
|
|
|
archives javadocJar
|
|
|
|
}
|
2014-05-15 18:41:26 +00:00
|
|
|
|
2019-06-27 12:25:02 +00:00
|
|
|
if (name == "worldedit-core" || name == "worldedit-bukkit") {
|
2016-01-12 23:32:58 +00:00
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
2019-07-10 18:07:00 +00:00
|
|
|
getArchiveClassifier().set('sources')
|
2016-01-12 23:32:58 +00:00
|
|
|
from sourceSets.main.allSource
|
|
|
|
}
|
|
|
|
|
|
|
|
artifacts {
|
|
|
|
archives sourcesJar
|
|
|
|
}
|
|
|
|
build.dependsOn(sourcesJar)
|
|
|
|
}
|
|
|
|
|
2014-11-14 19:27:39 +00:00
|
|
|
build.dependsOn(checkstyleMain)
|
|
|
|
build.dependsOn(checkstyleTest)
|
|
|
|
build.dependsOn(javadocJar)
|
|
|
|
|
2016-08-06 09:29:56 +00:00
|
|
|
artifactoryPublish {
|
|
|
|
publishConfigs('archives')
|
|
|
|
}
|
2018-10-04 07:29:34 +00:00
|
|
|
|
|
|
|
license {
|
|
|
|
header = rootProject.file("HEADER.txt")
|
|
|
|
include '**/*.java'
|
|
|
|
}
|
2015-01-11 01:09:29 +00:00
|
|
|
}
|
2019-04-21 06:11:39 +00:00
|
|
|
|
2019-06-27 12:25:02 +00:00
|
|
|
configure(['bukkit', 'forge', 'sponge', 'fabric'].collect { project(":worldedit-$it") }) {
|
2019-04-21 06:11:39 +00:00
|
|
|
shadowJar {
|
2019-07-10 18:07:00 +00:00
|
|
|
getArchiveClassifier().set('dist')
|
2019-04-21 06:11:39 +00:00
|
|
|
dependencies {
|
2019-04-21 06:33:54 +00:00
|
|
|
include(project(":worldedit-libs:core"))
|
|
|
|
include(project(":worldedit-libs:${project.name.replace("worldedit-", "")}"))
|
2019-04-21 06:11:39 +00:00
|
|
|
include(project(":worldedit-core"))
|
|
|
|
}
|
|
|
|
exclude 'GradleStart**'
|
|
|
|
exclude '.cache'
|
|
|
|
exclude 'LICENSE*'
|
|
|
|
}
|
|
|
|
}
|