-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
156 lines (127 loc) · 4.29 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.8.0'
id 'application'
id 'maven-publish'
id 'checkstyle'
id "com.github.johnrengelman.shadow" version "7.1.2"
}
group 'org.hydev.mcpm'
version '1.0.0.788'
application {
mainClass = 'org.hydev.mcpm.client.arguments.ArgsParser'
}
repositories {
mavenCentral()
// Spigot MC
maven {
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
content {
includeGroup 'org.bukkit'
includeGroup 'org.spigotmc'
}
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
checkstyle {
// assign the latest checkstyle version explicitly, since the default version is very old
toolVersion = '10.3.4'
configFile = rootProject.file('.github/checkstyle.xml')
ignoreFailures = false
maxWarnings = 5
}
task checkStyle(type: GradleBuild) {
tasks = ['checkStyleMain', 'checkStyleTest']
}
dependencies {
// The Spigot API with no shadowing. Requires the OSS repo.
compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT'
testImplementation 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT'
// Argument parser
// https://mvnrepository.com/artifact/net.sourceforge.argparse4j/argparse4j
implementation 'net.sourceforge.argparse4j:argparse4j:0.9.0'
// Apache HTTP Client
// https://mvnrepository.com/artifact/org.apache.httpcomponents.client5/httpclient5-fluent
implementation 'org.apache.httpcomponents.client5:httpclient5-fluent:5.2-beta1'
// Json/YAML parser: Jackson
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core
implementation 'com.fasterxml.jackson.core:jackson-core:2.14.0'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.0'
// General utilities
// https://mvnrepository.com/artifact/com.google.guava/guava
implementation 'com.google.guava:guava:31.1-jre'
// IDE annotations
// https://mvnrepository.com/artifact/org.jetbrains/annotations
implementation 'org.jetbrains:annotations:23.0.0'
// Terminal Hacks
// https://mvnrepository.com/artifact/org.fusesource.jansi/jansi
implementation 'org.fusesource.jansi:jansi:2.4.0'
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
implementation 'org.apache.commons:commons-lang3:3.12.0'
// ZSTD Compression
// https://mvnrepository.com/artifact/com.github.luben/zstd-jni
implementation 'com.github.luben:zstd-jni:1.5.2-5'
// ZSTD but pure java for platforms that doesn't support native
// https://mvnrepository.com/artifact/io.airlift/aircompressor
implementation 'io.airlift:aircompressor:0.21'
// https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.8.0'
// Unit tests
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
testRuntimeOnly 'org.slf4j:slf4j-simple:2.0.4'
}
processResources {
from(sourceSets.main.resources.srcDirs) {
filter ReplaceTokens, tokens: [version: version]
}
duplicatesStrategy = 'include'
}
publishing {
repositories {
maven {
name = "github"
url = "https://maven.pkg.github.com/CSC207-2022F-UofT/mcpm"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
register("jar", MavenPublication) {
from(components["java"])
pom {
url.set("https://github.com/CSC207-2022F-UofT/mcpm.git")
}
}
}
}
if (hasProperty('buildScan')) {
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
}
sourceSets {
test {
resources {
srcDir "test"
}
}
}
task printCp {
doLast {
System.err.println sourceSets.test.runtimeClasspath.asPath
}
}
test {
useJUnitPlatform()
testLogging.showStandardStreams = true
}