This repository has been archived by the owner on Nov 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
108 lines (86 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
plugins {
id 'idea'
id 'eclipse'
id 'com.github.hierynomus.license' version '0.12.1'
id 'ninja.miserable.blossom' version '1.0.1'
// id 'maven'
id 'com.github.johnrengelman.shadow' version '2.0.0'
id 'java'
id 'org.spongepowered.plugin' version '0.9.0'
}
apply plugin: 'java'
apply plugin: 'signing'
defaultTasks 'licenseFormat build'
group = pluginGroup
version = pluginVersion
def minecraftversion = '1.12.2'
def geoIp = 'com.maxmind.geoip2:geoip2:2.12.0'
def spongeApi = 'org.spongepowered:spongeapi:7.1.0'
dependencies {
compile spongeApi
// For Geo IP
compile geoIp
testCompile "junit:junit:4.12"
testCompile "org.mockito:mockito-all:1.10.19"
testCompile "org.powermock:powermock-module-junit4:1.6.4"
testCompile "org.powermock:powermock-api-mockito:1.6.4"
testCompile "org.hamcrest:hamcrest-junit:2.0.0.0"
}
license {
ext.name = "heisenberg"
exclude "**/*.info"
exclude "assets/**"
exclude "*.properties"
exclude "*.txt"
header file('HEADER.txt')
sourceSets = project.sourceSets
ignoreFailures false
strictCheck true
mapping {
java = 'SLASHSTAR_STYLE'
}
}
blossom {
replaceTokenIn('src/main/java/io/github/nucleuspowered/nucleusheisenberg/PluginInfo.java')
replaceToken '@name@', "Nucleus Heisenberg"
replaceToken '@version@', version
}
jar {
manifest {
attributes 'Implementation-Title': "Nucleus Heisenberg", 'SpongeAPI-Version': spongeApi
}
}
sponge.plugin.id = pluginId
shadowJar {
dependencies {
include(dependency(geoIp))
include(dependency("com.maxmind.db:maxmind-db"))
include(dependency("com.fasterxml.jackson.core:jackson-core"))
include(dependency("com.fasterxml.jackson.core:jackson-databind"))
include(dependency("com.fasterxml.jackson.core:jackson-annotations"))
}
relocate 'com.maxmind.geoip2', 'io.github.nucleuspowered.heisenberg.relocate.com.maxmind.geoip2'
relocate 'com.maxmind.db', 'io.github.nucleuspowered.heisenberg.relocate.com.maxmind.db'
relocate 'com.fasterxml.jackson', 'io.github.nucleuspowered.heisenberg.relocate.com.fasterxml.jackson'
archiveName = "Heisenberg-${version}-MC${minecraftversion}.jar"
//shadowJar.archiveName = shadowName
// archiveName = "Nucleus-${version}-MC${project.ext.minecraftversion}-plugin.jar"
}
artifacts {
archives shadowJar
shadow shadowJar
}
signing {
required {
project.properties.hasProperty("signing.keyId")
}
if (project.properties.containsKey('gpg2')) {
useGpgCmd() // requires gpg2
}
// sign configurations.archives
// we want to add the signatures to this configuration too, as this
// is what we use to upload to Ore
configuration=configurations.shadow
sign configurations.shadow
}
signShadow.dependsOn(shadowJar).mustRunAfter(shadowJar)