-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
187 lines (163 loc) · 5 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
plugins {
id 'java-library'
id 'maven-publish'
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.1.0'
}
group = 'org.arblib'
version = '0.99.8'
description = 'arb4j'
java.sourceCompatibility = JavaVersion.VERSION_23
javafx {
version = "23.0.1"
modules = [ 'javafx.swing', 'javafx.controls', 'javafx.fxml', 'javafx.graphics' ]
}
repositories {
mavenLocal()
mavenCentral()
maven { url = uri('https://jitpack.io') }
maven { url = uri('https://oss.sonatype.org/content/repositories/releases') }
maven { url = uri('https://raw.github.com/SpinyOwl/repo/releases') }
maven { url = uri('https://maven.jzy3d.org/releases/') }
maven { url = uri('https://amelentev.github.io/mvnrepo/') }
maven { url = uri('https://repo.maven.apache.org/maven2/') }
maven { url = uri('https://download.oracle.com/maven') }
}
dependencies {
api 'guru.nidi:graphviz-java:0.18.1'
api 'io.github.mkpaz:atlantafx-base:2.0.1'
api 'org.fxyz3d:fxyz3d:0.6.0'
api 'com.github.beosign:snakeyaml-anno:1.3.0'
api 'org.yaml:snakeyaml:2.3'
api 'org.ow2.asm:asm:9.7'
api 'org.ow2.asm:asm-commons:9.7'
api 'org.ow2.asm:asm-util:9.7'
api 'org.openjfx:javafx-base:23.0.1'
api 'org.openjfx:javafx-swing:23.0.1'
api 'org.openjfx:javafx-fxml:23.0.1'
api 'org.slf4j:slf4j-simple:2.0.11'
api 'org.scilab.forge:jlatexmath:1.0.7'
api 'io.fair-acc:chartfx:11.3.1'
api 'org.controlsfx:controlsfx:11.2.0'
api 'junit:junit:4.13.2'
api 'guru.nidi.com.kitfox:svgSalamander:1.1.3'
}
configurations.all {
exclude group: 'org.apache.commons', module: 'commons-math3'
}
task createDesktopFile {
doLast {
def desktopFile = new File("${buildDir}/Expressor.desktop")
desktopFile.text = """[Desktop Entry]
Type=Application
Name=Expressor
Exec=${projectDir}/bin/expressor
Icon=${projectDir}/src/main/resources/ExpressionAnalyzer.png
Terminal=false
Categories=Utility;
"""
}
doLast {
def desktopFile = new File("${buildDir}/TODO.desktop")
desktopFile.text = """[Desktop Entry]
Type=Application
Name=TODO
Exec=${projectDir}/bin/todo
Icon=${projectDir}/src/main/resources/TODO.png
Terminal=false
Categories=Utility;
"""
}
doLast {
def desktopFile = new File("${buildDir}/SymbolPalette.desktop")
desktopFile.text = """[Desktop Entry]
Type=Application
Name=Symbol Palette
Exec=${projectDir}/bin/symbolPalette
Icon=${projectDir}/src/main/resources/SymbolPalette.png
Terminal=false
Categories=Utility;
"""
}
doLast {
def desktopFile = new File("${buildDir}/GaussianProcessModeller.desktop")
desktopFile.text = """[Desktop Entry]
Type=Application
Name=Gaussian Process Modeller
Exec=${projectDir}/bin/gpModeller
Icon=${projectDir}/src/main/resources/GaussianProcessModeller.png
Terminal=false
Categories=Utility;
"""
}
}
task installDesktopFile(type: Copy) {
dependsOn createDesktopFile
from "${buildDir}/Expressor.desktop"
from "${buildDir}/TODO.desktop"
from "${buildDir}/GaussianProcessModeller.desktop"
from "${buildDir}/SymbolPalette.desktop"
into "${System.getProperty('user.home')}/.local/share/applications"
}
build.finalizedBy createDesktopFile
build.finalizedBy installDesktopFile
tasks.withType(Javadoc) {
options.addStringOption('source', '23')
options.addBooleanOption('-enable-preview', true)
options.addBooleanOption('Xdoclint:none', true)
options.addBooleanOption('quiet', true)
}
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE;
from('src/main/resources') {
include '**/*'
}
}
java {
withSourcesJar()
modularity.inferModulePath.set(true)
withJavadocJar() // This will create the javadoc jar properly
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java // This will automatically include main jar, sources jar, and javadoc jar
}
}
}
tasks.withType(JavaCompile) {
options.compilerArgs += ['--enable-preview']
options.fork = true
options.forkOptions.jvmArgs += ['-ea', '--enable-preview']
}
tasks.test {
jvmArgs '-ea', '--enable-preview', '--enable-native-access=ALL-UNNAMED', '-Djava.library.path=.'
}
task createClasspathManifest {
doLast {
def classpathEntries = configurations.runtimeClasspath.collect { it.getAbsolutePath() }.join(':')
def manifestFile = file('class.path')
manifestFile.text = "${classpathEntries}\n"
}
}
tasks.build.dependsOn createClasspathManifest
processResources {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE;
from('src/main/resources') {
include '**/*'
}
into 'bin/main'
}
sourceSets {
main {
java.destinationDirectory.set(file('bin/main'))
output.resourcesDir = file('bin/main')
}
test {
java.destinationDirectory.set(file('bin/test'))
output.resourcesDir = file('bin/test')
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}