-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
143 lines (126 loc) · 4.1 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
plugins {
id 'java'
id 'edu.sc.seis.launch4j' version '3.0.5'
id 'de.undercouch.download' version '5.5.0'
}
repositories {
mavenCentral()
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
/* Would be nice to use javafx for finos perspective integration but as of now webassembly and workers are not supported
keeping definitions here for further reference */
// id "org.openjfx.javafxplugin" version "0.0.12"
//javafx {
//// version = '17.0.0.1'
// version = '19-ea+3'
// modules = ['javafx.swing', 'javafx.web']
//}
sourceSets {
main.resources.srcDir 'src/main/html'
}
compileJava {
options.encoding = 'UTF-8'
options.warnings = true
options.deprecation = true
options.debug = true
options.compilerArgs = [
'-Xlint:unchecked',
'--add-exports', 'java.desktop/com.sun.java.swing.plaf=ALL-UNNAMED'
]
}
dependencies {
// flatlaf 2.2 has troubles with JSplitPane programmatic divider positioning
implementation 'com.formdev:flatlaf:3.4'
implementation 'com.formdev:flatlaf-extras:3.4'
implementation 'com.formdev:flatlaf-intellij-themes:3.4'
// https://github.com/DJ-Raven/swing-toast-notifications
implementation files('libs/swing-toast-notifications-1.0.1.jar')
implementation 'org.drjekyll:fontchooser:2.5.2'
implementation 'org.nanohttpd:nanohttpd-websocket:2.3.1'
implementation 'com.google.code.gson:gson:2.10.1'
testImplementation 'junit:junit:4.13.2'
compileOnly 'org.jetbrains:annotations:24.1.0'
}
def myVersion = 'dev'
file('CHANGELOG.md').find {
if (it.startsWith('## v')) {
myVersion = it.substring(3)
return true
}
}
jar {
manifest {
attributes(
"Implementation-Version": myVersion,
"Main-Class": 'org.riekr.jloga.Main'
)
}
}
tasks.register('fatJar', Jar) {
group "build"
manifest.from jar.manifest
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set('all')
from sourceSets.main.output
dependsOn configurations.runtimeClasspath
from {
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }
.collect {
zipTree(it).matching {
exclude('FontChooser*.properties')
}
}
}
}
launch4j {
// https://github.com/TheBoegl/gradle-launch4j
mainClassName = 'org.riekr.jloga.Main'
// convert icon.png -resize 256x256 -channel rgb -negate icon.ico
icon = "${projectDir}/src/main/resources/org/riekr/jloga/icon.ico"
jarTask = fatJar
copyConfigurable = []
version = myVersion
textVersion = 'v' + myVersion
setCopyright('https://github.com/Riekr/jloga')
setSupportUrl('https://github.com/Riekr/jloga/issues')
setDownloadUrl('https://adoptium.net/temurin/releases')
}
tasks.register('updatePerspective') {
// https://github.com/michel-kraemer/gradle-download-task
doLast {
def repo = "https://cdn.jsdelivr.net/npm/@finos"
def local = "src/main/html/org/riekr/jloga/http/perspective/"
download.run { src "${repo}/perspective/dist/cdn/perspective.js"; dest local }
download.run { src "${repo}/perspective-viewer/dist/cdn/perspective-viewer.js"; dest local }
download.run { src "${repo}/perspective-viewer-datagrid/dist/cdn/perspective-viewer-datagrid.js"; dest local }
download.run { src "${repo}/perspective-viewer-d3fc/dist/cdn/perspective-viewer-d3fc.js"; dest local }
download.run { src "${repo}/perspective/dist/cdn/perspective.cpp.wasm"; dest local }
download.run { src "${repo}/perspective-viewer/dist/cdn/perspective_bg.wasm"; dest local }
// download.run { src 'https://cdn.jsdelivr.net/npm/superstore-arrow/superstore.arrow'; dest local }
download.run { src "${repo}/perspective/dist/cdn/perspective.worker.js"; dest local }
// you can set "wgetExec" in "gradle.properties" file in the same folder of this one (useful for cygwin)
delete(file("${local}/res"))
def wget = project.findProperty('wgetExec') ?: 'wget'
exec {
workingDir "${local}"
executable wget
args(['-q',
'--page-requisites',
'--convert-links',
'-e', 'robots=off',
'--span-hosts',
'--restrict-file-names=windows',
'--directory-prefix=res',
'--adjust-extension',
"${repo}/perspective-viewer/dist/css/themes.css"
])
}
}
}
artifacts {
archives fatJar
}