-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
163 lines (122 loc) · 5.25 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
// gradle version 7.0.2, in eclipse gradle version 7.0.1
plugins {
id "com.github.ben-manes.versions" version "0.42.0" // fails on 0.43.0 and 0.44.0 (Gradle 7.0 needed) update check task: dependencyUpdates https://github.com/ben-manes/gradle-versions-plugin
}
/*
check for updates:
gradle dependencyUpdates
or
./gradlew dependencyUpdates
*/
/*
list (transitive) dependencies
gradle dependencies
or
./gradlew dependencies
*/
// upgrade gradle wrapper
//./gradlew wrapper --gradle-version=7.0.2
def isNonStable = { String version ->
return version.contains('alpha') || version.contains('beta')
}
dependencyUpdates {
rejectVersionIf { // reject all non stable versions
isNonStable(it.candidate.version)
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
compileJava.options.encoding = 'UTF-8'
repositories {
mavenCentral()
/* server not always reachable
maven { // needed for compile group: 'com.github.aelstad', name: 'keccakj', version: '1.1.0'
url 'https://repository.mulesoft.org/nexus/content/repositories/public'
}*/
flatDir { // local jar files
dirs 'lib'
}
}
dependencies {
implementation group: 'org.tinylog', name: 'tinylog-impl', version: '2.7.0'
runtimeOnly group: 'org.tinylog', name: 'slf4j-tinylog', version: '2.7.0'
implementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '11.0.24' // v12.x not compatible with Java 11
implementation group: 'org.eclipse.jetty', name: 'jetty-security', version: '11.0.24'
implementation group: 'org.eclipse.jetty.http2', name: 'http2-server', version: '11.0.24'
implementation group: 'org.eclipse.jetty', name: 'jetty-alpn-java-server', version: '11.0.24'
implementation group: 'org.json', name: 'json', version: '20240303'
implementation group: 'org.yaml', name: 'snakeyaml', version: '1.33' // TODO: check compatibility with newer version 2.x
implementation group: 'de.siegmar', name: 'fastcsv', version: '3.3.1'
implementation group: 'com.opencsv', name: 'opencsv', version: '5.9'
implementation group: 'ch.randelshofer', name: 'fastdoubleparser', version: '1.0.1'
implementation group: 'com.github.wendykierp', name: 'JTransforms', version: '3.1'
implementation group: 'com.samskivert', name: 'jmustache', version: '1.16'
//implementation group: 'com.github.aelstad', name: 'keccakj', version: '1.1.0' // server not always reachable
implementation name: 'keccakj-1.1.0' // local jar file
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.5' // breaking changes in 0.12.x
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.5'
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.5'
implementation group: 'com.webauthn4j', name: 'webauthn4j-core', version: '0.25.0.RELEASE'
implementation group: 'ar.com.hjg', name: 'pngj', version: '2.1.0'
implementation group: 'org.imgscalr', name: 'imgscalr-lib', version: '4.2'
implementation group: 'com.drewnoakes', name: 'metadata-extractor', version: '2.19.0'
implementation group: 'com.h2database', name: 'h2', version: '2.3.232' // old database v2.1.x files not compatible with v2.2.x
implementation group: 'org.reflections', name: 'reflections', version: '0.10.2'
implementation group: 'org.lz4', name: 'lz4-java', version: '1.8.0' // needed for xxHash
//implementation group: 'fr.delthas', name: 'javamp3', version: '1.0.1' // version with IndexOutOfBoundsException bug
implementation name: 'javamp3-1.0.4' // local jar file from https://github.com/kevinstadler/JavaMP3
//implementation group: 'net.jthink', name: 'jaudiotagger', version: '3.0.1'
implementation name: 'flac-library-java-2022-09-12' // local jar file derived from https://github.com/nayuki/FLAC-library-Java
}
sourceSets.main.java.srcDir 'src'
sourceSets.main.java.srcDir 'src_qoa'
jar {
from file('src/tinylog.properties')
destinationDirectory = project.layout.projectDirectory.dir('package')
manifest {
String classPathFiles = "";
for(java.io.File file : files(configurations.runtimeClasspath)) {
classPathFiles += "lib/"+file.getName()+" ";
}
//println("the class path: "+classPathFiles);
attributes 'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Main-Class': 'run.Terminal',
'Class-Path': classPathFiles
}
}
compileJava {
sourceCompatibility = 11
targetCompatibility = 11
}
tasks.withType(JavaCompile){
//options.deprecation = true
//options.listFiles = true
//options.verbose = true
}
task clean_package(type: Delete) {
delete 'package'
}
task copy_lib(type: Copy) {
from files(configurations.runtimeClasspath)
into 'package/lib'
}
task copy_add(type: Copy) {
from fileTree('add')
into 'package'
}
task copy_webcontent(type: Copy) {
from fileTree('webcontent')
into 'package/webcontent'
}
task copy_mustache(type: Copy) {
from fileTree('mustache')
into 'package/mustache'
}
task copy_build(type: Copy, dependsOn: [jar]) {
from fileTree('build/libs')
into 'package'
}
task _package(dependsOn:[ clean_package, copy_build, copy_lib, copy_webcontent, copy_mustache, copy_add ]) {
group = 'project'
}