mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-15 23:25:21 +01:00
ca4bb7a53d
Fixes WORLDGUARD-3635.
132 lines
3.7 KiB
Groovy
132 lines
3.7 KiB
Groovy
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 {
|
|
force 'com.google.guava:guava:17.0'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.1'
|
|
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1'
|
|
classpath 'org.ajoberstar:gradle-git:0.12.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")) {
|
|
try {
|
|
def repo = org.ajoberstar.grgit.Grgit.open(project.file('.'))
|
|
ext.gitCommitHash = repo.head().abbreviatedId
|
|
} catch (Exception e) {
|
|
ext.gitCommitHash = "no_git_id"
|
|
}
|
|
}
|
|
|
|
subprojects {
|
|
apply plugin: 'java'
|
|
apply plugin: 'maven'
|
|
apply plugin: 'checkstyle'
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
|
apply plugin: 'com.jfrog.artifactory-upload'
|
|
|
|
group = 'com.sk89q.worldguard'
|
|
version = '7.0.0-SNAPSHOT'
|
|
ext.internalVersion = version + ";" + gitCommitHash
|
|
|
|
sourceCompatibility = 1.8
|
|
targetCompatibility = 1.8
|
|
|
|
checkstyle.configFile = new File(rootProject.projectDir, "config/checkstyle/checkstyle.xml")
|
|
|
|
repositories {
|
|
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
|
|
}
|
|
|
|
build.dependsOn(checkstyleMain)
|
|
build.dependsOn(checkstyleTest)
|
|
build.dependsOn(sourcesJar)
|
|
build.dependsOn(javadocJar)
|
|
|
|
shadowJar {
|
|
classifier 'dist'
|
|
dependencies {
|
|
include(dependency('org.khelekore:prtree:1.5.0'))
|
|
}
|
|
exclude 'GradleStart**'
|
|
exclude '.cache'
|
|
exclude 'LICENSE*'
|
|
}
|
|
|
|
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
|
|
|
|
}
|
|
}
|
|
|
|
resolve {
|
|
repository {
|
|
repoKey = 'repo'
|
|
username = "${artifactory_user}"
|
|
password = "${artifactory_password}"
|
|
maven = true
|
|
}
|
|
}
|
|
}
|
|
}
|