-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.gradle
158 lines (130 loc) · 4.12 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
apply plugin: "java-library"
buildscript{
repositories {
jcenter()
}
dependencies{
}
}
apply plugin: 'maven-publish'
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceSets.main.java.srcDirs = [ "src/" ]
sourceSets.main.resources.srcDirs = [ "res/",
"libs/linux32", "libs/linux64",
"libs/macosx32", "libs/macosx64",
"libs/windows32", "libs/windows64",]
sourceSets.test.java.srcDirs = [ ]
sourceSets.test.resources.srcDirs = [ ]
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
dependencies {
compile "com.badlogicgames.gdx:gdx-jnigen:1.9.10"
api "com.badlogicgames.gdx:gdx:1.9.9"
api "com.badlogicgames.gdx:gdx-controllers:1.9.9"
}
task deleteJniFolder(type: Delete) {
delete "jni"
delete "docs"
}
clean.dependsOn(deleteJniFolder)
task runTester(dependsOn: classes, type: JavaExec) {
main = 'uk.co.electronstudio.sdl2gdx.tests.SDLTest'
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
}
task linuxNatives(dependsOn: classes, type: JavaExec) {
main = 'uk.co.electronstudio.sdl2gdx.NativesBuild'
args = ['build-linux', 'system-SDL2']
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
}
task windowsNatives(dependsOn: classes, type: JavaExec) {
main = 'uk.co.electronstudio.sdl2gdx.NativesBuild'
args = ['build-windows', 'system-SDL2']
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
}
task OSXNatives(dependsOn: classes, type: JavaExec) {
main = 'uk.co.electronstudio.sdl2gdx.NativesBuild'
args = ['build-OSX', 'system-SDL2']
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
}
task allNatives(dependsOn: classes, type: JavaExec) {
main = 'uk.co.electronstudio.sdl2gdx.NativesBuild'
args = ['build-linux', 'build-windows', 'build-OSX']
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
}
task uberjar(dependsOn: classes, type: Jar) {
from files(sourceSets.main.output.classesDir)
from files(sourceSets.main.output.resourcesDir)
from {configurations.compile.collect {zipTree(it)}}
manifest {
attributes 'Main-Class': 'uk.co.electronstudio.sdl2gdx.tests.SDLTest'
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
javadoc {
exclude 'com/badlogic/**'
destinationDir = new File('docs')
options.overview = "overview.html"
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
def pomConfig = {
licenses {
license {
name "GPLv3 with Classpath Exception"
url "https://www.gnu.org/software/classpath/license.html"
distribution "repo"
}
}
developers {
developer {
id "electronstudio"
name "Electron Studio"
email "support@electronstudio.co.uk"
}
}
scm {
url "https://github.com/electronstudio/"
}
}
publishing {
publications {
mavenPublication(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
groupId 'uk.co.electronstudio.sdl2gdx'
artifactId 'sdl2gdx'
version '1.0.4'
pom.withXml {
def root = asNode()
root.appendNode('description', 'LibGDX extension library')
root.appendNode('name', 'sdl2gdx')
root.appendNode('url', 'https://github.com/electronstudio/sdl2gdx')
root.children().last() + pomConfig
}
}
}
publish.dependsOn jar, sourcesJar, javadocJar//, generatePomFileForMavenPublicationPublication
}