-
Notifications
You must be signed in to change notification settings - Fork 69
/
build.gradle
1494 lines (1319 loc) · 58.8 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
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/////////////////////////////////////////////////////////////////////
// Gradle Build File for Neptus //
// //
// @author: Paulo Dias //
/////////////////////////////////////////////////////////////////////
plugins {
id 'java' //apply false
id 'application'
id 'distribution'
id "com.gorylenko.gradle-git-properties" version "2.3.2"
id "com.github.langmo.gradlensis" version "0.1.0"
id "de.undercouch.download" version "4.1.2"
id "eclipse"
}
description = """
This is the Neptus C2 Framework for controlling autonomous vehicles.
https://www.lsts.pt/toolchain/neptus/
"""
version = '2024.01.0-SNAPSHOT'
ext {
copyYears = "2004-${new Date().format('yyyy')}"
libJNIPaths = ['.']
jreDownloadVersion = "jdk-11.0.21+9"
}
defaultTasks 'buildJars', 'buildBundleJars'
///////////////////////
// Utilities Section //
///////////////////////
// Get the libJNI file collection for the familyLst and archLst
def getLibJNIFor(familyLst, archLst) {
def libJNIPaths = [file('.')];
familyLst.each({ family ->
archLst.each({ arch ->
fileTree(dir: 'libJNI', includes: ["*/$family/$arch/*"]).each({ libJNIPaths += it.getParentFile() })
fileTree(dir: 'libJNI', includes: ["$family/*", "*/$family/*"]).each({ libJNIPaths += it.getParentFile() })
fileTree(dir: 'libJNI', includes: ["$arch/*", "*/$arch/*"]).each({ libJNIPaths += it.getParentFile() })
})
})
libJNIPaths += file('libJNI')
if (isFamily(FAMILY_UNIX))
libJNIPaths += file('/usr/lib/jni')
libJNIPaths.unique()
return libJNIPaths;
}
def String relativePathIfOnProjectPath(fx, String prefixForRelative){
def fx1 = file(fx)
def rpFx = file(rootProject.rootDir)
if (fx1.getPath().startsWith(rpFx.getPath()))
return prefixForRelative + relativePath(fx1)
return fx1.getPath()
}
// Creates tasks named ${taskPrefixName}StartScripts extending the CreateStartScripts task.
// This will generate Linux and Windows scripts to run the application.
//
// applicationNameOpt: Its the CreateStartScripts applicationName param
// taskPrefixName: Its the created task name prefix (${taskPrefixName}StartScripts)
// mainClass : Its the CreateStartScripts mainClass param
// appHomeRelativePathOpt: It's the CreateStartScripts executableDir param
// addedSectionSnippetName: This is the sufix name for the options (such as adding arg processing.
// This is expected to be "dist/scripts/unixSnippet${addedSectionSnippetName}.txt"
// for linux and "dist/scripts/windowsSnippet${addedSectionSnippetName}.txt"
// for windows.
// classpathCollection: Its the CreateStartScripts classpath param
def generateStartScriptsFor(String applicationNameOpt, String taskPrefixName,
String mainclass, String appHomeRelativePathOpt, String addedSectionSnippetName,
FileCollection classpathCollection) {
return tasks.create("${taskPrefixName}StartScripts", CreateStartScripts) {
applicationName = "$applicationNameOpt"
outputs.upToDateWhen { false }
mainClass = "$mainclass"
classpath = classpathCollection
outputDir = file("$buildDir/scripts/$taskPrefixName")
executableDir = "$appHomeRelativePathOpt"
defaultJvmOpts = [
'-Xms10m',
'-Xmx2g',
'-XX:MaxMetaspaceSize=512m',
'-XX:+UseG1GC', //for Java 8+
//'-XX:+UseZGC', //for Java 11+
//'-XX:+PrintGCDetails', '-XX:+PrintGCDateStamps', '-Xloggc:$APP_HOME/log', //for Java 8-
//'-Xlog:gc*:file=$APP_HOME/log', //for Java 9+
'-XX:+HeapDumpOnOutOfMemoryError', '-XX:HeapDumpPath=$APP_HOME/log/heap-dump.hprof',
'-Xss256k',
]
doLast {
unixScript.text = unixScript.text.replace('@lib_jni_linux_x64@',
getLibJNIFor(['linux'], ['x64', 'x86']).collect { "${relativePathIfOnProjectPath(it, '\$APP_HOME/',)}" }.join(':'))
unixScript.text = unixScript.text.replace('@lib_jni_linux_x86@',
getLibJNIFor(['linux'], ['x86']).collect { "${relativePathIfOnProjectPath(it, '\$APP_HOME/')}" }.join(':'))
unixScript.text = unixScript.text.replace('@lib_jni_osx_x64@',
getLibJNIFor(['osx'], ['x64']).collect { "${relativePathIfOnProjectPath(it, '\$APP_HOME/')}" }.join(':'))
unixScript.text = unixScript.text.replace('@added_section@', addedSectionSnippetName.isEmpty() ? ''
: rootProject.file("dist/scripts/unixSnippet${addedSectionSnippetName}.txt").getText('UTF-8'))
windowsScript.text = windowsScript.text.replace('@lib_jni_windows_x64@',
getLibJNIFor(['win'], ['x64', 'x86']).collect { "${relativePathIfOnProjectPath(it, '%APP_HOME%\\',)}" }.join(';'))
windowsScript.text = windowsScript.text.replace('@lib_jni_windows_x86@',
getLibJNIFor(['win'], ['x86']).collect { "${relativePathIfOnProjectPath(it, '%APP_HOME%\\',)}" }.join(';'))
windowsScript.text = windowsScript.text.replace('@added_section@', addedSectionSnippetName.isEmpty() ? ''
: rootProject.file("dist/scripts/windowsSnippet${addedSectionSnippetName}.txt").getText('UTF-8'))
}
}
}
//////////////////////////
// Root-Project Section //
//////////////////////////
apply plugin: 'application'
apply plugin: 'distribution'
apply plugin: "com.gorylenko.gradle-git-properties"
apply plugin: 'eclipse'
task buildClasspathJar(type: Jar) {
archiveBaseName = "cp"
archiveVersion = ''
destinationDirectory = file("$rootDir")
doFirst {
def configurationClasspath = configurations.runtimeClasspath
configurationClasspath -= project(':core').configurations.core.allArtifacts.files
subprojects.findAll({it.name != 'core'}).each {
configurationClasspath -= it.configurations.plugin.allArtifacts.files
}
manifest {
attributes("Class-Path": configurationClasspath.collect({
try {
relativePath(it)
} catch (e) {
it
}
}).join(' '))
}
}
}
// Generating start scripts for the development environment
generateStartScriptsFor(rootProject.name, 'run', 'pt.lsts.neptus.loader.NeptusMain',
'', 'RunOptions', files('SUBSTITUTE')).doLast {
// def configurationClasspath = project(':core').sourceSets.main.runtimeClasspath
// configurationClasspath -= project(':core').configurations.core.allArtifacts.files
// subprojects.findAll({it.name != 'core'}).each {
// configurationClasspath -= it.configurations.plugin.allArtifacts.files
//}
//def unixCp = configurationClasspath
// .collect({relativePathIfOnProjectPath(it, '$APP_HOME/')}).join(':')
//def winCp = configurationClasspath
// .collect({relativePathIfOnProjectPath(it, '%APP_HOME%\\')}).join(';')
// unixScript.text = unixScript.text.replace('$APP_HOME/lib/SUBSTITUTE', "${unixCp}")
// windowsScript.text = windowsScript.text.replace('%APP_HOME%\\lib\\SUBSTITUTE', "${winCp}")
unixScript.text = unixScript.text.replace('$APP_HOME/lib/SUBSTITUTE', "cp.jar")
windowsScript.text = windowsScript.text.replace('%APP_HOME%\\lib\\SUBSTITUTE', "%APP_HOME%\\cp.jar")
}
task generateRunScripts(type: Copy) {
dependsOn buildClasspathJar
from runStartScripts
into file("$rootDir")
}
jar.dependsOn generateRunScripts
jar.enabled = false
import static org.apache.tools.ant.taskdefs.condition.Os.*
task updateLibJNIPaths {
def familyLst = []
if (isFamily(FAMILY_WINDOWS))
familyLst += 'win'
if (isFamily(FAMILY_MAC))
familyLst += 'osx'
if (isFamily(FAMILY_UNIX))
familyLst += 'linux'
def archLst = []
if (isArch('x86'))
archLst += 'x86'
else
archLst += ['x64', 'x86']
libJNIPaths = getLibJNIFor(familyLst, archLst);
doLast {
println "Family: ${OS_NAME}"
println "Version: ${OS_VERSION}"
println "Architecture: ${OS_ARCH}"
println "libJNIPaths: ${libJNIPaths.collect { "${relativePath(it)}" }.join(isFamily(FAMILY_WINDOWS) ? ';' : ':') }"
// println ">>>>>>>> " + configurations.runtimeClasspath.asPath
}
}
run.dependsOn updateLibJNIPaths
run {
if (isFamily(FAMILY_WINDOWS))
environment 'PATH', "${libJNIPaths.collect { "${relativePath(it)}" }.join(';')};%PATH%"
else
environment 'LD_LIBRARY_PATH', "${libJNIPaths.collect { "${relativePath(it)}" }.join(':')}:\$LD_LIBRARY_PATH"
args 'auv'
classpath configurations.runtimeClasspath
}
application {
mainClass = 'pt.lsts.neptus.loader.NeptusMain'
// https://dzone.com/articles/7-jvm-arguments-of-highly-effective-applications-1?edition=590292&utm_source=Weekly%20Digest&utm_medium=email&utm_campaign=Weekly%20Digest%202020-04-01
applicationDefaultJvmArgs = [
'-Xms10m',
'-Xmx2g',
'-XX:MaxMetaspaceSize=512m',
'-XX:+UseG1GC', //for Java 8+
//'-XX:+UseZGC', //for Java 11+
//'-XX:+PrintGCDetails', '-XX:+PrintGCDateStamps', "-Xloggc:${relativePath('./log')}", //for Java 8-
//"-Xlog:gc*:file=${relativePath('./log')}", //for Java 9+
'-XX:+HeapDumpOnOutOfMemoryError', "-XX:HeapDumpPath=${relativePath('./log/heap-dump.hprof')}",
'-Xss256k',
"-Djava.library.path=\"${libJNIPaths.collect { "${relativePath(it)}" }.join(isFamily(FAMILY_WINDOWS) ? ';' : ':') }\"",
]
}
//////////////////////////
// All-Projects Section //
//////////////////////////
allprojects {
version = "$rootProject.version"
repositories {
mavenCentral()
flatDir {
dirs 'lib', "${rootProject.projectDir}/lib"
}
maven {
url 'https://artifacts.unidata.ucar.edu/repository/unidata-all/'
content {
includeGroup "edu.ucar"
}
}
// maven {
// url 'https://maven.jzy3d.org/releases/'
// content {
// includeGroup "org.jzy3d"
// }
// }
}
apply plugin: 'java'
compileJava.options.encoding = 'UTF-8'
// compileJava.options.compilerArgs << '-Xlint:unchecked'
// compileJava.options.deprecation = true
java.sourceCompatibility = JavaVersion.VERSION_1_8
java.targetCompatibility = JavaVersion.VERSION_1_8
processResources {
mustRunAfter(generateRunScripts)
duplicatesStrategy DuplicatesStrategy.EXCLUDE
from (rootProject.projectDir) {
include 'LICENSE.md'
}
}
jar {
mustRunAfter(generateRunScripts)
manifest {
attributes(
'Specification-Title': rootProject.name.capitalize(),
'Specification-Version': "$project.version, ${-> project.ext.gitProps['git.commit.time']}",
'Specification-Vendor': 'FEUP USTL/LSTS (https://www.fe.up.pt/lsts) Neptus (https://lsts.fe.up.pt/toolchain/neptus)',
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Implementation-Vendor': 'FEUP USTL/LSTS (https://www.fe.up.pt/lsts)',
'Build-Revision': "${rootProject.name}-${project.version}-git#${-> project.ext.gitProps['git.commit.id.describe']}",
'Built-By': "${System.properties['user.name']}",
'Built-On': "${new Date()}",
'Build-Jdk': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
)
}
archiveVersion = ''
}
apply plugin: "com.gorylenko.gradle-git-properties"
gitProperties {
extProperty = 'gitProps'
failOnNoGitDirectory = false
dateFormat = "yyyy-MM-dd'T'HH:mmZ"
dateFormatTimeZone = "UTC"
gitPropertiesName = "git.info"
keys = ['git.branch',
'git.build.version',
'git.closest.tag.commit.count',
'git.closest.tag.name',
'git.commit.id',
'git.commit.id.abbrev',
'git.commit.id.describe',
'git.commit.time',
'git.dirty',
'git.remote.origin.url',
'git.tags',
]
}
generateGitProperties.outputs.upToDateWhen { false }
// If the subproject is on the same Git as the root,
// just copy from it and don't run generateGitProperties
task copyGitPropertiesFromRoot {
if (project != rootProject)
dependsOn rootProject.tasks.generateGitProperties
doLast {
project.ext['gitProps'] = rootProject.ext.gitProps
copy {
from (rootProject.sourceSets.main.output.resourcesDir)
include 'git.info'
into project.sourceSets.main.output.resourcesDir
}
}
}
if (file("${project.projectDir}/.git").exists()
|| file("${project.projectDir}/../.git").exists()
&& file("${project.projectDir}/../") != file("${rootProject.projectDir}"))
tasks.copyGitPropertiesFromRoot.enabled = false
else
tasks.generateGitProperties.enabled = false
generateGitProperties.dependsOn copyGitPropertiesFromRoot
generateGitProperties.mustRunAfter(generateRunScripts)
classes.dependsOn copyGitPropertiesFromRoot
}
// Configuration of the core project
project(':core') {
apply plugin: 'java'
apply plugin: "com.gorylenko.gradle-git-properties"
apply plugin: 'eclipse'
configurations {
core
}
dependencies {
implementation name: 'libimc-5.90.4'
implementation name: 'libimcsender-5.90.4'
implementation name: 'aisparser-2.0.0'
implementation name: 'jssc' //dependency of aisparser, and serial port reader
//implementation 'org.scream3r:jssc:2.8.0'
implementation name: 'ais-contact-manager-1.0'
implementation 'org.apache.xmlgraphics:batik-gui-util:1.14'
implementation 'org.apache.xmlgraphics:batik-anim:1.14'
implementation name: 'charsets-zip' // for zip, probably not needed anymore
implementation 'commons-cli:commons-cli:1.4'
implementation 'commons-codec:commons-codec:1.15'
implementation 'org.apache.commons:commons-collections4:4.4'
implementation 'org.apache.commons:commons-compress:1.21'
implementation 'commons-configuration:commons-configuration:1.10'
implementation 'org.apache.commons:commons-email:1.5'
implementation 'commons-io:commons-io:2.8.0'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'commons-lang:commons-lang:2.6'
implementation 'commons-logging:commons-logging:1.2'
implementation 'commons-net:commons-net:3.8.0'
implementation 'org.apache.commons:commons-text:1.9'
implementation 'dom4j:dom4j:1.6.1'
implementation 'jaxen:jaxen:1.2.0'
implementation 'com.firebase:firebase-client-jvm:2.0.0' //2.5.2
implementation 'org.apache.xmlgraphics:fop:2.6'
//implementation group: 'foxtrot', name: 'foxtrot', version: '3.0', ext: 'pom'
implementation name: 'foxtrot' //4.0, used 3.0
implementation 'org.graphstream:gs-ui:1.3'
// gdal 1.8.2
implementation name: 'gdal'
implementation name: 'gpsinput-0.5.3' // needs log4j v1.x
implementation name: 'gpxparser'
implementation 'org.codehaus.groovy:groovy:3.0.3' //2.5.4
implementation 'com.google.code.gson:gson:2.9.1'
implementation 'com.google.guava:guava:30.1-jre'
implementation 'de.grundid.opendatalab:geojson-jackson:1.14'
implementation 'org.apache.httpcomponents:httpclient:4.5.13' //5.0
implementation 'org.imgscalr:imgscalr-lib:4.2'
implementation 'com.lowagie:itext:2.1.5' // old, think of replacing
// Java 3D related //
//implementation 'java3d:j3d-core:1.3.1' // to delete
implementation name: 'j3dcore'
//implementation 'java3d:j3d-core-utils:1.3.1' // to delete
implementation name: 'j3dutils'
implementation name: 'StarfireExt' // to delete
implementation name: 'vecmath' // to delete
implementation name: 'wrl/j3d-vrml97' // to delete
implementation 'de.micromata.jak:JavaAPIforKml:2.2.0' //2.2.1
implementation 'net.sourceforge.javacsv:javacsv:2.0'
implementation 'org.javassist:javassist:3.18.0-GA' //3.27.0-GA
// implementation 'net.sf.jchart2d:jchart2d:3.3.2' // should be 1.03
implementation 'org.jfree:jcommon:1.0.24'
implementation 'org.jfree:jfreechart:1.5.3'
implementation 'org.mortbay.jetty:jetty:6.0.2'
implementation 'com.jgoodies:jgoodies-looks:2.5.3' //2.7.0
implementation 'com.jhlabs:filters:2.0.235-1' // don't know the orig version
//implementation 'net.java.jinput:jinput:2.0.9' // was not this and should be before 2.0.4
implementation name: 'jinput'
implementation 'net.sourceforge.jmatio:jmatio:1.0'
implementation 'javax.media:jmf:2.1.1e'
implementation 'org.jogamp.jogl:jogl-all-main:2.0.2'
implementation 'com.jcraft:jsch:0.1.53' //0.1.55
implementation name: 'jtransform_thin' // from NOAA https://www.ngs.noaa.gov/NCAT/
implementation 'net.sf.jung:jung2:2.0.1'
implementation 'net.sf.jung:jung-api:2.0.1'
implementation 'net.sf.jung:jung-algorithms:2.0.1'
implementation 'net.sf.jung:jung-graph-impl:2.0.1'
implementation 'net.sf.jung:jung-visualization:2.0.1'
implementation 'org.swinglabs:jxlayer:3.0.2'
//implementation 'org.jzy3d:jzy3d-api:0.9.1' //incompatible with used 0.9.0!, 1.0.2
implementation name: 'jogl2/gluegen'
implementation name: 'jogl2/jogl-all'
implementation name: 'jogl2/gluegen-rt'
implementation name: 'jogl2/jogl-all-natives-linux-amd64'
implementation name: 'jogl2/gluegen-rt-natives-linux-amd64'
implementation name: 'jogl2/jogl-all-natives-linux-i586'
implementation name: 'jogl2/gluegen-rt-natives-linux-i586'
implementation name: 'jogl2/jogl-all-natives-macosx-universal'
implementation name: 'jogl2/gluegen-rt-natives-macosx-universal'
implementation name: 'jogl2/jogl-all-natives-windows-amd64'
implementation name: 'jogl2/gluegen-rt-natives-windows-amd64'
implementation name: 'jogl2/jogl-all-natives-windows-i586'
implementation name: 'jogl2/gluegen-rt-natives-windows-i586'
implementation name: 'jogl2/org.jzy3d-0.9'
//implementation 'com.l2fprod.common:l2fprod-common-all:7.3.0'
implementation name: 'l2fprod-common-all'
runtimeOnly 'log4j:log4j:1.2.17' // Needed for gpsinput
implementation 'org.apache.logging.log4j:log4j-api:2.17.1'
implementation 'org.apache.logging.log4j:log4j-core:2.17.1'
implementation 'net.sf.marineapi:marineapi:0.11.0'
implementation 'com.drewnoakes:metadata-extractor:2.11.0' //2.13.0
implementation 'com.miglayout:miglayout-swing:4.2' //5.2
implementation 'com.eclipsesource.minimal-json:minimal-json:0.9.4' //0.9.5
//implementation 'edu.ucar:cdm-core:5.2.0'
//runtimeOnly 'org.slf4j:slf4j-jdk14:${slf4jVersion}''
//implementation 'edu.ucar:netcdfAll:5.3.2' //5.3.2, used 5.2 on the current develop, here was 4.6.10
implementation "edu.ucar:cdm-core:5.2.0"
//implementation name: 'netcdfAll-5.2'
implementation 'org.jsoup:jsoup:1.13.1'
implementation name: 'opencv_440'
implementation 'oro:oro:2.0.8' // should be 0 2.1-dev
implementation name: 'percentlayout'
implementation name: 'PSEngine' // Europa planner
implementation name: 'PSEngine-javadoc'
implementation 'org.reflections:reflections:0.9.9' //was 0.9.9-RC1, 0.9.12
implementation 'org.mozilla:rhino:1.7R4' //1.7.12
implementation 'com.fifesoft:rsyntaxtextarea:2.5.8' //3.1.0
implementation 'com.fifesoft:autocomplete:2.5.8' //3.1.0
implementation 'com.fifesoft:languagesupport:2.5.8' //3.1.0
//implementation 'org.rxtx:rxtxcomm:2.0-7pre1'
implementation name: 'RXTXcomm'
implementation 'org.apache.sanselan:sanselan:0.97-incubator' // Check new commons-imaging (changed name)
implementation 'org.apache.commons:commons-imaging:1.0-alpha2'
implementation name: 'sqlitejdbc-v056'
implementation name: 'standby'
implementation 'org.swinglabs.swingx:swingx-all:1.6.5-1'
implementation name: 'speech/cmudict04'
implementation name: 'speech/cmu_time_awb'
implementation name: 'speech/cmu_us_kal'
implementation name: 'speech/freetts'
implementation name: 'speech/cmulex'
implementation name: 'speech/cmutimelex'
implementation name: 'speech/en_us'
implementation name: 'speech/jsapi'
implementation name: 'vtk'
implementation name: 'wms'
implementation 'xerces:xercesImpl:2.7.1' //2.12.0
//implementation 'org.knowm.xchart:xchart-parent:3.5.1'
implementation name: 'xchart-3.5.1'
implementation name: 'xj3d/xj3d-all' // 3D related, possibly to remove
implementation name: 'xj3d/FastInfoset'
implementation name: 'xj3d/aviatrix3d-all'
implementation name: 'xj3d/dis'
implementation name: 'xj3d/disxml'
implementation name: 'xj3d/geoapi'
implementation name: 'xj3d/j3d-org'
implementation name: 'xj3d/jutils'
implementation name: 'xj3d/uri'
implementation name: 'xj3d/vlc_uri'
implementation name: 'xj3d/xj3d-cefx3d'
implementation name: 'xj3d/xj3d-common'
implementation name: 'xj3d/xj3d-config'
implementation name: 'xj3d/xj3d-core'
implementation name: 'xj3d/xj3d-eai'
implementation name: 'xj3d/xj3d-ecmascript'
implementation name: 'xj3d/xj3d-external-sai'
implementation name: 'xj3d/xj3d-images'
implementation name: 'xj3d/xj3d-j3d'
implementation name: 'xj3d/xj3d-java-sai'
implementation name: 'xj3d/xj3d-jaxp'
implementation name: 'xj3d/xj3d-jsai'
implementation name: 'xj3d/xj3d-net'
implementation name: 'xj3d/xj3d-norender'
implementation name: 'xj3d/xj3d-ogl'
implementation name: 'xj3d/xj3d-parser'
implementation name: 'xj3d/xj3d-render'
implementation name: 'xj3d/xj3d-runtime'
implementation name: 'xj3d/xj3d-sai'
implementation name: 'xj3d/xj3d-sav'
implementation name: 'xj3d/xj3d-script-base'
implementation name: 'xj3d/xj3d-xml-util'
implementation name: 'xj3d/xj3d-xml'
implementation 'com.adobe.xmp:xmpcore:5.1.2' //6.1.10
implementation name: 'xuggle-xuggler-5.4'
implementation 'io.humble:humble-video-all:0.3.0' // Needs to be in the core because of the dll/so libs
implementation 'com.google.zxing:javase:3.2.1' //3.4.0
// Java 11 related
implementation 'javax.annotation:javax.annotation-api:1.3.2'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
sourceSets {
main {
java {
srcDirs = ['java']
}
resources {
srcDirs = ['resources']
}
}
}
processResources {
duplicatesStrategy DuplicatesStrategy.INCLUDE
outputs.upToDateWhen{ false }
from (project.sourceSets.main.resources.srcDirs) {
include 'version.txt'
filter{ it.replaceAll("@VERSION@", rootProject.version) }
filter{ it.replaceAll("@NAMED_RELEASE@", rootProject.version) }
filter{ it.replaceAll('@DATE@', "${new Date().format('yyyy-MM-dd')}") }
filter{ it.replaceAll('@TIME@', "${new Date().format('HH:mm Z')}") }
filter{ it.replaceAll('@COMPILED BY@', "${System.properties['user.name']}") }
filter{ it.replaceAll('@LEGAL_COPY@', "$rootProject.ext.copyYears FEUP USTL/LSTS (https://www.fe.up.pt/lsts)") }
filter{ it.replaceAll("@SCM_REV@", "${-> project.ext.gitProps['git.commit.id.describe']}") }
filter{ it.replaceAll("@SCM_PATH@", "${-> project.ext.gitProps['git.remote.origin.url']}") }
}
}
buildDir = file("$rootProject.rootDir/build/$project.name")
eclipse {
classpath {
// defaultOutputDir = file("${rootProject.buildDir.getName()}/eclipse/default")
// file.whenMerged {
// def subProjectJarWasIn = []
// entries.each { entry ->
// if (entry.kind == 'src' && entry.hasProperty('output')) {
// // Let us replace the output from bin to the proper build folder
// entry.output = entry.output.replace('bin/', "${rootProject.buildDir.getName()}/eclipse/")
// }
// }
// }
}
project {
resourceFilter {
appliesTo = 'FOLDERS'
type = 'EXCLUDE_ALL'
matcher {
id = 'org.eclipse.ui.ide.multiFilter'
arguments = '1.0-name-matches-false-false-build'
}
}
}
jdt {
file {
withProperties { properties ->
def formaterFx = rootProject.file('dev-utils/eclipse-java-formater.props')
assert rootProject.file(formaterFx).exists();
formaterFx.eachLine { String line ->
def tks = line.split('=')
// set properties for the file org.eclipse.jdt.core.prefs
properties[tks[0]] = tks[1]
}
}
}
}
}
task createEclipseBuild {
doLast {
file("${rootProject.buildDir.getName()}/eclipse/main")
subprojects.each { project ->
file("${project.projectDir}/${rootProject.buildDir.getName()}/eclipse/main").mkdirs()
}
}
}
tasks.eclipse.dependsOn cleanEclipse, createEclipseBuild
// jar.dependsOn generateRunScripts
jar {
archiveBaseName = rootProject.name
manifest {
attributes += [
'Main-Class': 'pt.lsts.neptus.loader.NeptusMain',
]
}
archiveVersion = ''
destinationDirectory = file("$rootDir/bin")
}
compileJava.mustRunAfter(generateRunScripts)
artifacts {
core jar
}
}
////////////////////////////
// Configurations Section //
////////////////////////////
// Configure all tasks of type CreateStartScripts to use custom templates
tasks.withType(CreateStartScripts) {
def unixTemplateName = rootProject.file('dist/scripts/unixStartScript.txt')
assert project.file(unixTemplateName).exists();
def winTemplateName = rootProject.file('dist/scripts/windowsStartScript.txt')
assert project.file(winTemplateName).exists();
unixStartScriptGenerator.template = rootProject.resources.text.fromFile(unixTemplateName)
windowsStartScriptGenerator.template = rootProject.resources.text.fromFile(winTemplateName)
}
// Configure all tasks of type Tar to also GZIP it
tasks.withType(Tar){
compression = Compression.GZIP
archiveExtension = 'tar.gz'
}
// Adding also flat dir lib from plugins for running from Gradle
// Also set on allProjects section
repositories {
flatDir {
dirs subprojects.findAll( { it.name != 'core' } ).collect {file("${it.projectDir}/lib")}
}
}
// This is used to run Neptus, so depends on core project and all plugin projects
dependencies {
runtimeOnly project(':core')
subprojects.findAll( { it.name != 'core' } ).each {
runtimeOnly it
}
}
//////////////////////////
// Sub-Projects Section //
//////////////////////////
// Let us configure all subprojects with the exception of the core
configure(subprojects.findAll { it.name != 'core' }) {
configurations {
plugin
}
sourceSets {
main {
java {
srcDirs += ['src/java']
}
resources {
srcDirs += ['src/resources']
}
}
}
processResources {
duplicatesStrategy DuplicatesStrategy.EXCLUDE
outputs.upToDateWhen { false }
from('.'){
include 'plugins.lst'
filter{ it.replaceAll('@DATE@', "${new Date().format('yyyy-MM-dd')}") }
filter{ it.replaceAll('@TIME@', "${new Date().format('HH:mm Z')}") }
filter{ it.replaceAll('@COMPILED BY@', "${System.properties['user.name']}") }
filter{ it.replaceAll('@LEGAL_COPY@', "$rootProject.ext.copyYears FEUP LSTS/USTL") }
}
}
dependencies {
compileOnly project(':core')
compileOnly project(':core').sourceSets.main.runtimeClasspath
}
buildDir = file("$rootProject.buildDir/plugins/$project.name")
apply plugin: 'eclipse'
eclipse {
classpath {
// defaultOutputDir = file("${rootProject.buildDir.getName()}/eclipse/default")
// file.whenMerged {
// entries.each { entry ->
// // Let us replace the output from bin to the proper build folder
// if (entry.kind == 'src' && entry.hasProperty('output')) {
// entry.output = entry.output.replace('bin/', "${rootProject.buildDir.getName()}/eclipse/")
// }
// }
// }
}
project {
resourceFilter {
appliesTo = 'FOLDERS'
type = 'EXCLUDE_ALL'
matcher {
id = 'org.eclipse.ui.ide.multiFilter'
arguments = '1.0-name-matches-false-false-build'
}
}
}
jdt {
file {
withProperties { properties ->
def formaterFx = rootProject.file('dev-utils/eclipse-java-formater.props')
assert rootProject.file(formaterFx).exists();
formaterFx.eachLine { String line ->
def tks = line.split('=')
// set properties for the file org.eclipse.jdt.core.prefs
properties[tks[0]] = tks[1]
}
}
}
}
}
tasks.eclipse.dependsOn cleanEclipse
compileJava {
dependsOn ':core:jar'
}
jar {
archiveVersion = ''
destinationDirectory = file("$rootDir/plugins")
duplicatesStrategy DuplicatesStrategy.EXCLUDE
from sourceSets.main.output
dependsOn configurations.runtimeClasspath
duplicatesStrategy DuplicatesStrategy.INCLUDE
from {
(project.configurations.runtimeClasspath - project(':core').sourceSets.main.runtimeClasspath)
.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}
// doLast {
// (project.configurations.runtimeClasspath - project(':core').sourceSets.main.runtimeClasspath)
// .findAll { it.name.endsWith('jar') }.each {print "$project >>>> "; println it}
// }
}
artifacts {
plugin jar
}
}
///////////////////
// Build Section //
///////////////////
task buildJars {
description = "Generate $rootProject.name and plugins"
group = 'Build'
dependsOn jar, subprojects.findAll().collect {it.tasks.withType(Jar).collect{it}}
}
run.dependsOn buildJars
/////////////////////
// Bundles Section //
/////////////////////
// Creates the bin/bundles neptus-worldmap.jar
task buildWorldmapBundleJar(type: Jar) {
dependsOn buildJars
archiveBaseName = "${rootProject.name}"
archiveClassifier = 'worldmap'
archiveVersion = ''
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
destinationDirectory = file("$rootDir/bin-bundles")
includeEmptyDirs = false
manifest {
attributes(
'Specification-Title': rootProject.name.capitalize(),
'Specification-Version': "$project.version, ${-> project.ext.gitProps['git.commit.time']}",
'Specification-Vendor': 'FEUP USTL/LSTS (https://www.fe.up.pt/lsts) Neptus (https://lsts.fe.up.pt/toolchain/neptus)',
'Implementation-Title': "${project.name}-worldmap",
'Implementation-Version': project.version,
'Implementation-Vendor': 'FEUP USTL/LSTS (https://www.fe.up.pt/lsts)',
'Build-Revision': "${rootProject.name}-${project.version}-git#${-> project.ext.gitProps['git.commit.id.describe']}",
'Built-By': "${System.properties['user.name']}",
'Built-On': "${new Date()}",
'Build-Jdk': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Main-Class': 'pt.lsts.neptus.app.tiles.WorldMapPanel',
)
}
dependsOn configurations.runtimeClasspath
from {
configurations.runtimeClasspath.findAll {
if (!it.name.endsWith('jar'))
return false
def ret = false
ret |= it.name.contains('dom4j')
ret |= it.name.contains('jaxen')
ret |= it.name.contains('l2fprod-common-all')
ret |= it.name.contains('swingx')
ret |= it.name.contains('jgoodies-looks')
ret |= it.name.contains('jgoodies-common')
ret |= it.name.contains('standby')
ret |= it.name.contains('log4j')
// ret |= it.name.contains('itext"/')
ret |= it.name.contains('commons-cli')
ret |= it.name.contains('commons-io')
ret |= it.name.contains('foxtrot')
ret |= it.name.contains('httpclient')
ret |= it.name.contains('httpcore')
ret |= it.name.contains('commons-codec')
ret |= it.name.contains('batik')
ret |= it.name.contains('xml-apis-ext')
ret |= it.name.contains('xmlgraphics-commons')
ret |= it.name.contains('commons-logging')
ret |= it.name.contains('commons-lang3')
ret |= it.name.contains('libimc')
ret |= it.name.contains('miglayout-core')
ret |= it.name.contains('miglayout-swing')
ret |= it.name.contains('reflections')
ret |= it.name.contains('guava')
ret |= it.name.contains('javassist')
ret |= it.getPath().contains('plugins/tiles-extra.jar')
return ret
}.collect { zipTree(it) }
}
from (sourceSets.main.output) {
include 'LICEN*'
include 'git.*'
include 'version.*'
include 'info*'
}
from ("${rootProject.rootDir}/legal") {
into 'legal'
}
from (project(':core').sourceSets.main.output) {
include 'version.txt'
include 'images/neptus-icon.png'
include 'images/neptus-icon1.png'
include 'images/neptus-icon2.png'
include 'images/World_Blank_Map_Mercator_projection.svg'
include 'images/ssh-connect.png'
include 'images/cursors/*.png'
include 'images/files-icons/*.png'
include 'images/menus/*.png'
include 'images/world/*.png'
include '**/*.class'
}
}
// Creates the bin/bundles neptus-check.jar
task buildCheckBundleJar(type: Jar) {
dependsOn buildJars
archiveBaseName = "${rootProject.name}"
archiveClassifier = 'check'
archiveVersion = ''
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
destinationDirectory = file("$rootDir/bin-bundles")
includeEmptyDirs = false
manifest {
attributes(
'Specification-Title': rootProject.name.capitalize(),
'Specification-Version': "$project.version, ${-> project.ext.gitProps['git.commit.time']}",
'Specification-Vendor': 'FEUP USTL/LSTS (https://www.fe.up.pt/lsts) Neptus (https://lsts.fe.up.pt/toolchain/neptus)',
'Implementation-Title': "${project.name}-check",
'Implementation-Version': project.version,
'Implementation-Vendor': 'FEUP USTL/LSTS (https://www.fe.up.pt/lsts)',
'Build-Revision': "${rootProject.name}-${project.version}-git#${-> project.ext.gitProps['git.commit.id.describe']}",
'Built-By': "${System.properties['user.name']}",
'Built-On': "${new Date()}",
'Build-Jdk': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Main-Class': 'pt.lsts.neptus.gui.checklist.ChecklistPanel',
)
}
dependsOn configurations.runtimeClasspath
from {
configurations.runtimeClasspath.findAll {
if (!it.name.endsWith('jar'))
return false
def ret = false
ret |= it.name.contains('dom4j')
ret |= it.name.contains('jaxen')
ret |= it.name.contains('l2fprod-common-all')
ret |= it.name.contains('swingx')
ret |= it.name.contains('jgoodies-looks')
ret |= it.name.contains('jgoodies-common')
ret |= it.name.contains('standby')
ret |= it.name.contains('log4j')
ret |= it.name.contains('itext')
ret |= it.name.contains('commons-cli')
ret |= it.name.contains('commons-lang3')
ret |= it.name.contains('libimc')
ret |= it.getPath().contains('zxing')
return ret
}.collect { zipTree(it) }
}
from (sourceSets.main.output) {
include 'LICEN*'
include 'git.*'
include 'version.*'
include 'info*'
}
from ("${rootProject.rootDir}/legal") {
into 'legal'
}
from (project(':core').sourceSets.main.output) {
include 'version.txt'
include 'images/neptus-icon.png'
include 'images/neptus-icon1.png'
include 'images/neptus-icon2.png'
include 'images/checklists/*.png'
include 'images/files-icons/*.png'
include 'schemas/neptus-checklist.xsd'
include '**/*.class'
}
}
task buildBundleJars {
description = "Generate the bundle Jars"
group = 'Distribution'
dependsOn buildWorldmapBundleJar
}
//////////////////////////
// Distribution Section //
//////////////////////////
tasks.distZip.enabled = false
tasks.distTar.enabled = false
tasks.startScripts.enabled = false
generateStartScriptsFor(rootProject.name, 'full', 'pt.lsts.neptus.loader.NeptusMain',
'', 'RunOptions', rootProject.files(rootProject.file('lib/*')))
generateStartScriptsFor(rootProject.name, 'le', 'pt.lsts.neptus.mc.lauvconsole.LAUVConsole',
'', 'SmallOptions', rootProject.files(rootProject.file('lib/*')))
generateStartScriptsFor(rootProject.name, 'seacon', 'pt.lsts.neptus.mc.lauvconsole.LAUVConsole',
'', 'SmallOptions', rootProject.files(rootProject.file('lib/*')))
tasks.withType(CreateStartScripts).each {
if (it.name.endsWith('StartScripts') && !it.name.startsWith('runStartScripts'))
it.dependsOn generateRunScripts
}
def distCommonSpec = project.copySpec {
def configurationClasspath = configurations.runtimeClasspath
configurationClasspath -= project(':core').configurations.core.allArtifacts.files
subprojects.findAll({it.name != 'core'}).each {