WorldEdit/build.gradle

160 lines
4.4 KiB
Groovy
Raw Normal View History

buildscript {
repositories {
mavenCentral()
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
2015-02-13 05:30:49 +08:00
configurations.all {
resolutionStrategy {
2018-12-15 16:57:37 +08:00
force 'commons-io:commons-io:2.4'
2015-02-13 05:30:49 +08:00
}
}
dependencies {
2018-09-25 18:24:10 +08:00
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
2018-12-15 16:57:37 +08:00
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.8.1'
}
}
2018-10-04 15:29:34 +08:00
plugins {
id 'net.minecrell.licenser' version '0.4.1' apply false
2018-12-15 16:57:37 +08:00
id "org.ajoberstar.grgit" version "2.3.0"
2018-10-04 15:29:34 +08: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
*******************************************
"""
allprojects {
group = 'com.sk89q.worldedit'
2019-06-11 19:36:19 +08:00
version = '7.0.0'
}
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") && !JavaVersion.current().isJava6()) {
try {
2018-12-15 16:57:37 +08:00
def repo = grgit.open()
ext.gitCommitHash = repo.head().abbreviatedId
} catch (Exception e) {
2016-02-23 11:13:08 +08:00
println "Error getting commit hash: " + e.getMessage()
}
}
2016-02-23 11:16:14 +08:00
if (!project.hasProperty("gitCommitHash")) {
ext.gitCommitHash = "no_git_id"
}
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
ivy = false
}
}
}
artifactoryPublish.skip = true
subprojects {
repositories {
mavenCentral()
maven { url "http://maven.sk89q.com/repo/" }
2019-04-22 20:05:20 +08:00
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
configurations.all {
resolutionStrategy {
cacheChangingModulesFor 5, 'minutes'
}
}
}
configure(['core', 'bukkit', 'forge', 'sponge'].collect { project(":worldedit-$it") }) {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'checkstyle'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.jfrog.artifactory'
2018-10-04 15:29:34 +08:00
apply plugin: 'net.minecrell.licenser'
ext.internalVersion = version + ";" + gitCommitHash
2018-06-16 14:36:55 +08:00
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
checkstyle.configFile = new File(rootProject.projectDir, "config/checkstyle/checkstyle.xml")
checkstyle.toolVersion = '7.6.1'
if (JavaVersion.current().isJava8Compatible()) {
// Java 8 turns on doclint which we fail
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives jar
archives javadocJar
}
2016-02-03 04:12:54 +08:00
if (!(name.equals('worldedit-forge') || name.equals('worldedit-sponge'))) {
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
build.dependsOn(sourcesJar)
}
build.dependsOn(checkstyleMain)
build.dependsOn(checkstyleTest)
build.dependsOn(javadocJar)
artifactoryPublish {
publishConfigs('archives')
}
2018-10-04 15:29:34 +08:00
license {
header = rootProject.file("HEADER.txt")
include '**/*.java'
}
}
configure(['bukkit', 'forge', 'sponge'].collect { project(":worldedit-$it") }) {
shadowJar {
classifier 'dist'
dependencies {
2019-04-21 14:33:54 +08:00
include(project(":worldedit-libs:core"))
include(project(":worldedit-libs:${project.name.replace("worldedit-", "")}"))
include(project(":worldedit-core"))
}
exclude 'GradleStart**'
exclude '.cache'
exclude 'LICENSE*'
}
}