-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
148 lines (119 loc) · 4.36 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
import com.bmuschko.gradle.cargo.convention.Deployable
import com.bmuschko.gradle.cargo.tasks.remote.CargoRedeployRemote
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.bmuschko:gradle-cargo-plugin:2.9.0'
}
}
plugins {
id 'java'
id 'war'
id('cz.habarta.typescript-generator') version '3.2.1263'
}
apply plugin: 'com.bmuschko.cargo-base'
compileJava.options.encoding = 'UTF-8'
java {
sourceCompatibility = JavaVersion.VERSION_21
}
group 'uk.ac.hutton.ics.gridscore'
version '3.2.0'
repositories {
maven {
url 'https://repo.osgeo.org/repository/release/'
}
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
implementation 'org.json:json:20220320'
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'mysql:mysql-connector-java:8.0.29'
implementation 'org.jooq:jooq:3.16.18'
implementation 'org.jooq:jooq-codegen:3.16.18'
implementation 'commons-io:commons-io:2.11.0'
implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'javax.activation:activation:1.1.1'
implementation 'org.glassfish.jaxb:jaxb-runtime:4.0.2'
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.0'
providedCompile 'jakarta.servlet:jakarta.servlet-api:6.0.0'
implementation 'org.glassfish.jersey.containers:jersey-container-servlet:3.1.3'
implementation 'org.glassfish.jersey.inject:jersey-hk2:3.1.3'
implementation 'org.glassfish.jersey.media:jersey-media-json-jackson:3.1.3'
implementation 'org.glassfish.jersey.media:jersey-media-multipart:3.1.3'
implementation 'org.apache.poi:poi-ooxml:5.2.2'
implementation 'org.flywaydb:flyway-core:6.5.7'
implementation 'javax.media:jai_core:1.1.3'
implementation 'org.geotools:gt-shapefile:22.2'
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
implementation 'net.logicsquad:nanocaptcha:1.3'
}
jar {
manifest {
attributes 'Implementation-Title': 'GridScore',
'Implementation-Version': archiveVersion
}
}
// Generate a .war file
war {
dependsOn jar
rootSpec.exclude('**/jhi/**/*.class')
rootSpec.includeEmptyDirs = false
// Include external .jar files, but exclude the Germinate client and core.
classpath fileTree(dir:'build/libs/', include:'*.jar')
// Set the classpath
manifest {
attributes 'Class-Path': configurations.runtimeClasspath.files.collect { it.getName() }.join(' '),
'Implementation-Title': 'GridScore',
'Implementation-Version': archiveVersion
}
webInf {
// Include the .properties file into the classes folder
from(project.projectDir.toString()) {
include 'config.properties'
include 'logging.properties'
into('classes')
}
}
// Include the client code if it's available
from("${project.projectDir.toString()}/client") {
include '**/**.*'
into('/')
}
}
// Runs the JOOQ code generation
task codegen (type: JavaExec) {
group = 'Execution'
classpath = sourceSets.main.runtimeClasspath
mainClass = 'org.jooq.codegen.GenerationTool'
args 'jooq.xml'
}
// Deploy the created .war file to Tomcat
task deployTomcat (type: CargoRedeployRemote) {
dependsOn = [war]
containerId = project.findProperty('tomcat.manager.version') ?: "tomcat10x"
protocol = project.findProperty('tomcat.manager.protocol') ?: "http"
hostname = project.findProperty('tomcat.manager.hostname') ?: "localhost"
port = (project.findProperty('tomcat.manager.port') ?: "8080") as Integer
username = project.findProperty('tomcat.manager.username') ?: ""
password = project.findProperty('tomcat.manager.password') ?: ""
deployables = [new Deployable(files: project.files([war.archiveFile]), context: "${project.'project.name'}/v${project.version}")]
}
generateTypeScript {
jsonLibrary = 'jackson2'
classes = ['jhi.gridscore.server.pojo.Trial']
outputKind = 'module'
outputFile = 'gridscore.ts'
outputFileType = 'implementationFile'
generateConstructors = true
mapClasses = 'asClasses'
mapEnum = 'asEnum'
stringQuotes = 'singleQuotes'
}
test {
useJUnitPlatform()
}