-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbuild.gradle
More file actions
264 lines (222 loc) · 7.7 KB
/
build.gradle
File metadata and controls
264 lines (222 loc) · 7.7 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
buildscript {
dependencies {
classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '8.8.2'
}
repositories {
mavenLocal()
mavenCentral()
}
}
import org.apache.tools.ant.taskdefs.condition.Os
apply plugin: 'java'
apply plugin: 'javafx-gradle-plugin'
apply plugin: 'application'
mainClassName = 'org.ykc.usbcx.Main'
apply plugin: 'maven'
def maj_ver
def min_ver
def build_no
def versionPropsFile
def Properties versionProps
repositories {
mavenCentral()
mavenLocal()
maven{
url "https://maven2repo.com/com.jfoenix/jfoenix"
url "https://github.com/tejv/maven-repo/raw/master"
}
}
dependencies {
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.+'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.+'
compile 'org.ykc:usbmanager:1.0.0'
compile 'org.controlsfx:controlsfx:8.40.12'
compile 'com.jfoenix:jfoenix:1.1.0'
compile 'org.apache.commons:commons-lang3:3.5'
compile group: 'commons-io', name: 'commons-io', version: '2.5'
compile 'org.jdom:jdom2:2.0.6'
}
build{
versionPropsFile = file('resources/version.properties')
if (versionPropsFile.canRead()) {
versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
maj_ver = versionProps['MAJOR_VERSION'].toInteger()
min_ver = versionProps['MINOR_VERSION'].toInteger()
build_no = versionProps['BUILD_NO'].toInteger()
def runTasks = gradle.startParameter.taskNames
if ('major_release' in runTasks) {
min_ver = 0
build_no = 0
maj_ver = maj_ver + 1
}
else if('major_release_skip_ver_inc' in runTasks)
{
min_ver = 0
build_no = 0
}
else if('minor_release' in runTasks)
{
min_ver = min_ver + 1
build_no = 0
}
else if('minor_release_skip_ver_inc' in runTasks)
{
build_no = 0
}
else if('uploadArchives' in runTasks)
{
//do_nothing
}
else
{
build_no = build_no + 1
}
versionProps['MAJOR_VERSION']= maj_ver.toString()
versionProps['MINOR_VERSION']= min_ver.toString()
versionProps['BUILD_NO']= build_no.toString()
versionProps.store(versionPropsFile.newWriter(), null)
jar.version = "${maj_ver}.${min_ver}.${build_no}"
}
else {
throw new GradleException("Could not read version.properties!")
}
}
jar{
group 'build'
// This file is needed for usbmanager to work
from('src/main/java') {
include 'javax.usb.properties'
}
from('resources') {
include '*.*'
}
manifest {
attributes(
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
'Main-Class': 'org.ykc.usbcx.Main'
)
}
from configurations.compile.collect {zipTree it}
}
jfx {
verbose = true
mainClass = 'org.ykc.usbcx.Main'
jfxAppOutputDir = "build/jfx/app"
jfxMainAppJarName = "USBCx.jar"
deployDir = "src/main/deploy"
useEnvironmentRelativeExecutables = true
libFolderName = "lib"
// gradle jfxJar
css2bin = false
preLoader = null // String
updateExistingJar = false
allPermissions = false
manifestAttributes = null // Map<String, String>
addPackagerJar = true
copyAdditionalAppResourcesToJar = true
skipCopyingDependencies = false
useLibFolderContentForManifestClasspath = false
fixedManifestClasspath = null
// gradle jfxNative
identifier = null // String - setting this for windows-bundlers makes it possible to generate upgradeable installers (using same GUID)
vendor = "org.ykc"
nativeOutputDir = "build/jfx/native"
bundler = "ALL" // set this to some specific, if your don't want all bundlers running, examples "windows.app", "jnlp", ...
jvmProperties = null // Map<String, String>
jvmArgs = null // List<String>
userJvmArgs = null // Map<String, String>
launcherArguments = null // List<String>
nativeReleaseVersion = "1.0"
needShortcut = false
needMenu = false
bundleArguments = [
// dont bundle JRE (not recommended, but increases build-size/-speed)
runtime: null
]
appName = "project" // this is used for files below "src/main/deploy", e.g. "src/main/deploy/windows/project.ico"
additionalBundlerResources = null // path to some additional resources for the bundlers when creating application-bundle
additionalAppResources = null // path to some additional resources when creating application-bundle
secondaryLaunchers = [[appName:"somethingDifferent"], [appName:"somethingDifferent2"]]
fileAssociations = null // List<Map<String, Object>>
noBlobSigning = false // when using bundler "jnlp", you can choose to NOT use blob signing
customBundlers = null // List<String>
failOnError = false
onlyCustomBundlers = false
skipJNLP = false
skipNativeVersionNumberSanitizing = false // anything than numbers or dots are removed
additionalJarsignerParameters = null // List<String>
skipMainClassScanning = false // set to true might increase build-speed
skipNativeLauncherWorkaround124 = false
skipNativeLauncherWorkaround167 = false
skipNativeLauncherWorkaround205 = false
skipJNLPRessourcePathWorkaround182 = false
skipSigningJarFilesJNLP185 = false
skipSizeRecalculationForJNLP185 = false
skipMacBundlerWorkaround = false
// gradle jfxRun
runJavaParameter = null // String
runAppParameter = null // String
// per default the outcome of the gradle "jarTask" will be used, set this to specify otherwise (like proguard-output)
alternativePathToJarFile = null // String
// to disable patching of ant-javafx.jar, set this to false
usePatchedJFXAntLib = true
// making it able to support absolute paths, defaults to "false" for maintaining old behaviour
checkForAbsolutePaths = false
// gradle jfxGenerateKeyStore
keyStore = "src/main/deploy/keystore.jks"
keyStoreAlias = "myalias"
keyStorePassword = "password"
keyPassword = null // will default to keyStorePassword
keyStoreType = "jks"
overwriteKeyStore = false
certDomain = null // required
certOrgUnit = null // defaults to "none"
certOrg = null // required
certState = null // required
certCountry = null // required
}
task min_rel(type: Copy) {
from jfxJar
into "release/${maj_ver}.0.0"
}
task maj_rel(type: Copy) {
from jfxJar
into "release/${maj_ver}.${min_ver}.${build_no}"
}
/* Use only on release */
task minor_release() {
description "Generates output jar in release folder with auto increment of minor version"
group 'build'
dependsOn = ['min_rel']
}
task minor_release_skip_ver_inc() {
description "Generates output jar in release folder with no increment of minor version"
group 'build'
dependsOn = ['min_rel']
}
task major_release() {
description "Generates output jar in release folder with auto increment of major version"
group 'build'
dependsOn = ['maj_rel']
}
task major_release_skip_ver_inc() {
description "Generates output jar in release folder with no increment of major version"
group 'build'
dependsOn = ['maj_rel']
}
// Deploy to local maven-repo. If want to put on github push as a seprate step.
// Path of local maven-repo needs to be specified in gradle.properties file and changed
// as per machine.
//uploadArchives {
// repositories.mavenDeployer {
// repository(url: LOCAL_MAVEN_REPO_PATH)
// uniqueVersion = false
// pom.project {
// groupId = 'org.ykc'
// version = jar.version
// artifactId = 'USBCx'
// packaging = 'jar'
// }
// }
//}