-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
156 lines (132 loc) · 4.67 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
defaultTasks 'clean', 'build', 'allJar'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
}
}
apply plugin: 'idea'
apply plugin: 'eclipse'
ext.projectName = 'SpongeRecording'
ext.packaging = 'jar'
ext.author = 'johni0702'
ext.authorUrl = 'https://github.com/johni0702'
ext.inceptionYear = '2015'
ext.apiVersion = '1.0.0-SNAPSHOT'
ext.implVersion = '0.1.0-SNAPSHOT'
ext.spongeapi = 'org.spongepowered:spongeapi:2.1-SNAPSHOT'
ext.platforms = ['spongecommon']
project(':spongerecording-api').version = apiVersion
(['core'] + platforms).each {
project(":spongerecording-$it").version = implVersion
}
(['api', 'core', 'example'] + platforms).each {
project(':spongerecording-' + it) {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'license'
apply plugin: 'idea'
apply plugin: 'eclipse'
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'com.replaymod.sponge'
ext.url = rootProject.authorUrl
license {
ext.name = rootProject.projectName
ext.author = rootProject.author
ext.url = rootProject.authorUrl
ext.year = rootProject.inceptionYear
header new File(rootProject.getProjectDir(), 'HEADER.txt')
sourceSets = project.sourceSets
ignoreFailures false
strictCheck true
mapping {
java = 'SLASHSTAR_STYLE'
}
}
repositories {
mavenCentral()
maven {
name 'Sponge maven repo'
url 'http://repo.spongepowered.org/maven'
}
maven {
// Artifacts we require are mirrored due to the lack of SNI support in gradle
name 'spacehq mirror repo'
url 'http://repo.johni0702.de/content/repositories/spacehq/'
}
}
configurations {
provided
compile.extendsFrom provided
}
jar {
dependsOn configurations.runtime
from {
(configurations.runtime - configurations.provided).collect {
it.isDirectory() ? it : zipTree(it)
}
}
manifest {
attributes "Built-By": System.properties['user.name'],
"Created-By": System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")"
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = "javadoc"
from javadoc.destinationDir
}
processResources {
from new File(rootProject.getProjectDir(), 'LICENSE')
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
build.dependsOn(sourcesJar)
build.dependsOn(javadocJar)
uploadArchives {
repositories {
mavenDeployer {
// mavenUrl has to be set in your {userfolder}/.gradle/gradle.properties file
if (project.hasProperty("mavenUrl")) {
repository(url: mavenUrl)
}
pom {
groupId = project.group
artifactId = project.name
version = project.version
}
}
}
}
dependencies {
provided 'org.spongepowered:spongeapi:2.1-SNAPSHOT'
testCompile group: 'junit', name: 'junit', version: '4.11'
testCompile 'org.mockito:mockito-core:1.10.19'
}
}
}
apply plugin: 'base'
task allJar(type: Jar, dependsOn: (['core'] + platforms).collect {project(":spongerecording-$it").tasks['build']}) {
(['core'] + platforms).each {
from project(":spongerecording-$it").tasks.jar.outputs.files.collect {zipTree(it)}
}
manifest {
attributes "Built-By": System.properties['user.name'],
"Created-By": System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
'Specification-Title': 'SpongeRecordingApi',
'Specification-Version': apiVersion,
'Specification-Vendor': authorUrl,
'Implementation-Title': 'SpongeRecording',
'Implementation-Version': implVersion,
'Implementation-Vendor': authorUrl
}
}