forked from vacante/VoxelTour
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
207 lines (184 loc) · 5.74 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
// Gradle dependencies
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "http://repository.jboss.org/nexus/content/groups/public/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.1'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.1.1'
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.10.0'
}
}
// Plugins
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'license'
apply plugin: 'checkstyle'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'maven-publish-auth'
apply plugin: 'signing'
apply plugin: 'com.github.johnrengelman.shadow'
defaultTasks 'clean', 'licenseFormat', 'check', 'build'
group 'com.voxelplugineering'
archivesBaseName = 'VoxelTour'
version '1.1.0-SNAPSHOT'
// Minimum version of Java required
sourceCompatibility = 1.6
targetCompatibility = 1.6
// Project dependencies
repositories {
mavenLocal()
mavenCentral()
maven {
url "http://vault.voxelmodpack.com/content/groups/public/"
}
maven {
url "http://repo.spongepowered.org/maven/"
}
}
dependencies {
compile 'com.google.guava:guava:18.0'
compile 'com.google.code.gson:gson:2.3'
compile 'org.spongepowered:spongeapi:2.1-SNAPSHOT'
testCompile 'junit:junit:4.11'
}
// Generates sources.jar
task sourceJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allSource
}
ext {
projectName = 'VoxelTour'
inceptionYear = '2015'
packaging = 'jar'
url = 'http://voxelplugineering.com/'
description = "Implementation of VoxelTour for Sponge"
organization = 'The VoxelPlugineering Team'
pomFile = file("${project.projectDir}/pom.xml")
buildNumber = project.hasProperty("buildNumber") ? buildNumber : '0'
ciSystem = project.hasProperty("ciSystem") ? ciSystem : 'unknown'
commit = project.hasProperty("commit") ? commit : 'unknown'
}
configurations {
pom
}
artifacts {
archives jar
archives sourceJar
}
def sonatypeUser = hasProperty('sonatypeUser') ? sonatypeUser : System.getenv('sonatypeUser')
def sonatypePassword = hasProperty('sonatypePassword') ? sonatypePassword : System.getenv('sonatypePassword')
// Vault
uploadArchives {
repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment ->
signing.signPom(deployment)
}
repository(id: 'tvpt-repo', url: "http://vault.voxelmodpack.com/content/repositories/releases") {
authentication(userName: sonatypeUser, password: sonatypePassword)
}
snapshotRepository(id: 'tvpt-repo', url: "http://vault.voxelmodpack.com/content/repositories/snapshots") {
authentication(userName: sonatypeUser, password: sonatypePassword)
}
pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
project {
name project.archivesBaseName
packaging 'jar'
description 'Implementation of VoxelTour for Sponge'
url 'http://voxelmodpack.com/'
scm {
url 'https://github.com/tvpt/VoxelTour'
connection 'git'
developerConnection 'git@github.com:tvpt/VoxelTour.git'
}
licenses {
license {
name 'The MIT License'
url 'http://opensource.org/licenses/MIT'
distribution 'repo'
}
}
developers {
developer {
id 'Deamon5550'
name 'Nick Conde'
email 'nick@budgiehouse.com'
}
}
}
}
}
}
signing {
required {
gradle.taskGraph.hasTask("uploadArchives")
}
sign configurations.archives
}
processResources {
from 'LICENSE'
}
license {
ext.name = project.name
ext.organization = project.organization
ext.url = project.url
ext.year = project.inceptionYear
exclude "**/*.info"
exclude "assets/**"
header file("LICENSE")
sourceSets = project.sourceSets
ignoreFailures false
strictCheck true
mapping {
java = 'SLASHSTAR_STYLE'
}
}
checkstyle {
configProperties = [
"name" : project.name,
"organization": project.organization,
"url" : project.url,
"year" : project.inceptionYear
]
configFile = file("checkstyle.xml")
}
jar {
manifest {
attributes(
"Implementation-Title": project.name,
"Implementation-Version": version + "+" + ciSystem + "-b" + buildNumber + ".git-" + commit,
"Built-By": System.properties['user.name'],
"Created-By": System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
"Implementation-Vendor": url
)
}
from ("${projectDir}") {
include('LICENSE', 'README.md')
}
}
configure([compileJava, compileTestJava]) {
options.compilerArgs += ['-Xlint:all', '-Xlint:-path']
options.deprecation = true
options.encoding = 'utf8'
}
shadowJar {
dependencies {
include(dependency('com.google.guava:guava:18.0'))
include(dependency('com.voxelplugineering:VoxelGunsmith:7.0.0-SNAPSHOT'))
include(dependency('com.thevoxelbox:VisualScripting:0.2.8-SNAPSHOT'))
include(dependency('com.google.code.gson:gson:2.3'))
}
}
build.dependsOn shadowJar