-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
105 lines (94 loc) · 2.9 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
plugins {
id "java"
id "com.github.johnrengelman.shadow" version "6.1.0"
id 'maven-publish'
id "io.freefair.lombok" version "6.1.0"
}
group 'net.grandtheftmc'
version '2.0.0'
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"
// make sure maven creds are set
def mavenUser
def mavenPassword
if (!project.hasProperty("mavenUser") || !project.hasProperty("mavenPassword")) {
if (System.getenv("MAVEN_REPO_USER") != null && System.getenv("MAVEN_REPO_PASS")) {
mavenUser = System.getenv("MAVEN_REPO_USER")
mavenPassword = System.getenv("MAVEN_REPO_PASS")
}
else {
logger.error("Unable to access the GTM Repositories. No credentials were found. You must either:")
logger.error(" - Define a 'mavenUser' and 'mavenPassword' property in your ~/.gradle/gradle.properties")
logger.error(" - Set a system variable for 'MAVEN_REPO_USER' and 'MAVEN_REPO_PASS'")
throw new GradleException('Unable to access the GTM Repositories. No credentials were found. You must either:\n' +
' - Define a \'mavenUser\' and \'mavenPassword\' property in your ~/.gradle/gradle.properties\n' +
' - Set a system variable for \'MAVEN_REPO_USER\' and \'MAVEN_REPO_PASS\''
)
}
} else {
mavenUser = project.property("mavenUser")
mavenPassword = project.property("mavenPassword")
}
repositories {
maven {
url 'https://nexus.grandtheftmc.net/content/repositories/releases/'
credentials {
username mavenUser
password mavenPassword
}
}
mavenCentral()
maven {
url 'https://jitpack.io'
}
maven {
url 'https://mvnrepository.com/artifact/org.json/'
}
maven {
url 'https://m2.dv8tion.net/releases'
}
maven {
url 'https://mvnrepository.com/artifact/jfree/jfreechart'
}
maven {
url 'https://mvnrepository.com/artifact/com.github.ooxi/serialized-php-parser'
}
}
dependencies {
compileOnly ('net.grandtheftmc:discordbotlib:1.0.6') {
changing = true
}
}
shadowJar {
archiveFileName = project.name + ".jar"
destinationDirectory = file("build")
}
jar {
manifest {
attributes 'Main-Class': 'net.grandtheftmc.discordbot.GTMBot'
attributes 'Class-Path': 'DiscordBotLib.jar'
}
}
// Force character encoding in case the workspace was not set up correctly
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}
publishing {
publications {
maven(MavenPublication) {
artifactId = 'discordbot'
from components.java
}
}
repositories {
maven {
url 'https://nexus.grandtheftmc.net/content/repositories/releases/'
credentials {
username mavenUser
password mavenPassword
}
}
}
}