-
Notifications
You must be signed in to change notification settings - Fork 307
/
build.gradle
128 lines (118 loc) · 4.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
import java.nio.file.Files
import java.nio.file.Paths
plugins {
id "org.jetbrains.kotlin.jvm" version "2.0.21" apply false
}
ext.distBinDir = file('ganttproject-builder/dist-bin')
ext.pluginsDir = file("ganttproject-builder/dist-bin/plugins/base")
def readVersion() {
return Files.readString(Paths.get(rootProject.projectDir.absolutePath, "ganttproject-builder", "VERSION")).trim()
}
version = System.getenv("VERSION") == null ? readVersion() : System.getenv("VERSION")
// Config for all projects: deps come from Maven repository,
// compile using Java 17, libs normally sit in lib
allprojects {
configurations {
direct
providedCompile
}
repositories {
mavenCentral()
google()
maven {
url "https://sandec.jfrog.io/artifactory/repo"
}
}
apply plugin: 'java'
ext {
libDir = 'lib'
mvnDir = 'lib/mvn'
kotlin_version = "2.0.21"
java_version = "21"
javaExportOptions = [
'--add-exports', 'javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED',
'--add-exports', 'javafx.base/com.sun.javafx.event=ALL-UNNAMED',
'--add-exports', 'javafx.base/com.sun.javafx=ALL-UNNAMED',
'--add-exports', 'javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED',
'--add-exports', 'javafx.controls/com.sun.javafx.scene.control.skin=ALL-UNNAMED',
'--add-exports', 'javafx.controls/com.sun.javafx.scene.control.skin.resources=ALL-UNNAMED',
'--add-exports', 'javafx.controls/com.sun.javafx.scene.control.inputmap=ALL-UNNAMED',
'--add-exports', 'javafx.graphics/com.sun.javafx.scene.traversal=ALL-UNNAMED',
'--add-exports', 'javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED',
'--add-exports', 'javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED',
'--add-exports', 'javafx.graphics/com.sun.javafx.util=ALL-UNNAMED',
'--add-opens', 'java.desktop/sun.swing=ALL-UNNAMED',
'--add-opens', 'java.desktop/sun.awt.X11=ALL-UNNAMED'
]
}
sourceCompatibility = java_version
targetCompatibility = java_version
clean {
delete += "dist-bin"
}
test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}
}
subprojects {
group 'biz.ganttproject'
version = new Date().format("yy.MM.dd") + "-SNAPSHOT"
}
def addPublishing(project) {
project.publishing {
repositories {
maven {
name "ganttproject-maven-repository-internal"
url "gcs://ganttproject-maven-repository/internal"
}
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/bardsoftware/ganttproject")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
}
}
}
def installLibs(jar, project) {
def pluginDistDir = new File(rootProject.pluginsDir, project.name)
copy {
into(new File(pluginDistDir, "lib/"))
from(configurations.direct) {
include "*.jar"
}
from(jar.outputs.getFiles().getFiles().flatten())
from(project.configurations.compileClasspath.minus(project.configurations.providedCompile.resolve())) {
include "*.jar"
}
rename { filename -> filename + ".lib" }
}
}
def install(task, jar, project) {
def pluginDistDir = new File(rootProject.pluginsDir, project.name)
task.doLast {
println ">>> ------------ Installing $project.name into $pluginDistDir ------------"
copy {
into(pluginDistDir)
from(fileTree(project.projectDir)) {
include "plugin.xml"
}
from(fileTree("$project.projectDir/src/main/")) {
include "resources/**"
}
}
installLibs(jar, project)
println "<<< $project.name"
}
}
//
//runtime {
// distDir = rootProject.distBinDir
// options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
// modules = ['java.base']
//}