-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
232 lines (189 loc) · 8.17 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
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
import java.text.SimpleDateFormat
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
}
plugins {
id 'net.saliman.properties' version '1.4.5'
//id 'org.openjfx.javafxplugin' version '0.0.8'
}
//println "Gradle " + GradleVersion.current().getVersion() + ' - ' + GradleVersion.current().getBuildTime() + ' - ' + GradleVersion.current().getRevision() + (GradleVersion.current().isSnapshot() ? " SNAPSHOT" : "")
apply plugin: "java"
apply plugin: "idea"
version = '3.0.22'
defaultTasks 'createPlugin';
ext {
shortName = "BiocodePlugin"
pluginName = "com.biomatters.plugins.biocode." + shortName
//pluginName = shortName + version
geneiousPublicAPIVersion = "2022.2.2"
//geneiousPublicAPIVersion = "11.1.5"
//geneiousPublicAPIVersion = "2019.1.1"
//geneiousPublicAPIVersion = "9.0.5"
pluginDistFilename = "${shortName}_" + version.replaceAll("\\.", "_") + ".gplugin"
geneiousFilesName = "GeneiousFiles"
geneiousFilesPath = "$buildDir/$geneiousFilesName"
}
repositories {
mavenCentral()
ivy {
url "http://assets.geneious.com/developer/geneious/ivy"
layout "pattern", {
ivy "[organisation]/[module]/ivys/ivy-[revision].xml"
artifact "[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"
}
}
}
dependencies {
compile group: "com.biomatters", name: "geneious.publicapi", version: "$geneiousPublicAPIVersion", configuration: "api", changing: true
compile group: "com.google.guava", name: "guava", version:"15.0"
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
compile group: "org.hsqldb", name:"hsqldb", version:"2.3.0"
compile group: "org.jcommon", name:"jcommon", version:"1.0"
compile group: "org.jfree", name:"jfreechart", version:"1.0.15"
compile group: "net.sourceforge.jexcelapi", name:"jxl", version:"2.6.12"
compile group: "com.google.api-client", name:"google-api-client", version:"1.17.0-rc"
compile group: "com.google.api-client", name:"google-api-client-servlet", version:"1.17.0-rc"
compile group: "com.google.api-client", name:"google-api-client-appengine", version:"1.17.0-rc"
compile group: "com.google.http-client", name:"google-http-client-gson", version:"1.17.0-rc"
compile group: "com.google.apis", name:"google-api-services-fusiontables", version:"v1-rev33-1.17.0-rc"
compile group: "com.google.oauth-client", name:"google-oauth-client-jetty", version:"1.17.0-rc"
compile group: "com.google.oauth-client", name:"google-oauth-client-java6", version:"1.17.0-rc"
// use okhttp client for geome requests
compile 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
// Must use Jersey version less than 2.6
compile group: "org.glassfish.jersey.core", name:"jersey-client", version:"2.6"
compile group: "org.glassfish.jersey.media", name:"jersey-media-json-jackson", version:"2.6"
compile group: "org.glassfish.jersey.security", name:"oauth2-client", version:"2.6"
compile group: "commons-dbcp", name:"commons-dbcp", version:"1.4"
compile group: "commons-pool", name:"commons-pool", version:"1.6"
compile group: "commons-beanutils", name:"commons-beanutils", version:"1.9.2"
compile group: "mysql", name:"mysql-connector-java", version:"8.0.22"
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.8'
compile group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'
compile group: 'org.jsslutils', name: 'jsslutils', version: '1.0.8'
//compile group: 'org.openjfx', name: 'javafx-swing', version: '11.0.2'
// this one results in Could not get resource 'http://assets.geneious.com/developer/geneious/ivy/javafx/javafx.controls/ivys/ivy-11.0.0.xml'.
//compile 'javafx:javafx.controls:11.0.0'
testCompile "junit:junit:4.+"
testRuntime group: "com.biomatters", name: "geneious.publicapi", version: "$geneiousPublicAPIVersion", configuration: "runtime"
File geneiousFiles = file(geneiousFilesPath)
testCompile files("$geneiousFiles/iSeek.jar")
testCompile files("$geneiousFiles/lib/common.jar")
testRuntime files("$geneiousFiles/resources")
if (file("$geneiousFiles/lib").listFiles()) {
testRuntime files(file("$geneiousFiles/lib").listFiles())
}
}
//javafx {
// version = "11.0.2"
// modules = [ 'javafx.controls', 'javafx.fxml' ]
//}
configurations.all {
resolutionStrategy {
//BioJava uses old versions of log4j that have vulnerabilities - forcing gradle to bundle in the oldest version that fixes the issues
force 'org.apache.logging.log4j:log4j-api:2.8.2', 'org.apache.logging.log4j:log4j-core:2.8.2', 'org.apache.logging.log4j:log4j-slf4j-impl:2.8.2'
}
}
idea {
module {
inheritOutputDirs = true
}
}
task extractGeneiousRuntimeFiles(type: Copy) {
File zipFile = file(configurations.testRuntime.find {
it.getName().startsWith(geneiousFilesName) && it.getName().endsWith(".zip")
})
from zipTree(zipFile)
into buildDir
}
// Running the test task will depend on making the Geneious Runtime available
tasks.test.dependsOn(extractGeneiousRuntimeFiles)
tasks.test {
workingDir file(geneiousFilesPath)
minHeapSize '256M'
maxHeapSize '1024M'
jvmArgs '-ea', '-XX:MaxNewSize=40M', '-XX:MaxPermSize=256M', '-XX:ReservedCodeCacheSize=128m', '-Xss512K'
environment "DYLD_LIBRARY_PATH", "/Library/Application Support/Geneious/Frameworks:./activation/macos:./native_libs/macos"
environment "LD_LIBRARY_PATH", "./activation/linux64:./native_libs/linux64"
}
jar {
archiveName pluginName + ".jar"
include "**/*.class"
includeEmptyDirs false
manifest {
attributes('Implementation-Title': pluginName,
'Implementation-Version': version)
}
}
compileJava {
sourceCompatibility "11"
targetCompatibility "11"
}
sourceSets {
main {
java {
srcDir 'src'
}
resources {
srcDir 'resources'
}
File geneiousFiles = file(geneiousFilesPath)
runtimeClasspath += files("$geneiousFiles/resources")
runtimeClasspath += files("$geneiousFiles/iSeek.jar")
runtimeClasspath += fileTree("$geneiousFiles/lib")
}
test {
java {
srcDir 'test'
}
resources {
srcDir 'testdata'
}
File geneiousFiles = file(geneiousFilesPath)
runtimeClasspath += files("$geneiousFiles/resources")
runtimeClasspath += files("$geneiousFiles/iSeek.jar")
runtimeClasspath += fileTree("$geneiousFiles/lib")
}
}
task quickCreatePlugin ( dependsOn: assemble, type: Zip) {
description "Creates the gplugin to install into Geneious"
from {
configurations.compile.filter {
!it.getName().startsWith("GeneiousPublicAPI-") && !it.getName().startsWith("jdom-") && !it.getName().startsWith("jebl-")
}
}
from(libsDir)
from(sourceSets.main.resources)
into "$pluginName"
archiveName pluginDistFilename
}
task createPlugin(dependsOn: build, type: Zip) {
description "Creates the gplugin to install into Geneious"
from {
configurations.compile.filter {
!it.getName().startsWith("GeneiousPublicAPI-") && !it.getName().startsWith("jdom-") && !it.getName().startsWith("jebl-")
}
}
from(libsDir)
from(sourceSets.main.resources)
into "$pluginName"
archiveName pluginDistFilename
}
task runGeneious(dependsOn: [extractGeneiousRuntimeFiles, assemble], type: JavaExec) {
// NOTE, the expectation is that we java java 11 linked here
//executable '/usr/bin/java'
main 'com.biomatters.iseek.application.ISeekMain'
classpath sourceSets.main.runtimeClasspath
args 'extraPlugins=' + pluginName
workingDir file(geneiousFilesPath)
minHeapSize '256M'
maxHeapSize '4096M'
jvmArgs '-XX:+UseCompressedOops', '-XX:+UseConcMarkSweepGC', '-ea', '-Xss512K', '-Djava.util.logging.config.file=no_logging.properties', '-DdevForce=1'
environment "DISPLAY", ":0.0"
environment "LD_LIBRARY_PATH", "./activation/linux64:./native_libs/linux64"
environment "DYLD_LIBRARY_PATH", "./activation/macos:./native_libs/macos"
}