Skip to content

Commit

Permalink
Changed the used version of the generated EPSG constants. 9.5.4 ==> 9…
Browse files Browse the repository at this point in the history
….8.9.

Also updated some build.gradle configurations related to generating a release.
This version 9.8.9 of the artifact "crs-transformation-constants" is now released to OSSRH (a.k.a. "Maven Central"):
https://search.maven.org/artifact/com.programmerare.crs-transformation/crs-transformation-constants/9.8.9/jar
  • Loading branch information
TomasJohansson committed Apr 15, 2020
1 parent 8d79d2a commit 0408123
Show file tree
Hide file tree
Showing 39 changed files with 141 additions and 87 deletions.
35 changes: 23 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ plugins {
// 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.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
ext.crsTransformationVersion = '1.1.0' + 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
Expand Down Expand Up @@ -129,21 +130,24 @@ subprojects { p->
}

task dokkadocJar(type: Jar, dependsOn: dokkaJavadoc) {
classifier = 'javadoc'
classifier 'javadoc'
from javadoc.destinationDir
}

task javadocTask(type: Javadoc) {
source = sourceSets.main.allJava
source = sourceSets.main.java
}
task javadocJar(type: Jar, dependsOn: javadocTask) {
classifier = 'javadoc'
classifier 'javadoc'
from javadoc.destinationDir
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource

// 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
archiveClassifier = "sources"
includeEmptyDirs false
}

// https://solidsoft.wordpress.com/2014/11/13/gradle-tricks-display-dependencies-for-all-subprojects-in-multi-project-build/
Expand Down Expand Up @@ -510,8 +514,8 @@ project(':crs-transformation-adapter-test') {

project(':crs-transformation-code-generation') {
// command line execution examples:
// gradle generateClassesWithEpsgConstants --args="v9_5_4 epsg_version_9_5_4 dbUserName dbUserPassword java"
// gradle generateClassesWithEpsgConstants --args="v9_5_4 epsg_version_9_5_4 dbUserName dbUserPassword csv"
// 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) {
main = project.hasProperty("mainClass") ? project.getProperty("mainClass") : "com.programmerare.crsCodeGeneration.constantsGenerator.ConstantClassGenerator"
classpath = sourceSets.main.runtimeClasspath
Expand Down Expand Up @@ -626,14 +630,21 @@ project(':crs-transformation-adapter-core') {
}

project(':crs-transformation-constants') {
sourceSets {
main {
java {
include "**/v9_8_9/*.java"
}
}
}
publishing {
publications {
crstransformationsconstants(MavenPublication) {
artifactId = 'crs-transformation-constants'
version = '9.5.4' + rootProject.snapshotSuffixOrEmpty
version = '9.8.9' + rootProject.snapshotSuffixOrEmpty
from components.java
artifact sourcesJar
artifact javadocJar // Only Java code in this project. No Kotlin. Therfore not using dokkadoc here
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class CrsTransformationAdapterGooberCTL : CrsTransformationAdapterBaseLeaf(), Cr
// then constants would definitely have been preferred,
// but adding 20 constants for only one usage is not very motivated.
// Another option would have been to reuse the already existing constants in the module "crs-transformation-constants" i.e. constants like this:
// com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber.SWEDEN__SWEREF99_TM__3006
// com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber.SWEDEN__SWEREF99_TM__3006
// However, that would introduce a dependency to a module with LOTS OF constants just to use this few values below.

// http://spatialreference.org/ref/?search=rt90
Expand Down Expand Up @@ -164,4 +164,4 @@ class CrsTransformationAdapterGooberCTL : CrsTransformationAdapterBaseLeaf(), Cr
}
// TODO: maybe more validation, for example validate coordinates to be reasonable i.e. within Sweden since this is an implementation with only coordinate systems used in Sweden
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.programmerare.com.programmerare.testData;

import com.google.common.io.Resources; // library "com.google.guava:guava"
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber;
import com.programmerare.crsTransformationAdapterGeoPackageNGA.CrsTransformationAdapterGeoPackageNGA;
import com.programmerare.crsTransformationAdapterGeoTools.CrsTransformationAdapterGeoTools;
import com.programmerare.crsTransformationAdapterGooberCTL.CrsTransformationAdapterGooberCTL;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.programmerare.com.programmerare.testData;

import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber;
import com.programmerare.crsTransformations.*;
import com.programmerare.crsTransformations.compositeTransformations.CrsTransformationAdapterComposite;
import com.programmerare.crsTransformations.compositeTransformations.CrsTransformationAdapterCompositeFactory;
Expand Down Expand Up @@ -724,4 +724,4 @@ public void write(int b) throws IOException {
Coordinate(xEastingLongitude=3.186578287771716E-14, yNorthingLatitude=-74.99999999999775, crsIdentifier=CrsIdentifier(crsCode=EPSG:4326, isEpsgCode=true, epsgNumber=4326)) , com.programmerare.crsTransformationAdapterOrbisgisCTS.CrsTransformationAdapterOrbisgisCTS
Coordinate(xEastingLongitude=3.186578287771716E-14, yNorthingLatitude=-75.00000000000007, crsIdentifier=CrsIdentifier(crsCode=EPSG:4326, isEpsgCode=true, epsgNumber=4326)) , com.programmerare.crsTransformationAdapterProj4J.CrsTransformationAdapterProj4J
*/
*/
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.programmerare.crsTransformationAdapterOrbisgisCTS;

import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber;
import com.programmerare.crsTransformations.coordinate.CrsCoordinate;
import com.programmerare.crsTransformations.CrsTransformationResultStatistic;
import com.programmerare.crsTransformations.CrsTransformationResult;
Expand Down Expand Up @@ -32,4 +32,4 @@ void testingNAN() {
// transformResult : Coordinate(xEastingLongitude=NaN, yNorthingLatitude=NaN, crsIdentifier=CrsIdentifier(crsCode=EPSG:2163, isEpsgCode=true, epsgNumber=2163))
}

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.programmerare.crsTransformations;

import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber;
import com.programmerare.crsTransformationAdapterGeoPackageNGA.CrsTransformationAdapterGeoPackageNGA;
import com.programmerare.crsTransformationAdapterGeoTools.CrsTransformationAdapterGeoTools;
import com.programmerare.crsTransformationAdapterGooberCTL.CrsTransformationAdapterGooberCTL;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.programmerare.crsTransformations;

import com.programmerare.com.programmerare.testData.TestCategory;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber;
import com.programmerare.crsTransformations.coordinate.CrsCoordinate;
import com.programmerare.crsTransformations.coordinate.CrsCoordinateFactory;
import com.programmerare.crsTransformations.crsIdentifier.CrsIdentifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void isReliable_shouldReturnTrueForLeafs_whenUsingCriteriaNumberOfResultsOneAndM
// it will be the Composite FirstSuccess which also will only have one result
// and thus can be tested in the same way as the leafs in this method
final CrsCoordinate wgs84coordinateInSweden = CrsCoordinateFactory.latLon(59.29,18.03);
final CrsTransformationResult resultWhenTransformingToSwedishCRS = crsTransformationAdapterLeaf.transform(wgs84coordinateInSweden, com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber.SWEDEN__SWEREF99_TM__3006);
final CrsTransformationResult resultWhenTransformingToSwedishCRS = crsTransformationAdapterLeaf.transform(wgs84coordinateInSweden, com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber.SWEDEN__SWEREF99_TM__3006);
assertNotNull(resultWhenTransformingToSwedishCRS);
assertTrue(resultWhenTransformingToSwedishCRS.isSuccess());
final CrsTransformationResultStatistic crsTransformationResultStatistic = resultWhenTransformingToSwedishCRS.getCrsTransformationResultStatistic();
Expand Down Expand Up @@ -349,7 +349,7 @@ void isReliable_shouldReturnTrueOrFalseForComposites_dependingOnCriteriasUsedAsM

for (CrsTransformationAdapter crsTransformationAdapterComposite : crsTransformationAdapterImplementationsExpectingManyResults) {
final CrsCoordinate wgs84coordinateInSweden = CrsCoordinateFactory.latLon(59.29,18.03);
final CrsTransformationResult resultWhenTransformingToSwedishCRS = crsTransformationAdapterComposite.transform(wgs84coordinateInSweden, com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber.SWEDEN__SWEREF99_TM__3006);
final CrsTransformationResult resultWhenTransformingToSwedishCRS = crsTransformationAdapterComposite.transform(wgs84coordinateInSweden, com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber.SWEDEN__SWEREF99_TM__3006);
assertNotNull(resultWhenTransformingToSwedishCRS);
assertTrue(resultWhenTransformingToSwedishCRS.isSuccess());
final CrsTransformationResultStatistic crsTransformationResultStatistic = resultWhenTransformingToSwedishCRS.getCrsTransformationResultStatistic();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.programmerare.crsTransformations;

import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber;
import com.programmerare.crsTransformationAdapterGeoPackageNGA.CrsTransformationAdapterGeoPackageNGA;
import com.programmerare.crsTransformationAdapterGeoTools.CrsTransformationAdapterGeoTools;
import com.programmerare.crsTransformationAdapterGooberCTL.CrsTransformationAdapterGooberCTL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.programmerare.crsTransformations.coordinate.CrsCoordinate;
import com.programmerare.crsTransformations.coordinate.CrsCoordinateFactory;
import com.programmerare.crsTransformations.crsIdentifier.CrsIdentifier;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber;
import com.programmerare.crsTransformations.CrsTransformationResult;
import org.junit.jupiter.api.Test;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.programmerare.crsTransformations.compositeTransformations;

import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber;
import com.programmerare.crsTransformations.coordinate.CrsCoordinate;
import com.programmerare.crsTransformations.CrsTransformationAdapter;
import com.programmerare.crsTransformations.CrsTransformationResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.programmerare.crsTransformations.coordinate.CrsCoordinate;
import com.programmerare.crsTransformations.CrsTransformationAdapter;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber;
import com.programmerare.crsTransformations.CrsTransformationResult;
import com.programmerare.crsTransformations.coordinate.CrsCoordinateFactory;
import com.programmerare.crsTransformations.utils.MedianValueUtility;
Expand Down Expand Up @@ -45,4 +45,4 @@ private CrsCoordinate calculateMedianCoordinate(List<CrsCoordinate> coordinateRe
return CrsCoordinateFactory.createFromXEastingLongitudeAndYNorthingLatitude(medianLongitude, medianLatitude, EpsgNumber.SWEDEN__SWEREF99_TM__3006);
}

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.programmerare.crsTransformations.compositeTransformations;

import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber;
import com.programmerare.crsTransformationAdapterGeoPackageNGA.CrsTransformationAdapterGeoPackageNGA;
import com.programmerare.crsTransformationAdapterGeoTools.CrsTransformationAdapterGeoTools;
import com.programmerare.crsTransformationAdapterGooberCTL.CrsTransformationAdapterGooberCTL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.programmerare.crsTransformationAdapterProj4jLocationtech.CrsTransformationAdapterProj4jLocationtech;
import com.programmerare.crsTransformations.CrsTransformationAdapter;
import com.programmerare.crsTransformations.coordinate.CrsCoordinate;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber;

import com.programmerare.crsTransformations.coordinate.CrsCoordinateFactory;
import org.junit.jupiter.api.BeforeAll;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.programmerare.crsTransformations.compositeTransformations;

import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber;
import com.programmerare.crsTransformations.*;
import com.programmerare.crsTransformations.coordinate.CrsCoordinate;
import com.programmerare.crsTransformations.coordinate.CrsCoordinateFactory;
Expand Down Expand Up @@ -273,4 +273,4 @@ void simpleExampleShowingHowToUseTestStubbingWithMockito() {
assertEquals("second", mockedList.get(1));
}
// --------------------------------------------------------------
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.programmerare.crsTransformations.compositeTransformations;

import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber;
import com.programmerare.crsTransformations.coordinate.CrsCoordinate;
import com.programmerare.crsTransformations.CrsTransformationResultStatistic;
import com.programmerare.crsTransformations.CrsTransformationResult;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.programmerare.crsTransformations.coordinate;

import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber;
import com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber;
import com.programmerare.crsTransformations.crsIdentifier.CrsIdentifier;
import com.programmerare.crsTransformations.crsIdentifier.CrsIdentifierFactory;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -333,4 +333,4 @@ private void assertExceptionMessageForIllegalArgumentException(IllegalArgumentEx
assertThat(actualEceptionMessage, containsString(expectedEceptionMessagePart1));
assertThat(actualEceptionMessage, containsString(expectedEceptionMessagePart2));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@ class ConstantsGeneratedTest {
fun constantNumberTest() {
// Note that the package names below are different (the part beginning with "constantsBy")
val list = listOf(
// com.programmerare.crsConstants.constantsByNumberNameArea.v9_5_4.EpsgNumber._3006__SWEREF99_TM__SWEDEN,
// com.programmerare.crsConstants.constantsByNumberAreaName.v9_5_4.EpsgNumber._3006__SWEDEN__SWEREF99_TM,
// com.programmerare.crsConstants.constantsByNumberNameArea.v9_8_9.EpsgNumber._3006__SWEREF99_TM__SWEDEN,
// com.programmerare.crsConstants.constantsByNumberAreaName.v9_8_9.EpsgNumber._3006__SWEDEN__SWEREF99_TM,

com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgNumber.SWEDEN__SWEREF99_TM__3006,
com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgNumber.SWEDEN__SWEREF99_TM__3006,
3006
// com.programmerare.crsConstants.constantsByAreaNumberName.v9_5_4.EpsgNumber.SWEDEN__3006__SWEREF99_TM,
// com.programmerare.crsConstants.constantsByAreaNumberName.v9_8_9.EpsgNumber.SWEDEN__3006__SWEREF99_TM,

// com.programmerare.crsConstants.constantsByNameAreaNumber.v9_5_4.EpsgNumber.SWEREF99_TM__SWEDEN__3006,
// com.programmerare.crsConstants.constantsByNameNumberArea.v9_5_4.EpsgNumber.SWEREF99_TM__3006__SWEDEN
// com.programmerare.crsConstants.constantsByNameAreaNumber.v9_8_9.EpsgNumber.SWEREF99_TM__SWEDEN__3006,
// com.programmerare.crsConstants.constantsByNameNumberArea.v9_8_9.EpsgNumber.SWEREF99_TM__3006__SWEDEN
)
assertAllElementsAreEqual(list)
}

// @Test
// fun constantStringTest() {
// val list = listOf(
// com.programmerare.crsConstants.constantsByNumberNameArea.v9_5_4.EpsgCode._3006__SWEREF99_TM__SWEDEN,
// com.programmerare.crsConstants.constantsByNumberAreaName.v9_5_4.EpsgCode._3006__SWEDEN__SWEREF99_TM,
// com.programmerare.crsConstants.constantsByNumberNameArea.v9_8_9.EpsgCode._3006__SWEREF99_TM__SWEDEN,
// com.programmerare.crsConstants.constantsByNumberAreaName.v9_8_9.EpsgCode._3006__SWEDEN__SWEREF99_TM,

// com.programmerare.crsConstants.constantsByAreaNameNumber.v9_5_4.EpsgCode.SWEDEN__SWEREF99_TM__3006
// com.programmerare.crsConstants.constantsByAreaNumberName.v9_5_4.EpsgCode.SWEDEN__3006__SWEREF99_TM,
// com.programmerare.crsConstants.constantsByAreaNameNumber.v9_8_9.EpsgCode.SWEDEN__SWEREF99_TM__3006
// com.programmerare.crsConstants.constantsByAreaNumberName.v9_8_9.EpsgCode.SWEDEN__3006__SWEREF99_TM,

// com.programmerare.crsConstants.constantsByNameAreaNumber.v9_5_4.EpsgCode.SWEREF99_TM__SWEDEN__3006,
// com.programmerare.crsConstants.constantsByNameNumberArea.v9_5_4.EpsgCode.SWEREF99_TM__3006__SWEDEN
// com.programmerare.crsConstants.constantsByNameAreaNumber.v9_8_9.EpsgCode.SWEREF99_TM__SWEDEN__3006,
// com.programmerare.crsConstants.constantsByNameNumberArea.v9_8_9.EpsgCode.SWEREF99_TM__3006__SWEDEN
// )
// assertAllElementsAreEqual(list)
// }
Expand All @@ -46,4 +46,4 @@ class ConstantsGeneratedTest {
)
}
}
}
}
Loading

0 comments on commit 0408123

Please sign in to comment.