-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
110 lines (98 loc) · 3.29 KB
/
build.gradle
File metadata and controls
110 lines (98 loc) · 3.29 KB
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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'idea'
id 'com.github.johnrengelman.shadow' version '5.2.0'
id 'org.jetbrains.kotlin.jvm' version "1.3.72"
}
apply plugin: 'base'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
group = project.property('pluginGroup')
version = project.property('version')
repositories {
mavenLocal()
mavenCentral()
maven {
name = 'spigotmc-repo'
url = 'https://hub.spigotmc.org/nexus/content/groups/public/'
}
maven {
name = 'CodeMC-Repo'
url 'http://repo.codemc.io/repository/maven-public'
}
maven { url 'https://jitpack.io' }
maven { url 'https://repo.bstats.org/content/repositories/releases' }
}
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.15.1-R0.1-SNAPSHOT'
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72'
// This lets us use the full ShatteredCore in the standalone.
compile group: 'com.github.ShatteredSuite', name: 'ShatteredCore', version: project.property('coreVersion'), classifier: 'dist'
compileOnly group: 'com.github.ShatteredSuite', name: 'ShatteredCore', version: project.property('coreVersion'), classifier: 'api'
}
artifacts {
archives shadowJar
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
// Calculates the git hash and adds it to the version.
task getHash {
def p1 = 'git rev-parse --short HEAD'.execute()
p1.waitFor()
getHash.ext.hash = p1.text
}
// Replaces placeholders in plugin.yml
processResources {
dependsOn getHash
def hash = getHash.hash
with copySpec{
from 'src/main/resources'
filter(ReplaceTokens, tokens: [description: project.property('description'),
projectName: project.property('projectName'),
pluginName : project.property('pluginName'),
version : project.version + ' (' + hash.trim() + ')'])
}
}
// Creates a jar that includes dependencies, for use on servers.
task distJar(type: ShadowJar) {
from sourceSets.main.output
dependencies {
exclude(dependency(".*:.*")) // Comment this line out and fill in the next line:
// include()
}
classifier = 'dist'
configurations = [project.configurations.runtime]
}
task allJars() {
dependsOn distJar, jar, javadocJar, sourcesJar
}
// Allows for publication to maven.
publishing {
publications {
maven(MavenPublication) {
artifactId = project.property("projectName")
artifact javadocJar
artifact sourcesJar
artifact distJar
artifact jar
pom {
name = project.property("projectName")
description = project.property('description')
url = 'https://github.com/ShatteredSuite/' + project.property("pluginName")
developers {
developer {
id = 'UberPilot'
name = 'UberPilot'
email = 'uberpilot99@gmail.com'
}
}
}
}
}
}