-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
172 lines (151 loc) · 7.34 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
import java.text.SimpleDateFormat
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.10'
id 'org.beryx.runtime' version '1.12.5'
id "com.github.hierynomus.license-report" version "0.16.1"
}
version = '2.0.2'
String bfversion = "7.3.0"
String b2rversion = "0.9.3"
String r2oversion = "0.7.1"
mainClassName = 'com.glencoesoftware.convert.Launcher'
applicationName = 'NGFF-Converter'
repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://repo.glencoesoftware.com/repository/bioformats2raw2ometiff/'
}
maven {
url 'https://nexus.senbox.net/nexus/content/groups/public/'
}
maven {
url 'https://artifacts.glencoesoftware.com/artifactory/ome.releases/'
}
maven {
url 'https://maven.scijava.org/content/groups/public'
}
}
sourceCompatibility = 16
targetCompatibility = 16
javafx {
version = '17.0.9'
modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.graphics' ]
}
dependencies {
implementation "com.glencoesoftware:raw2ometiff:${r2oversion}"
implementation "com.glencoesoftware:bioformats2raw:${b2rversion}"
implementation "ome:formats-gpl:${bfversion}"
implementation 'info.picocli:picocli:4.6.2'
implementation group: 'commons-io', name: 'commons-io', version: '2.11.0'
implementation 'org.kordamp.ikonli:ikonli-javafx:12.3.0'
implementation 'org.kordamp.ikonli:ikonli-bootstrapicons-pack:12.3.0'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.4.12'
implementation group: 'ch.qos.logback', name: 'logback-core', version: '1.4.12'
implementation group: 'ch.qos.logback', name: 'logback-access', version: '1.4.12'
implementation group: 'org.controlsfx', name: 'controlsfx', version: '11.1.2'
implementation group: 'com.google.guava', name: 'guava', version: '32.1.3-jre'
runtimeOnly "org.openjfx:javafx-graphics:$javafx.version:win"
runtimeOnly "org.openjfx:javafx-graphics:$javafx.version:linux"
runtimeOnly "org.openjfx:javafx-graphics:$javafx.version:mac"
}
configurations.configureEach {
exclude group: 'edu.ucar', 'module': 'cdm'
}
jar {
manifest {
attributes (
"Created-By": "Gradle ${gradle.gradleVersion}",
"Build-Jdk": "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
"Built-By": System.properties['user.name'],
"Built-On": new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
"Implementation-Build": "git rev-parse --verify HEAD".execute().getText().trim(),
"Implementation-Title": 'NGFF-Converter',
"Implementation-Version": archiveVersion,
"Implementation-Vendor": "Glencoe Software Inc.",
"Main-Class": mainClassName
)
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
runtime {
addOptions('--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages')
def currentOs = org.gradle.internal.os.OperatingSystem.current()
tasks.jpackageImage.doLast {
if(currentOs.windows) {
assert file("blosc.dll").exists()
copy {
from "blosc.dll"
into("$buildDir/jpackage/$applicationName/app")
}
} else if(currentOs.macOsX) {
// Add blosc to the image
assert file("libblosc.dylib").exists()
copy {
from "libblosc.dylib"
into("$buildDir/jpackage/${applicationName}.app/Contents/lib")
}
// Tell the app where to find it
exec {
commandLine 'install_name_tool', '-add_rpath', '@executable_path/../lib', "$buildDir/jpackage/${applicationName}.app/Contents/MacOS/${applicationName}"
}
// Fix the permissions
exec {
commandLine 'dylibbundler', '-cd', '-of', '-b', '-x', "$buildDir/jpackage/${applicationName}.app/Contents/MacOS/${applicationName}", '-d', "$buildDir/jpackage/${applicationName}.app/Contents/lib", '-p', '@executable_path/../lib', '-s', "$buildDir/../lib"
}
} else {
throw new Exception("Unsupported Operating System")
}
}
launcher {
noConsole = true
}
jpackage {
imageName = applicationName
installerName = applicationName
def imgType = currentOs.windows ? 'ico' : currentOs.macOsX ? 'icns' : 'png'
imageOptions += ['--icon', "src/main/resources/com/glencoesoftware/convert/main-icon.$imgType"]
installerOptions += ['--resource-dir', "src/main/resources"]
installerOptions += ['--vendor', 'Glencoe Software']
installerOptions += ['--app-version', version]
installerOptions += ['--description', "Converts image files to NGFF .zarr"]
if(currentOs.windows) {
installerType = "msi"
installerOptions += ['--win-dir-chooser', '--win-menu', '--win-shortcut']
}
else if (currentOs.linux) {
// Linux unused for now
installerOptions += ['--linux-package-name', applicationName,'--linux-shortcut']
}
else if (currentOs.macOsX) {
imageOptions += ['--java-options', '-Djava.library.path=../lib']
}
}
tasks.register('jpackageImageZip', Zip) {
dependsOn jpackageImage
from layout.buildDirectory.dir("jpackage")
}
}
downloadLicenses {
includeProjectDependencies = true
dependencyConfiguration = 'runtimeClasspath'
licenses = [
// See https://github.com/Unidata/netcdf-java/blob/v5.3.3/LICENSE
(group('edu.ucar')): license('The 3-Clause BSD License', 'https://opensource.org/license/bsd-3-clause/'),
// See https://github.com/openjdk/jfx/blob/17%2B2/LICENSE
(group('org.openjfx')): license('GNU General Public License version 2 with Classpath Exception', 'https://openjdk.org/legal/gplv2+ce.html'),
// See https://github.com/javaee/jaxb-v2/blob/2.3.0/LICENSE
(group('javax.xml.bind')): license('Common Development and Distribution License 1.1 and GNU General Public License version 2 with Classpath Exception', 'https://oss.oracle.com/licenses/CDDL+GPL-1.1'),
// See https://github.com/openpnp/opencv/blob/v3.4.2-0/LICENSE
(group('org.openpnp')): license('The 3-Clause BSD License', 'https://opensource.org/license/bsd-3-clause/'),
]
aliases = [
(license('Apache License, Version 2.0', 'http://www.apache.org/licenses/LICENSE-2.0')) : ['The Apache Software License, Version 2.0', 'Apache 2', 'Apache License Version 2.0', 'Apache License 2.0', 'The Apache License, Version 2.0', 'Apache 2.0', 'Apache-2.0'],
(license('GNU Lesser General Public License version 2.1', 'https://opensource.org/license/lgpl-2-1/')) : ['GNU Lesser General Public License v2.1+'],
(license('GNU General Public License version 2', 'https://opensource.org/license/gpl-2/')) : ['GNU General Public License v2+'],
(license('The 2-Clause BSD License', 'https://opensource.org/license/bsd-2-clause/')) : ['Simplified BSD License', 'The BSD License', 'New BSD License'],
(license('The 3-Clause BSD License', 'https://opensource.org/license/bsd-3-clause/')) : ['The BSD 3-Clause License (BSD3)', '3-Clause BSD License'],
(license('The MIT License', 'https://opensource.org/license/mit/')) : ['MIT License', 'MIT']
]
}