-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
206 lines (163 loc) · 7.79 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
// gradle version 7.0.2, in eclipse gradle version 7.0.1
plugins {
id 'org.kordamp.gradle.markdown' version '2.2.0' // https://github.com/aalmiray/markdown-gradle-plugin
id "com.github.ben-manes.versions" version '0.44.0' // update check task: dependencyUpdates https://github.com/ben-manes/gradle-versions-plugin
}
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = '11' // build compatiblity with java 11 and newer
targetCompatibility = '11' // run compatiblity with java 11 and newer
sourceSets.main.java.srcDir 'src'
//sourceSets.main.java.srcDir 'explorer_src' // optional explorer needs jfx
sourceSets.main.java.srcDir 'dsl/src_generated'
/*
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)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation group: 'org.tinylog', name: 'tinylog-impl', version: '2.7.0'
runtimeOnly group: 'org.tinylog', name: 'slf4j-tinylog', version: '2.7.0' // needed for jetty logger
implementation group: 'org.antlr', name: 'antlr4-runtime', version: '4.9.3' // warning: newer version 4.10 may be incompatible to generated DSL source files
implementation group: 'org.javassist', name: 'javassist', version: '3.30.2-GA'
implementation group: 'org.mapdb', name: 'mapdb', version: '1.0.9' // warning: newer versions v2 do break storage layout
implementation group: 'org.xerial.snappy', name: 'snappy-java', version: '1.1.10.7' // caution: newer versions may break storage layout (last tested 1.1.7.7)
implementation group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1'
implementation group: 'org.json', name: 'json', version: '20240303'
implementation group: 'org.yaml', name: 'snakeyaml', version: '2.2' //implementation group: 'org.yaml', name: 'snakeyaml', version: '1.33' // caution: newer versions may break compatibility
implementation group: 'com.opencsv', name: 'opencsv', version: '5.9'
implementation group: 'org.ini4j', name: 'ini4j', version: '0.5.4'
implementation group: 'ar.com.hjg', name: 'pngj', version: '2.1.0'
implementation group: 'com.github.luben', name: 'zstd-jni', version: '1.5.6-7' // caution: newer versions may break storage layout (last tested 1.4.5-6)
implementation group: 'me.lemire.integercompression', name: 'JavaFastPFOR', version: '0.1.12' // version 0.2.1 compiled to new class file version not compatible with java 11; caution: newer versions may break strorage layout
implementation group: 'ch.randelshofer', name: 'fastdoubleparser', version: '2.0.1'
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: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.5'
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.5'
runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.5'
implementation group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
implementation group: 'org.gdal', name: 'gdal', version: '2.2.0' // caution: newer versions may break compatibility
implementation group: 'org.influxdb', name: 'influxdb-java', version: '2.24'
implementation group: 'com.h2database', name: 'h2', version: '2.3.232'
}
dependencies {
//compile fileTree('lib') // include local libraries
//compileOnly files('/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/jfxrt.jar') //optional explorer needs jfx - dependency openjfx on ubuntu (openjdk does not include openjfx), correct path for at least OpenJDK 10
}
jar {
from file('src/tinylog.properties')
from file('src/command_descriptions.yaml') // terminal command descriptions
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': 'tsdb.run.Terminal',
'Class-Path': classPathFiles
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8' // set text encoding of java files to UTF-8
/*def v = JavaVersion.current()
if(v==JavaVersion.VERSION_1_1||v==JavaVersion.VERSION_1_2||v==JavaVersion.VERSION_1_3||v==JavaVersion.VERSION_1_4||v==JavaVersion.VERSION_1_5||v==JavaVersion.VERSION_1_6||v==JavaVersion.VERSION_1_7) {
throw new GradleException('java version 8 or newer needed for build')
}
if(v != JavaVersion.VERSION_1_8) { // java version is newer than java 8
logger.warn('WARNING: Building TubeDB with java newer than java 8 results in package that is not fully compatible with java 8 runtime.')
}*/
/*if(v != JavaVersion.VERSION_1_8) { // java version is newer than java 8 (java 9 with modules)
options.compilerArgs.addAll(["--add-exports", "javafx.base/com.sun.javafx.binding=ALL-UNNAMED"]) // compatiblity to modules in java 9 and newer
}*/
//options.deprecation = true
//options.listFiles = true
//options.verbose = true
}
task clean_package(type: Delete) {
description 'delete folder package'
delete 'package'
}
task copy_lib(type: Copy) {
description 'copy folder lib to package'
from files(configurations.runtimeClasspath)
into 'package/lib'
}
task copy_add(type: Copy) {
description 'copy folder add to package'
from fileTree('add')
into 'package'
}
task copy_add_windows(type: Copy) {
description 'copy folder add_windows to package'
from fileTree('add_windows')
into 'package'
}
task copy_add_linux(type: Copy) {
description 'copy folder add_linux to package'
from fileTree('add_linux')
into 'package'
}
task copy_webcontent(type: Copy) {
description 'copy folder webcontent to package'
from fileTree('webcontent')
into 'package/webcontent'
}
task copy_build(type: Copy, dependsOn: [jar]) {
description 'copy compiled java jar file to package'
from fileTree('build/libs')
into 'package'
}
task copy_config(type: Copy, dependsOn: [jar]) {
description 'copy folder config to package'
from fileTree('config')
into 'package/config'
}
task _build_package(dependsOn:[ clean_package, copy_build, copy_lib, copy_webcontent, copy_add, copy_config, copy_add_linux ]) {
group = 'project'
description 'create TubeDB package for Linux'
}
task _build_package_windows(dependsOn:[ clean_package, copy_build, copy_lib, copy_webcontent, copy_add, copy_config, copy_add_windows ]) {
group = 'project'
description 'create TubeDB package for Windows'
}
task _build_package_linux_windows(dependsOn:[ clean_package, copy_build, copy_lib, copy_webcontent, copy_add, copy_config, copy_add_linux, copy_add_windows ]) {
group = 'project'
description 'create TubeDB package for Linux and Windows'
}
task _create_javadoc(type: Javadoc) {
group = 'project'
description 'create javadoc for TubeDB'
source = sourceSets.main.allJava
destinationDir = file('docs/javadoc')
title = 'TubeDB'
options.header = 'TubeDB'
options.windowTitle = 'TubeDB'
options.overview = 'src/overview.html'
options.links("http://docs.oracle.com/javase/8/docs/api")
options.links("https://docs.oracle.com/javase/8/javafx/api")
options.noTimestamp = true
}