-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
742 lines (676 loc) · 40 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
buildscript {
ext.kotlin_version = '1.8.0' // https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib
ext.junit_version = '5.9.1'
// https://github.com/junit-team/junit5/releases
// https://mvnrepository.com/artifact/org.junit.jupiter
// NOTE that if you upgrade implementations such as the below ngageoint
// then also run CoordinateTestDataGeneratedFromEpsgDatabaseTest
// to generate a file such as "/crs-transformation-adapter-test/src/test/resources/regression_results/CrsTransformationAdapterNgaGeoInt_version_4.0.0.csv"
ext.ngageoint_version = '4.3.0' // https://github.com/ngageoint/simple-features-proj-java/releases/tag/4.1.0
ext.geotools_version = '28.0' // https://repo.osgeo.org/service/rest/repository/browse/release/org/geotools/gt-main/
// Note that the latest versions above and below are different (since "gt-data" tends to be some version number(s) behind) // https://mvnrepository.com/artifact/org.geotools/gt-data?repo=boundless
ext.geotools_data_version = '20.5' // "org.geotools:gt-data:$geotools_data_version" // https://repo.osgeo.org/service/rest/repository/browse/release/org/geotools/gt-data/
ext.slf4j_version = '1.7.36'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// https://mvnrepository.com/artifact/org.jetbrains.dokka/dokka-gradle-plugin
// https://mvnrepository.com/artifact/org.jetbrains.dokka/kotlin-as-java-plugin
// https://github.com/JetBrains/kotlin-examples/blob/master/gradle/dokka-gradle-example/build.gradle
// gradlew dokkaJavadoc
// gradlew :crs-transformation-adapter-core:dokkaJavadoc
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.7.20" // The plugin adds dokkaHtml, dokkaJavadoc, dokkaGfm and dokkaJekyll tasks to the project. https://github.com/Kotlin/dokka
classpath "org.jetbrains.dokka:kotlin-as-java-plugin:1.7.20"
}
}
plugins {
// gradlew publishToMavenLocal
// gradlew publish
// https://oss.sonatype.org/content/repositories/snapshots/com/programmerare/crs-transformation/
id 'maven-publish' // https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven
// the above configuration enables the tasks "publish" and "publishToMavenLocal"
// which you can verify by running "gradlew tasks" (i.e. run the command with and without the above 'maven-publish')
id 'signing'
// activate "oss_sonatype_org_username" etc further down in this file when releasing
}
// https://semver.org
// Given a version number MAJOR.MINOR.PATCH, increment the:
// MAJOR version when you make incompatible API changes,
// MINOR version when you add functionality in a backwards-compatible manner, and
// PATCH version when you make backwards-compatible bug fixes.
// The version number below ("ext.crsTransformationVersion") should be the same as in
// the method 'CrsTransformationAdapterComposite.getVersionOfImplementationAdapteeLibrary()'
ext.snapshotSuffixOrEmpty = "-SNAPSHOT" // this value should be equal to "-SNAPSHOT" or "" (for a release)
ext.crsTransformationGroupId = 'com.programmerare.crs-transformation'
// The below version number is used for all artifacts EXCEPT "crs-transformation-constants" which has a release number corresponding to the version number used by EPSG at http://www.epsg-registry.org
// Note that the major version has now below been updated from 1 to 2 because of:
// removed the type CrsTransformationAdapteeType which has been deprecated since version 1.1.0 , https://github.com/TomasJohansson/crsTransformations/releases/tag/v1.1.0
// removed deprecated 'CrsTransformationAdapterBase' method open fun getNameOfJarFileOrEmptyString (deprecated since 1.1.1)
// removed deprecated 'CrsTransformationAdapterBase' method protected final fun getNameOfJarFileFromProtectionDomain (deprecated since 1.1.1)
ext.crsTransformationVersion = '2.0.2' + rootProject.snapshotSuffixOrEmpty
// currently the above crsTransformationVersion number should be used in the method CrsTransformationAdapterComposite.getVersionOfImplementationAdapteeLibrary()
// TODO: try to avoid the above mentioned duplication in CrsTransformationAdapterComposite
// for example as below:
// ext.crsTransformationVersion = "${com.programmerare.crsTransformations.compositeTransformations.CrsTransformationAdapterCompositeFactory.Version}"
// https://discuss.gradle.org/t/access-constant-from-groovy-class-in-gradle-buildfile/10571/3
group = rootProject.crsTransformationGroupId
version = rootProject.crsTransformationVersion
ext.isReleaseVersion = !rootProject.snapshotSuffixOrEmpty.endsWith("SNAPSHOT")
ext.mavenPomUrl = "https://github.com/TomasJohansson/crsTransformations"
ext.mavenPomDeveloperName = "Tomas Johansson"
ext.mavenPomDeveloperOrganizationUrl = "https://programmerare.com"
ext.mavenPomScmConnection = "scm:git:git://github.com/TomasJohansson/crsTransformations.git"
ext.mavenPomScmDeveloperConnection = "scm:git:ssh://github.com/TomasJohansson/crsTransformations.git"
ext.mavenPomScmUrl = "https://github.com/TomasJohansson/crsTransformations"
allprojects {
group = rootProject.crsTransformationGroupId
version = rootProject.crsTransformationVersion
repositories {
maven {
url "https://repo.osgeo.org/repository/release/"
}
maven {
url "https://download.osgeo.org/webdav/geotools/"
// https://github.com/akhikhl/gretty/issues/322
// https://download.osgeo.org/webdav/geotools/org/geotools/gt-main/
// https://download.osgeo.org/webdav/geotools/javax/media/jai_core/1.1.3/
}
/*
Problem with geotoolkit.org when upgrading to Kotlin 1.3.10 :
Could not resolve org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.10.
> Could not get resource 'http://maven.geotoolkit.org/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.3.10/kotlin-compiler-embeddable-1.3.10.pom'.
> Could not HEAD 'http://maven.geotoolkit.org/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.3.10/kotlin-compiler-embeddable-1.3.10.pom'. Received status code 502 from server: Bad Gateway
maven {
url "http://maven.geotoolkit.org/"
}
// I do not remember for sure but I believe the above geotoolkit was added because of problems
// with jai_core but now it seems to work without it which may be because
// the following has been added: exclude group: 'javax.media', module: 'jai_core'
*/
maven {
url "https://repo.boundlessgeo.com/release/"
}
mavenCentral()
// jcenter() // jcenter() method has been deprecated. This is scheduled to be removed in Gradle 8.0. , https://docs.gradle.org/7.1.1/userguide/upgrading_version_6.html#jcenter_deprecation
google()
}
}
subprojects { p->
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.dokka' // The plugin adds dokkaHtml, dokkaJavadoc, dokkaGfm and dokkaJekyll tasks to the project. https://github.com/Kotlin/dokka
sourceCompatibility = 1.8
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.javaParameters = true //Will retain parameter names e.g. useful for intellisense parameter information instead of "arg0" and "arg1" and so on
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
// gradlew dokkaJavadoc
// gradlew :crs-transformation-adapter-core:dokkaJavadoc
task dokkadocJar(type: Jar, dependsOn: dokkaJavadoc) {
classifier 'javadoc'
from dokkaJavadoc
}
task javadocTask(type: Javadoc) {
source = sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadocTask) {
classifier 'javadoc'
from javadoc
}
// https://docs.gradle.org/current/dsl/org.gradle.api.publish.maven.MavenPublication.html
// https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html
task sourcesJar(type: Jar) {
// from sourceSets.main.java // this sourceSets setting was used when generating "crs-transformation-constants" version 9.8.9
from sourceSets.main.allSource
archiveClassifier = "sources"
includeEmptyDirs false
}
// https://solidsoft.wordpress.com/2014/11/13/gradle-tricks-display-dependencies-for-all-subprojects-in-multi-project-build/
// https://stackoverflow.com/questions/44266687/how-to-print-out-all-dependencies-in-a-gradle-multi-project-build
// gradlew printDependencies > dependencies.txt
task printDependencies(type: DependencyReportTask) {}
if(!p.name.equals("crs-transformation-constants")) {
dependencies {
// implementation("org.jetbrains.kotlin:kotlin-runtime:$kotlin_version")
// "Kotlin Runtime (deprecated, use kotlin-stdlib artifact instead)"
// https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-runtime
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version")
// https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib-jdk8/
}
}
test {
// Enable JUnit 5 (Gradle 4.6+).
useJUnitPlatform()
// Always run tests, even when nothing changed.
// dependsOn 'cleanTest'
testLogging {
events "passed", "skipped", "failed" // , "standardOut", "standardError"
}
}
}
// ---------------------------------------------------------------------------
// Note that when any of the five (GeoTools , Goober , Orbis , Proj4j , NGA)
// third-part libraries below are upgraded then new test files
// should be generated with CoordinateTestDataGeneratedFromEpsgDatabaseTest
// (with the new version number in the file suffix) and compared with previous result
// (e.g. comparing the files manually with WinMerge until more automation has been implemented)
// ---------------------------------------------------------------------------
project(':crs-transformation-adapter-impl-geotools') {
// Clients should also add the following maven repository: "https://download.osgeo.org/webdav/geotools/"
dependencies {
api project(':crs-transformation-adapter-core')
// regarding "api" (used above) vs "implementation" (used further below):
// https://docs.gradle.org/current/userguide/java_library_plugin.html
// > Dependencies appearing in the api configurations will be transitively exposed to consumers of the library,
// > and as such will appear on the compile classpath of consumers.
// > Dependencies found in the implementation configuration will, on the other hand, not be exposed to consumers
// Gradle dependencies api/implementation vs Maven dependency scopes compile/runtime :
// https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
// https://reflectoring.io/maven-scopes-gradle-configurations/
// https://mvnrepository.com/artifact/org.geotools/gt-main?repo=boundless
// NOTE that if you upgrade then use file CoordinateTestDataGeneratedFromEpsgDatabaseTest
// test code will detect upgrades with the purpose to update an enum if the file name changes from "gt-api-21.2.jar"
implementation("org.geotools:gt-main:$geotools_version"){
exclude group: 'javax.media', module: 'jai_core'
// https://docs.gradle.org/current/userguide/managing_transitive_dependencies.html
}
implementation("org.geotools:gt-epsg-hsql:$geotools_version") { // runtime exception if this is not included: org.opengis.referencing.NoSuchAuthorityCodeException: No code "EPSG:4326" from authority "EPSG" found for object of type "EngineeringCRS".
exclude group: 'javax.media', module: 'jai_core'
}
// implementation("javax.media:jai_core:1.1.3") // otherwise geotools causes this: Could not find jai_core.jar (javax.media:jai_core:1.1.3)
// https://mvnrepository.com/artifact/org.geotools/gt-data?repo=boundless
// https://mvnrepository.com/artifact/org.geotools/gt-shapefile?repo=boundless
// https://mvnrepository.com/artifact/org.geotools/gt-main?repo=boundless
// https://mvnrepository.com/artifact/org.geotools/gt-epsg-hsql?repo=boundless
// http://geotools.org/
// https://sourceforge.net/projects/geotools/
// Used for shapefile parsing in the code generation module:
// implementation group: 'org.geotools', name: 'gt-data', version: '20.5' // NOTE that if you upgrade then use file CoordinateTestDataGeneratedFromEpsgDatabaseTest
// implementation group: 'org.geotools', name: 'gt-shapefile', version: '21.2' // https://mvnrepository.com/artifact/org.geotools/gt-shapefile?repo=boundless
}
publishing {
publications {
crstransformationsgeotools(MavenPublication) {
artifactId = 'crs-transformation-adapter-impl-geotools'
from components.java
artifact sourcesJar
artifact dokkadocJar
pom {
// https://central.sonatype.org/pages/requirements.html
// A common and acceptable practice for name is to assemble it from the coordinates using Maven properties:
// <name>${project.groupId}:${project.artifactId}</name>
name = rootProject.crsTransformationGroupId + ":" + artifactId
description = 'Coordinate Reference System Transformations adapter implementation using the adaptee third-part library GeoTools.'
url = rootProject.mavenPomUrl
licenses {
license {
name = 'LGPL (GNU Lesser General Public License)'
url = 'http://docs.geotools.org/latest/userguide/welcome/license.html'
comments = 'LGPL i.e. the same license as the used adaptee third-part library GeoTools. The artifact crs-transformation-adapter-impl-geotools is using GeoTools and the same license LGPL.'
}
}
developers {
developer {
name = rootProject.mavenPomDeveloperName
organizationUrl = rootProject.mavenPomDeveloperOrganizationUrl
}
}
scm {
connection = rootProject.mavenPomScmConnection
developerConnection = rootProject.mavenPomScmDeveloperConnection
url = rootProject.mavenPomScmUrl
}
}
}
}
}
}
project(':crs-transformation-adapter-impl-goober') {
dependencies {
api project(':crs-transformation-adapter-core')
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
implementation("org.slf4j:slf4j-api:$slf4j_version")
// https://mvnrepository.com/artifact/com.github.goober/coordinate-transformation-library
implementation("com.github.goober:coordinate-transformation-library:1.1") // NOTE that if you upgrade then use file CoordinateTestDataGeneratedFromEpsgDatabaseTest
// test code will detect upgrades with the purpose to update an enum if the file name changes from "coordinate-transformation-library-1.1.jar"
}
publishing {
publications {
crstransformationsgoober(MavenPublication) {
artifactId = 'crs-transformation-adapter-impl-goober'
from components.java
artifact sourcesJar
artifact dokkadocJar
pom {
// https://central.sonatype.org/pages/requirements.html
// A common and acceptable practice for name is to assemble it from the coordinates using Maven properties:
// <name>${project.groupId}:${project.artifactId}</name>
name = rootProject.crsTransformationGroupId + ":" + artifactId
description = 'Coordinate Reference System Transformations adapter implementation using the adaptee third-part library goober/coordinate-transformation-library.'
url = rootProject.mavenPomUrl
licenses {
license {
name = 'Apache License 2.0'
url = 'https://github.com/goober/coordinate-transformation-library/blob/master/LICENSE'
comments = 'Apache License 2.0, i.e. the same license as the used adaptee third-part library goober/coordinate-transformation-library. The artifact crs-transformation-adapter-impl-goober is using goober/coordinate-transformation-library and the same license Apache License 2.0.'
}
}
developers {
developer {
name = rootProject.mavenPomDeveloperName
organizationUrl = rootProject.mavenPomDeveloperOrganizationUrl
}
}
scm {
connection = rootProject.mavenPomScmConnection
developerConnection = rootProject.mavenPomScmDeveloperConnection
url = rootProject.mavenPomScmUrl
}
}
}
}
}
}
project(':crs-transformation-adapter-impl-orbisgis') {
dependencies {
api project(':crs-transformation-adapter-core')
// https://mvnrepository.com/artifact/org.orbisgis/cts
implementation("org.orbisgis:cts:1.7.0") // NOTE that if you upgrade then use file CoordinateTestDataGeneratedFromEpsgDatabaseTest
// test code will detect upgrades with the purpose to update an enum if the file name changes from "cts-1.7.0.jar"
}
publishing {
publications {
crstransformationsorbisgis(MavenPublication) {
artifactId = 'crs-transformation-adapter-impl-orbisgis'
from components.java
artifact sourcesJar
artifact dokkadocJar
pom {
// https://central.sonatype.org/pages/requirements.html
// A common and acceptable practice for name is to assemble it from the coordinates using Maven properties:
// <name>${project.groupId}:${project.artifactId}</name>
name = rootProject.crsTransformationGroupId + ":" + artifactId
description = 'Coordinate Reference System Transformations adapter implementation using the adaptee third-part library orbisgis/cts.'
url = rootProject.mavenPomUrl
licenses {
license {
name = 'GNU Lesser General Public License (LGPLV3+)'
url = 'https://github.com/orbisgis/cts/blob/master/pom.xml'
comments = 'LGPLV3+, i.e. the same license as the used adaptee third-part library orbisgis/cts. The artifact crs-transformation-adapter-impl-orbisgis is using orbisgis/cts and the same license LGPLV3+'
}
}
developers {
developer {
name = rootProject.mavenPomDeveloperName
organizationUrl = rootProject.mavenPomDeveloperOrganizationUrl
}
}
scm {
connection = rootProject.mavenPomScmConnection
developerConnection = rootProject.mavenPomScmDeveloperConnection
url = rootProject.mavenPomScmUrl
}
}
}
}
}
}
project(':crs-transformation-adapter-impl-proj4jlocationtech') {
dependencies {
api project(':crs-transformation-adapter-core')
// https://mvnrepository.com/artifact/org.locationtech.proj4j/proj4j/
implementation("org.locationtech.proj4j:proj4j:1.2.2")
// https://mvnrepository.com/artifact/org.locationtech.proj4j/proj4j-epsg
implementation("org.locationtech.proj4j:proj4j-epsg:1.2.2")
}
publishing {
publications {
crstransformationsproj4jlocationtech(MavenPublication) {
artifactId = 'crs-transformation-adapter-impl-proj4jlocationtech'
from components.java
artifact sourcesJar
artifact dokkadocJar
pom {
// https://central.sonatype.org/pages/requirements.html
// A common and acceptable practice for name is to assemble it from the coordinates using Maven properties:
// <name>${project.groupId}:${project.artifactId}</name>
name = rootProject.crsTransformationGroupId + ":" + artifactId
description = 'Coordinate Reference System Transformations adapter implementation using the adaptee third-part library locationtech/proj4j.'
url = rootProject.mavenPomUrl
licenses {
license {
name = 'Apache License 2.0'
url = 'https://github.com/locationtech/proj4j'
comments = 'Apache License 2.0, i.e. the same license as the used adaptee third-part library locationtech/proj4j. The artifact crs-transformation-adapter-impl-proj4jlocationtech is using locationtech/proj4j and the same license Apache License 2.0.'
}
}
developers {
developer {
name = rootProject.mavenPomDeveloperName
organizationUrl = rootProject.mavenPomDeveloperOrganizationUrl
}
}
scm {
connection = rootProject.mavenPomScmConnection
developerConnection = rootProject.mavenPomScmDeveloperConnection
url = rootProject.mavenPomScmUrl
}
}
}
}
}
}
project(':crs-transformation-adapter-impl-proj4j') {
dependencies {
api project(':crs-transformation-adapter-core')
// https://mvnrepository.com/artifact/org.osgeo/proj4j
implementation("org.osgeo:proj4j:0.1.0") // NOTE that if you upgrade then use file CoordinateTestDataGeneratedFromEpsgDatabaseTest
// test code will detect upgrades with the purpose to update an enum if the file name changes from "proj4j-0.1.0.jar"
}
publishing {
publications {
crstransformationsproj4j(MavenPublication) {
artifactId = 'crs-transformation-adapter-impl-proj4j'
from components.java
artifact sourcesJar
artifact dokkadocJar
pom {
// https://central.sonatype.org/pages/requirements.html
// A common and acceptable practice for name is to assemble it from the coordinates using Maven properties:
// <name>${project.groupId}:${project.artifactId}</name>
name = rootProject.crsTransformationGroupId + ":" + artifactId
description = 'Coordinate Reference System Transformations adapter implementation using the adaptee third-part library proj4j.'
url = rootProject.mavenPomUrl
licenses {
license {
name = 'Apache License 2.0'
url = 'https://github.com/Proj4J/proj4j'
comments = 'Apache License 2.0, i.e. the same license as the used adaptee third-part library proj4j. The artifact crs-transformation-adapter-impl-proj4j is using proj4j and the same license Apache License 2.0.'
}
}
developers {
developer {
name = rootProject.mavenPomDeveloperName
organizationUrl = rootProject.mavenPomDeveloperOrganizationUrl
}
}
scm {
connection = rootProject.mavenPomScmConnection
developerConnection = rootProject.mavenPomScmDeveloperConnection
url = rootProject.mavenPomScmUrl
}
}
}
}
}
}
project(':crs-transformation-adapter-impl-nga') {
dependencies {
api project(':crs-transformation-adapter-core')
// https://mvnrepository.com/artifact/mil.nga.sf/sf-proj
// https://github.com/ngageoint/simple-features-proj-java
implementation("mil.nga.sf:sf-proj:$ngageoint_version") // NOTE that if you upgrade then use file CoordinateTestDataGeneratedFromEpsgDatabaseTest
}
publishing {
publications {
crstransformationsnga(MavenPublication) {
artifactId = 'crs-transformation-adapter-impl-nga'
from components.java
artifact sourcesJar
artifact dokkadocJar
pom {
// https://central.sonatype.org/pages/requirements.html
// A common and acceptable practice for name is to assemble it from the coordinates using Maven properties:
// <name>${project.groupId}:${project.artifactId}</name>
name = rootProject.crsTransformationGroupId + ":" + artifactId
description = 'Coordinate Reference System Transformations adapter implementation using the adaptee third-part library ngageoint/simple-features-proj-java.'
url = rootProject.mavenPomUrl
licenses {
license {
name = 'MIT License'
url = 'https://github.com/ngageoint/simple-features-proj-java/blob/master/LICENSE.txt'
comments = 'MIT License, i.e. the same license as the used adaptee third-part library ngageoint/simple-features-proj-java. The artifact crs-transformation-adapter-impl-nga is using ngageoint/simple-features-proj-java and the same license MIT.'
}
}
developers {
developer {
name = rootProject.mavenPomDeveloperName
organizationUrl = rootProject.mavenPomDeveloperOrganizationUrl
}
}
scm {
connection = rootProject.mavenPomScmConnection
developerConnection = rootProject.mavenPomScmDeveloperConnection
url = rootProject.mavenPomScmUrl
}
}
}
}
}
}
project(':crs-transformation-adapter-test') {
dependencies {
implementation project(':crs-transformation-adapter-core'), project(':crs-transformation-adapter-impl-orbisgis'), project(':crs-transformation-adapter-impl-goober'), project(':crs-transformation-adapter-impl-geotools'), project(':crs-transformation-adapter-impl-proj4j'), project(':crs-transformation-adapter-impl-proj4jlocationtech'), project(':crs-transformation-adapter-impl-nga'), project(':crs-transformation-constants')
// https://mvnrepository.com/artifact/org.geotools/gt-shapefile
// implementation("group:org.geotools:gt-shapefile:19.1")
// implementation("group:org.geotools:gt-data:19.1")
// implementation("group:org.geotools:gt-shapefile:19.1")
// https://mvnrepository.com/artifact/org.geotools/gt-shapefile
// implementation group: 'org.geotools', name: 'gt-shapefile', version: '19.1'
// https://mvnrepository.com/artifact/org.mockito/mockito-core
testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.11.0'
// https://mvnrepository.com/artifact/org.junit.jupiter
// https://github.com/junit-team/junit5/releases
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junit_version")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junit_version")
// https://mvnrepository.com/artifact/org.hamcrest/hamcrest
// https://github.com/hamcrest/JavaHamcrest/releases
testImplementation("org.hamcrest:hamcrest:2.2")
// https://mvnrepository.com/artifact/com.google.guava/guava
// https://github.com/google/guava/releases
testImplementation group: 'com.google.guava', name: 'guava', version: '31.1-jre' // com.google.common.io
}
}
project(':crs-transformation-code-generation') {
// command line execution examples:
// gradle generateClassesWithEpsgConstants --args="v9_8_9 epsg_version_9_8_9 dbUserName dbUserPassword java"
// gradle generateClassesWithEpsgConstants --args="v9_8_9 epsg_version_9_8_9 dbUserName dbUserPassword csv"
task generateClassesWithEpsgConstants(type:JavaExec) {
mainClass = project.hasProperty("mainClass") ? project.getProperty("mainClass") : "com.programmerare.crsCodeGeneration.constantsGenerator.ConstantClassGenerator"
classpath = sourceSets.main.runtimeClasspath
}
// command line execution
// gradle generateCsvTestDataFromEpsgDatabaseAndShapefile
// or, if something else than the default/hardcoded class name should be used:
// gradle generateCsvTestDataFromEpsgDatabaseAndShapefile -PmainClass=com.programmerare.crs-transformation-adapter-impl-code-generation.coordinateTestDataGenerator.CoordinateTestDataGenerator
task generateCsvTestDataFromEpsgDatabaseAndShapefile(type:JavaExec) {
mainClass = project.hasProperty("mainClass") ? project.getProperty("mainClass") : "com.programmerare.crs-transformation-adapter-impl-code-generation.coordinateTestDataGenerator.CoordinateTestDataGenerator"
classpath = sourceSets.main.runtimeClasspath
}
dependencies {
// https://mvnrepository.com/artifact/org.freemarker/freemarker
implementation("org.freemarker:freemarker:2.3.31")
// https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client
implementation("org.mariadb.jdbc:mariadb-java-client:2.7.3")
// https://mvnrepository.com/artifact/org.springframework/spring-jdbc
// https://github.com/spring-projects/spring-framework/releases
implementation("org.springframework:spring-jdbc:5.3.8")
// https://mvnrepository.com/artifact/org.junit.jupiter
// https://github.com/junit-team/junit5/releases
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junit_version")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junit_version")
// https://mvnrepository.com/artifact/org.geotools/gt-main?repo=boundless
// implementation("org.geotools:gt-main:21.2") // NOTE that if you upgrade then use file CoordinateTestDataGeneratedFromEpsgDatabaseTest
// implementation("org.geotools:gt-epsg-hsql:21.2") // runtime exception if this is not included: org.opengis.referencing.NoSuchAuthorityCodeException: No code "EPSG:4326" from authority "EPSG" found for object of type "EngineeringCRS".
// implementation("javax.media:jai_core:1.1.3") // otherwise geotools causes this: Could not find jai_core.jar (javax.media:jai_core:1.1.3)
// https://mvnrepository.com/artifact/org.geotools/gt-data?repo=boundless
// https://mvnrepository.com/artifact/org.geotools/gt-shapefile?repo=boundless
// https://mvnrepository.com/artifact/org.geotools/gt-main?repo=boundless
// https://mvnrepository.com/artifact/org.geotools/gt-epsg-hsql?repo=boundless
// http://geotools.org/
// https://sourceforge.net/projects/geotools/
// Used for shapefile parsing in the code generation module:
// NOTE that if you upgrade then use file CoordinateTestDataGeneratedFromEpsgDatabaseTest
implementation("org.geotools:gt-data:$geotools_data_version"){
exclude group: 'javax.media', module: 'jai_core'
}
// ClassNotFoundException: org.geotools.factory.Hints
// the exception at the above line was solved by making sure to use the same version above and below
// i.e. $geotools_data_version for both 'gt-data' and 'gt-shapefile'
implementation("org.geotools:gt-shapefile:$geotools_data_version") {
exclude group: 'javax.media', module: 'jai_core'
}
}
}
project(':crs-transformation-adapter-core') {
publishing {
publications {
crstransformationscore(MavenPublication) {
artifactId = 'crs-transformation-adapter-core'
from components.java
artifact sourcesJar
artifact dokkadocJar
pom {
// https://central.sonatype.org/pages/requirements.html
// A common and acceptable practice for name is to assemble it from the coordinates using Maven properties:
// <name>${project.groupId}:${project.artifactId}</name>
name = rootProject.crsTransformationGroupId + ":" + artifactId
description = "Coordinate Reference System Transformations. Kotlin/JVM/Java library used for 'converting coordinates between different coordinate systems'. The core library provides an adapter interface which is implemented by other modules using different third-part libraries as adaptees."
url = rootProject.mavenPomUrl
licenses {
license {
name = 'MIT License'
url = 'https://github.com/TomasJohansson/crsTransformations'
comments = 'MIT license for the core library. The adapter libraries have the same license as the adaptee libraries.'
}
}
developers {
developer {
name = rootProject.mavenPomDeveloperName
organizationUrl = rootProject.mavenPomDeveloperOrganizationUrl
}
}
scm {
connection = rootProject.mavenPomScmConnection
developerConnection = rootProject.mavenPomScmDeveloperConnection
url = rootProject.mavenPomScmUrl
}
}
}
}
repositories {
maven {
// gradlew tasks
// gradlew publishCrstransformationscorePublicationToMavenRepository
// https://oss.sonatype.org/content/repositories/snapshots/com/programmerare/crs-transformation/
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = rootProject.crsTransformationVersion.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
// Note that the passwords are different for the sonatype servers e.g. https://oss.sonatype.org and https://s01.oss.sonatype.org/
// and this project is deployed to the server "oss.sonatype.org" i.e. without the "s01." prefix
// and the following username/password is used and defined in [HOME]\.gradle\gradle.properties
username oss_sonatype_org_username
password oss_sonatype_org_password
}
}
}
}
dependencies {
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
implementation("org.slf4j:slf4j-api:$slf4j_version")
// https://mvnrepository.com/artifact/org.junit.jupiter
// https://github.com/junit-team/junit5/releases
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junit_version")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junit_version")
}
}
project(':crs-transformation-constants') {
// When publishing a new version of the constants, then use some configuration like below, to only include the latest version:
sourceSets {
main {
java {
include "**/v10_027/*.java"
}
}
}
publishing {
publications {
crstransformationsconstants(MavenPublication) {
artifactId = 'crs-transformation-constants'
version = '10.027' + rootProject.snapshotSuffixOrEmpty
from components.java
artifact sourcesJar
artifact javadocJar // Only Java code in this project. No Kotlin. Therefore not using dokkadoc here
pom {
// https://central.sonatype.org/pages/requirements.html
// A common and acceptable practice for name is to assemble it from the coordinates using Maven properties:
// gradlew publishCrstransformationsconstantsPublicationToMavenRepository
name = rootProject.crsTransformationGroupId + ":" + artifactId
description = 'Constants with EPSG codes for Coordinate Reference Systems. The version number is the same as the EPSG database at http://www.epsg.org or http://www.epsg-registry.org'
url = rootProject.mavenPomUrl
licenses {
license {
name = 'MIT License'
url = 'https://github.com/TomasJohansson/crsTransformations'
comments = 'MIT license for this library with Java constants for EPSG codes. Regarding the data itself: Ownership of the EPSG Dataset by IOGP is acknowledged. See the URL http://www.epsg.org/TermsOfUse.aspx'
}
license {
name = "Terms of use"
url = 'http://www.epsg.org/TermsOfUse.aspx'
comments = "Some quotes from the 'Terms of use' URL: 'The EPSG database is published by IOGP at no charge. Distribution for profit is forbidden.... Ownership of the EPSG Dataset by IOGP must be acknowledged...' See the URL for detailed information."
}
}
developers {
developer {
name = rootProject.mavenPomDeveloperName
organizationUrl = rootProject.mavenPomDeveloperOrganizationUrl
}
}
scm {
connection = rootProject.mavenPomScmConnection
developerConnection = rootProject.mavenPomScmDeveloperConnection
url = rootProject.mavenPomScmUrl
}
}
}
}
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junit_version")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junit_version")
}
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}
// https://docs.gradle.org/current/userguide/signing_plugin.html
signing {
required { isReleaseVersion }
sign publishing.publications.crstransformationsconstants
sign publishing.publications.crstransformationscore
sign publishing.publications.crstransformationsgeotools
sign publishing.publications.crstransformationsgoober
sign publishing.publications.crstransformationsorbisgis
sign publishing.publications.crstransformationsproj4j
sign publishing.publications.crstransformationsproj4jlocationtech
sign publishing.publications.crstransformationsnga
}
// https://stackoverflow.com/questions/35143514/publishing-of-a-modular-library-to-maven-using-gradle
subprojects{
publishing {
publications {
"$project.name"(MavenPublication) {
groupId project.group
artifactId project.name
version project.version
from components.java
}
}
}
}