forked from ishland/Hotpur
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
105 lines (87 loc) · 2.64 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
* This file was generated by the Gradle 'init' task.
*/
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:6.1.0'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.3'
classpath 'com.github.jengelman.gradle.plugins:shadow:6.1.0'
}
}
apply plugin: "com.palantir.git-version"
version = 'dev-SNAPSHOT'
def details = versionDetails()
def branchName = details.branchName
def distance = details.commitDistance
def hash = details.gitHash
if(System.getenv("GITHUB_ACTIONS") == "true") {
println("Github Actions detected, filling branch information")
branchName = System.getenv("GITHUB_REF").substring("refs/heads/".length())
}
else if(System.getenv("JENKINS_URL")) {
println("Jenkins Environment detected, filling branch information")
branchName = System.getenv("GIT_BRANCH").substring("origin/".length())
}
ext.implementationVersion = "git-Hotpur-${branchName}_${distance}_${hash}"
println("Git Describe: ${ext.implementationVersion}")
allprojects {
group = 'com.ishland.hotpur'
}
configure (subprojects - project(":fabric-loader")) {
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
version = project.project_version
repositories {
mavenLocal()
maven {
url = uri('https://repo.aikar.co/content/groups/aikar/')
}
maven {
url = uri('https://nexus.velocitypowered.com/repository/velocity-artifacts-snapshots/')
}
maven {
url = uri('https://repo.maven.apache.org/maven2')
}
maven {
url = uri('https://hub.spigotmc.org/nexus/content/groups/public/')
}
maven {
url = uri('https://oss.sonatype.org/content/groups/public/')
}
maven {
url = uri('https://libraries.minecraft.net')
}
}
dependencies {
testImplementation 'junit:junit:4.13.1'
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
publishing {
publications {
maven(MavenPublication) {
from(components.java)
}
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
test {
useJUnit()
maxParallelForks = 1
testLogging {
events "failed", "standard_out", "standard_error"
showStackTraces true
exceptionFormat "full"
}
workingDir = project.buildDir
}
}