forked from mung3r/MyWarp
-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.gradle
83 lines (68 loc) · 2.37 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
plugins {
id "com.palantir.git-version" version "0.13.0"
}
// build configuration
if (hasProperty('buildScan')) {
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
}
ext.resolveProperty = { key, defaultValue = "unknown" ->
return project.findProperty(key) ?: System.getenv(key) ?: defaultValue
}
// define variables
ext.buildNumber = resolveProperty("BUILD_NUMBER")
ext.ciSystem = resolveProperty("CI_SYSTEM").replaceAll(" ", "_")
ext.commitHash = resolveProperty("COMMIT_HASH", versionDetails().gitHash)
allprojects {
group = "io.github.mywarp.mywarp"
version = "3.1.3-SNAPSHOT"
// general project information
ext.projectName = "MyWarp"
ext.internalVersion = "${version}+${ciSystem}-b${buildNumber}.git-${commitHash}"
ext.url = "https://mywarp.github.io/"
ext.inceptionYear = "2011"
ext.projectDescription = "An extension for Minecraft that allows players to create and share warps."
}
apply from: "${rootProject.projectDir}/gradle/publishOnGithub.gradle"
subprojects {
apply plugin: "java"
apply plugin: "checkstyle"
apply from: "${rootProject.projectDir}/gradle/i18n.gradle"
sourceCompatibility = 8
targetCompatibility = 8
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
jar {
from new File(rootProject.projectDir, "LICENSE.txt")
manifest.mainAttributes(
"Built-By": System.properties["user.name"],
"Created-By": System.properties["java.vm.version"] + " (" + System.properties["java.vm.vendor"] + ")",
"Implementation-Title": name,
"Implementation-Version": internalVersion,
"Implementation-Vendor": url)
}
javadoc {
options.setEncoding("UTF-8")
if (JavaVersion.current().isJava8Compatible()) {
// disable the super-strict doclint tool in Java 8
options.addStringOption("Xdoclint:none", "-quiet")
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = "sources"
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = "javadoc"
from javadoc.destinationDir
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
}