forked from Sitrica/Japson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
109 lines (89 loc) · 2.84 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
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'com.github.johnrengelman.shadow' version '5.2.0'
id 'maven-publish'
id 'eclipse'
id 'java'
}
jar.archiveName = project.name + '.jar'
// Add SNAPSHOT to make this publish as a beta.
version '1.1.3'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
// Google Flogger
shadow (group: 'com.google.flogger', name: 'flogger-system-backend', version: '0.5.1')
shadow (group: 'com.google.flogger', name: 'flogger', version: '0.5.1')
// Google Gson
shadow (group: 'com.google.code.gson', name: 'gson', version: '2.8.6')
// Google Guava
shadow (group: 'com.google.guava', name: 'guava', version: '29.0-jre')
// JUnit
testRuntimeOnly (group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.6.0')
testImplementation (group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.6.0')
testImplementation (group: 'com.google.code.gson', name: 'gson', version: '2.8.6')
testImplementation (group: 'com.google.guava', name: 'guava', version: '29.0-jre')
testImplementation (group: 'com.google.flogger', name: 'flogger-system-backend', version: '0.5.1')
testImplementation (group: 'com.google.flogger', name: 'flogger', version: '0.5.1')
}
publishing {
repositories {
maven {
name = "Japson"
url = uri("https://maven.pkg.github.com/Sitrica/Japson")
credentials {
username = 'Sitrica'
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_PACKAGES_KEY")
}
}
}
publications {
shadow(MavenPublication) {publication ->
project.shadow.component(publication)
version = version
groupId = 'com.sitrica'
def releases = 'japson' // Don't modify
def snapshots = 'japson-beta' // Don't modify
artifactId = version.endsWith('SNAPSHOT') ? snapshots : releases
}
}
}
processResources {
filter ReplaceTokens, tokens: ["version": version]
from (sourceSets.main.resources.srcDirs) {
include '*.yml'
}
}
shadowJar {
configurations = [project.configurations.shadow]
archiveVersion = version
baseName = project.name
classifier = ''
relocate 'com.google.gson', 'com.sitrica.japson.gson'
minimize {
exclude(dependency('com.google.flogger:'))
}
dependencies {
exclude(dependency('org.spigotmc:'))
exclude(dependency('org.yaml:'))
exclude(dependency('io.netty:'))
}
}
test {
useJUnitPlatform()
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = true
// set heap size for the test JVM(s)
minHeapSize = "128m"
maxHeapSize = "512m"
// listen to events in the test execution lifecycle
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
// listen to standard out and standard error of the test JVM(s)
onOutput { descriptor, event ->
logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message )
}
}