-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
167 lines (141 loc) · 6.02 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
167 lines (141 loc) · 6.02 KB
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
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/5.6.3/userguide/tutorial_java_projects.html
*/
import java.text.SimpleDateFormat
import java.util.*
// Do not forget to set the PROJECT_NUMBER in the tapas.doxyfile
// also create a release tag "1.0.1" or similar afterwards
project.version = "1.0.1"
plugins {
// Apply the java plugin to add support for Java
java
// Apply the application plugin to add support for building a CLI application
application
//plugin for creating a fat jar (called shadow jar) with all dependencies included
id("com.github.johnrengelman.shadow") version "7.0.0"
// javafx plugin to handle javafx dependencies
id("org.openjfx.javafxplugin") version "0.0.8"
`maven-publish`
}
repositories {
// You can declare any Maven/Ivy/file repository here.
//use mavenCentral repository
mavenCentral()
//local directory
flatDir { dirs("ext") }
}
dependencies {
// These dependencies are used by the application.
implementation("net.sourceforge.javacsv:javacsv:2.0")
implementation("org.apache.logging.log4j:log4j:2.16.0")
implementation("org.postgresql:postgresql:42.2.8.jre7")
implementation("org.apache.commons:commons-lang3:3.9")
implementation("org.apache.commons:commons-collections4:4.4")
implementation("org.apache.commons:commons-math3:3.6.1")
implementation("commons-cli:commons-cli:1.4")
implementation("org.apache.poi:poi:4.1.1")
implementation("org.jfree:jfreechart:1.5.0")
implementation("com.jgoodies:jgoodies-forms:1.9.0")
implementation("com.miglayout:miglayout-swing:5.2")
implementation("net.sourceforge.jexcelapi:jxl:2.6.12")
implementation("net.lingala.zip4j:zip4j:2.5.1")
implementation("com.lmax:disruptor:3.4.2")
// add CLI support
implementation("info.picocli:picocli:4.7.1")
annotationProcessor ("info.picocli:picocli-codegen:4.7.5")
//local dependency
implementation("simon_w:simon_w:")
//test dependencies
testImplementation("org.junit.jupiter:junit-jupiter-api:5.3.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.3.1")
}
javafx {
//set javafx module version and dependencies; it is this way because javafx is...special
version = "13"
modules("javafx.controls", "javafx.fxml", "javafx.swing")
}
// This is for publishing a package to GitHub
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/DLR-VF/TAPAS")
credentials {
// set your environment variables GITHUB_USER and GITHUB_TOKEN
// don't forget to create an access token in GitHub
// for more information see the documentation
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_USER")
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
create<MavenPublication>("TAPAS") {
groupId = "de.dlr.ivf"
artifactId = "tapas"
version = project.version.toString()
from(components["java"])
}
}
}
application {
// Define the main class for the application
getMainClass().set("de.dlr.ivf.tapas.runtime.client.SimulationControl")
}
// Task for writing the version to the buildnumber.properties file.
// Below it is set to run during a build task.
task("buildnumber") {
doLast {
val date = Date()
val version = project.version
val versionString = "#TAPAS buildnumber properties\n" +
"#" + date + "\n" +
"version=" + version + "\n" +
"builddate=" + SimpleDateFormat("yyyy/MM/dd hh:mm").format(date) + "\n" +
"buildnumber=1a"
File(projectDir, "src/main/resources/buildnumber.properties").writeText(versionString)
}
}
//set versionText to run during the build task
//alternative: rootProject.tasks.getByName("build").dependsOn("versionText")
tasks.build.get().dependsOn("buildnumber")
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// If you want to add more executable tasks (like main() runs) then add
// similar tasks like the ones below
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
task("SimulationDaemon", JavaExec::class) {
group = "runnables"
description = "Runs the SimulationDaemon"
// Define the main class for the application
getMainClass().set("de.dlr.ivf.tapas.runtime.server.SimulationDaemon")
classpath = sourceSets["main"].runtimeClasspath
args = listOf("T:\\Simulations")
// jvmArgs = listOf("-Xmx8g")
jvmArgs = listOf("-Ddebug=true", "-Xmx8g")
}
task("SimulationControl", JavaExec::class) {
group = "runnables"
description = "Starts the SimulationControl app"
// Define the main class for the application
getMainClass().set("de.dlr.ivf.tapas.runtime.client.SimulationControl")
classpath = sourceSets["main"].runtimeClasspath
}
task("Installer", JavaExec::class) {
group = "runnables"
description = "Starts the installation script"
classpath = sourceSets["main"].runtimeClasspath
// Define the main class for the application
getMainClass().set("de.dlr.ivf.tapas.installer.Installer")
// set arguments like in the line below
// args = mutableListOf("--dbserver=localhost","--dbname=my_tapas_db_name","--dbuser=my_already_existing_tapas_db_user","--dbpassword=my_db_password")
}
tasks {
// Use the built-in JUnit support of Gradle.
"test"(Test::class) {
useJUnitPlatform()
}
}