forked from hsyyid/EssentialCmds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
122 lines (102 loc) · 2.88 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
buildscript {
repositories {
jcenter()
maven {
name = 'forge'
url = 'http://files.minecraftforge.net/maven'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
}
}
plugins {
id 'java'
id 'eclipse'
id 'idea'
id 'maven'
id "com.github.hierynomus.license" version "0.12.1"
id 'net.ellune.blossom' version '1.0.1'
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'net.ellune.blossom'
defaultTasks 'licenseFormat'
group = "io.github.hsyyid"
archivesBaseName = "EssentialCmds"
version = '8.1.14'
minecraft {
version = "1.10.2-12.18.0.2006-1.10.0"
runDir = "run"
mappings = "snapshot_20160518"
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
jcenter()
maven {
url 'https://jitpack.io'
}
maven {
name 'Sponge maven repo'
url 'http://repo.spongepowered.org/maven'
}
}
configurations {
shade
compile.extendsFrom shade
}
dependencies {
compile "org.spongepowered:spongeapi:5.0.0-SNAPSHOT"
shade "com.github.Flibio:Updatifier:v1.4.0:api"
}
jar {
includeEmptyDirs = false
classifier = 'universal'
version = "${project.minecraft.version}-${project.version}"
configurations.shade.each { dep ->
from(project.zipTree(dep)){
exclude 'META-INF', 'META-INF/**'
exclude 'mcmod.info'
exclude 'LICENSE.txt'
}
}
}
uploadArchives {
repositories {
flatDir {
dirs 'repos'
}
}
}
license {
//the project name to use
ext.name = project.name
ext.owner = project.owner
ext.inceptionYear = project.inceptionYear
ext.currentYear = project.currentYear
//for usage of these values see this: https://github.com/hierynomus/license-gradle-plugin#variable-substitution
//files to exclude from formatting (anything that is a .info file and assets in this example)
exclude "**/*.info"
exclude "assets/**"
//the file that contains the header
header file('HEADER.txt')
//the source sets to apply the license to
//this should be enough for you, it covers all the projects source sets
sourceSets = project.sourceSets
ignoreFailures false
strictCheck true
//what style your comment should be
mapping {
//in this case it's the following: /* and then continuing with stars.
java = 'SLASHSTAR_STYLE'
}
}
def getGitHash() {
def process = 'git rev-parse --short HEAD'.execute()
process.waitFor()
return '-' + (process.exitValue() ? 'unknown' : process.text.trim())
}
blossom {
replaceToken '@project.version@', project.version, 'src/main/java/io/github/hsyyid/essentialcmds/PluginInfo.java'
replaceToken '@project.informativeVersion@', project.version + getGitHash(), 'src/main/java/io/github/hsyyid/essentialcmds/PluginInfo.java'
}