-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.in
84 lines (78 loc) · 2.92 KB
/
build.gradle.in
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
// Gradle configuration for Ripple -*- mode: groovy -*-
// :TODO: bundle and install vorbisspi JAR
plugins { id "java-library"; id "war" }
repositories { mavenCentral() }
sourceSets {
application {
java {
srcDirs = ["@srcdir@/source", "source"]
exclude "servlet"
}
}
servlet { java { srcDirs = ["@srcdir@/source/servlet"] } }
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
applicationRuntime("com.googlecode.soundlibs:vorbisspi:1.0.3.3")
//servletCompileOnly("jakarta.platform:jakarta.jakartaee-web-api:8.0.0")
servletCompileOnly("javax.servlet:javax.servlet-api:4.0.1")
servletRuntime("org.xerial:sqlite-jdbc:3.40.1.0")
servletCompile(
"com.fasterxml.jackson.core:jackson-core:2.13.0")
servletCompile(
"com.fasterxml.jackson.core:jackson-databind:2.13.0")
servletCompile(
"com.fasterxml.jackson.core:jackson-annotations:2.13.0")
}
task generateClassList {
dependsOn compileApplicationJava
doLast {
def sourceSet = sourceSets.application
def outputFile = file("$projectDir/build/.classes")
outputFile.text = ""
sourceSet.output.classesDirs.each { dir ->
dir.eachFileRecurse { classFile ->
if (classFile.isFile() &&
classFile.name.endsWith('.class') &&
!classFile.name.contains('$')) {
def className = classFile.absolutePath
.replaceAll("^$dir", '').replaceAll("^/", '')
.replaceAll('\\\\', '/')
.replaceAll('\\.class$', '')
.replaceAll('/', '.')
outputFile.append("$className\n")
}
}
}
}
}
jar {
archiveName = "@PACKAGE@-@[email protected]"
dependsOn generateClassList
from(sourceSets.application.output)
from("@srcdir@/apps/images") { into "images" }
from("@srcdir@/apps/fonts") { into "fonts" }
from("@srcdir@/apps/sounds") { into "sounds" }
from("$projectDir/build/.classes")
manifest { from("@srcdir@/META-INF/MANIFEST.MF") }
}
war {
archiveName = "@PACKAGE@-@[email protected]"
dependsOn generateClassList
classpath(configurations.servletCompile,
configurations.servletRuntime)
webXml = file "@srcdir@/WEB-INF/web.xml"
into("WEB-INF") { from("@srcdir@/WEB-INF/jetty-env.xml") }
into("WEB-INF/classes") { from sourceSets.servlet.output }
from(sourceSets.application.output)
from("@srcdir@/apps")
from("$buildDir/.classes")
manifest { attributes(
"Application-Name": "Ripple",
"Main-Class": "net.antimeme.ripple.Ripple",
"Permissions": "sandbox",
"Implementation-Title": "Ripple Web Application",
"Implementation-Version": "@VERSION@",
"Implementation-Vendor": "@PACKAGE@@antimeme.net" ) }
}