-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
156 lines (128 loc) · 4.75 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
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.9'
}
apply plugin: "java"
apply plugin:'application'
sourceCompatibility = 1.8
def MAJOR_VERSION = 0
def MINOR_VERSION = 4
mainClassName = "TrelloCmd"
javafx {
version = '21'
modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.swing', 'javafx.web' ]
}
repositories {
mavenCentral()
flatDir{
dirs 'trello4j/target'
}
}
application {
applicationDefaultJvmArgs = [
'--module-path', '/Users/alan/Downloads/javafx-sdk-22.0.1aarch64/lib',
'--add-modules', 'javafx.controls,javafx.graphics,javafx.fxml,javafx.swing',
'-Dprism.order=sw'
]
}
dependencies {
implementation ('org.trello4j:trello4j:1.0-SNAPSHOT', 'com.google.code.gson:gson:2.6')
implementation 'org.apache.logging.log4j:log4j-api:2.0.2'
implementation 'org.apache.logging.log4j:log4j-core:2.0.2'
// https://mvnrepository.com/artifact/io.github.hkarthik7/azd
implementation 'io.github.hkarthik7:azd:5.0.11'
// https://mvnrepository.com/artifact/javafx/javafx
//implementation 'javafx:javafx:2.2.7'
// this might only be needed in Linux:
//implementation files("/Users/alan/Downloads/javafx-sdk-22.0.1aarch64/lib/javafx.base.jar")
//implementation 'org.openjfx:javafx-base:18:mac-aarch64'
//implementation 'org.openjfx:javafx-base:17'
//compile files("C:\\Users\\alanb\\Downloads\\openjfx-11.0.2_windows-x64_bin-sdk\\javafx-sdk-11.0.2\\lib\\javafx.base.jar")
//implementation 'javafx:javafx.controls:11.0.0'
//compile files("${System.properties['java.home']}\\lib\\jfxrt.jar")
}
//# ####################################################################
//#
//# ####################################################################
task writeVersionData {
def localMachine = java.net.InetAddress.getLocalHost();
def timeStamp = new java.text.SimpleDateFormat("MM-dd-yyyy HH:mm:ss").format(Calendar.getInstance().getTime())
def lowVersion = new java.text.SimpleDateFormat("yyyyMMdd").format(Calendar.getInstance().getTime())
version = MAJOR_VERSION + '.' + MINOR_VERSION + '.' + lowVersion
def AboutJava = new File("src\\main\\java\\About.java")
AboutJava.text = "/* Auto generated code, your changes will be overwritten when built by gradle */\n" +
"public class About { \n" +
" static final String BuiltByMachine = \"" + localMachine.getHostName() + "\"; \n" +
" static final String BuiltByUser = \"" + System.getProperty("user.name") + "\"; \n" +
" static final String DateTime = \"" + timeStamp + "\"; \n" +
" static final String Version = \"" + version + "\"; \n" +
"}\n"
def BuildFolder = new File("build\\libs")
if (!BuildFolder.exists()) {
BuildFolder.mkdirs()
}
// make directory build\libs if it does not exist.
def VersionTxt = new File("build\\libs\\latestversion.json")
VersionTxt.text = version.toString()
}
//# ####################################################################
//# Compile
//# ####################################################################
sourceSets {
main.resources { exclude 'config.json' }
}
jar {
dependsOn writeVersionData
manifest { attributes 'Main-Class' : 'TrelloCmd',
'Implementation-Version': version,
'Implementation-title': 'Trello Client',
//'Class-Path': configurations.implementation.collect { 'lib/' + it.getName() }.join(' ')
'Class-Path': 'lib/something-something-something'
}
//from {
// configurations.implementation.collect { it.isDirectory() ? it : zipTree(it) }
//}
}
//# ####################################################################
//# Do Last
//# ####################################################################
//task copyLibs(type: Copy) {
// from configurations.compile
// into 'build/libs/lib'
//}
task copyResources(type: Copy){
from 'src/main/resources'
into 'build/libs'
}
jar.doLast {
//tasks.copyLibs.execute()
//tasks.copyResources.execute()
}
//# ####################################################################
//# Publishing
//# ####################################################################
task publish(type: Copy) {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
into 'dist'
from("build/libs") {
include "trello-${version}.jar"
rename { String fileName ->
"trello-latest.jar"
}
}
from("build/libs") {
include "latestversion.json"
}
from("installer") {
include "trello-installer.msi"
}
from("dist") {
include "trello-installer.msi"
include "trello-latest.jar"
include "latestversion.json"
}
}
task cleanDist(type: Delete) {
delete 'dist'
}
publish.dependsOn cleanDist