Skip to content

Commit 48281ac

Browse files
committed
Fix build and migrate to latest Gradle/BuildScripts
* Java 15/Linux compilation error: replace degree character with UTF-8 degree character * Migrate to latest BuildScripts / Gradle 7.0
1 parent 526cf7f commit 48281ac

File tree

14 files changed

+46
-135
lines changed

14 files changed

+46
-135
lines changed

.eclipse_project_files/Buildship/.classpath

Lines changed: 0 additions & 18 deletions
This file was deleted.

.eclipse_project_files/Buildship/.project

Lines changed: 0 additions & 23 deletions
This file was deleted.

.eclipse_project_files/README.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# Release 4.2.1 (May 8, 2021)
2+
3+
* Fixed a compilation error observed on OpenJDK 15/Linux where the 'degree' symbol was not a UTF-8 character. Whatever it was previously, it's been replaced with a compliant character. This changes the value returned by `toString` in `Latitude` and `Longitude`.
4+
5+
* The project's build script has been updated to be compatible with Gradle 7.0 and the latest version of [BuildScripts](https://github.com/kloverde/BuildScripts).
6+
7+
* Beginning with this release, releases will be source only. This includes first-party dependencies such as [NumberUtil](https://github.com/kloverde/java-NumberUtil), which you'll need to build yourself.
8+
9+
110
# Release 4.2 (June 16, 2018)
211

312
* Added a `getPrintName` method to the `CompassDirection` classes. This returns a grammatically correct version of `name()`, changing all letters to lowercase and all underscores to spaces
@@ -105,7 +114,7 @@ This release contains several breaking changes which were necessary for code cle
105114
* Removed GeographicCoordinate.Type from all GeographicCoordinate constructors. No client code should be impacted, since client code would have been working with the Latitude and Longitude classes directly.
106115
* Removed GeographicCoordinateException.Messages.COORDINATE_TYPE_NULL, as it can no longer be thrown
107116
* Changed GeographicCoordinateException.Messages from public to protected, as client code should not be using them. The constants contained therein exist solely to keep the internal code and JUnit tests in sync. The javadoc has been updated to indicate this.
108-
* Changed the Latitude/Longitude toString methods to return a degree/minute/second format, such as 12°34'56.789"N. Likewise, Point's toString method now uses this format.
117+
* Changed the Latitude/Longitude toString methods to return a degree/minute/second format, such as 1234'56.789"N. Likewise, Point's toString method now uses this format.
109118
* When using the Latitude(double) constructor to create a latitude of 0.0 (the Equator), the direction will be considered north. Previously, it was considered south. No client code should be impacted because it's never correct to examine the direction when talking about the Equator, since it is neither north nor south.
110119
* When using the Longitude(double) constructor to create a longitude of 0.0 (the Prime Meridian), the direction will be considered east. Previously, it was considered west. No client code should be impacted because it's never correct to examine the direction when talking about the Prime Meridian, since it is neither east nor west.
111120
* Integrated with the latest version of the BuildScripts project (https://github.com/kloverde/BuildScripts), adding findbugs integration, JUnit integration and new release packaging: one archive contains all jars and the readme, changelog and license.

README.md

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
GeographicCoordinate 4.2
2-
========================
1+
GeographicCoordinate 4.2.1
2+
==========================
33

44
See LICENSE for this software's licensing terms.
55

@@ -20,7 +20,7 @@ Starting with v4.0, Java 10 or later is required. See the v4.0 release notes in
2020

2121
## Accuracy
2222

23-
Supposedly, the calculations of distance and bearing are accurate. I didn't verify distance or bearing calculations in the real world. Doing so would have required purchasing a military-issue compass and then taking it on a hike. The hiking part sounded fine to me, but the purchase of an expensive compass did not. That being said:
23+
Supposedly, the calculations of distance and bearing are accurate. I didn't verify distance or bearing calculations in the real world. Doing so would have required purchasing a military-grade compass, which I presume would be expensive. (Whether necessary or not, preciseness is a thing for me). That being said:
2424

2525
Distance was verified by interpolating a course I plotted on Bing Maps (see the DistanceCalculator JUnit tests). The calculated value agreed with Bing's.
2626

@@ -29,34 +29,15 @@ Bearing was verified by comparing my calculations to two online calculators, and
2929
Use this software at your own risk.
3030

3131

32-
## Compile and Runtime Dependencies
33-
34-
1. [NumberUtil](https://github.com/kloverde/java-NumberUtil) (included)
35-
36-
37-
## Development Setup Dependencies
38-
39-
You only need to bother with these if you want to build using the same setup I used (see included project and build files).
40-
41-
1. [BuildScripts](https://github.com/kloverde/BuildScripts)
42-
2. The Eclipse Buildship plugin (available on the Eclipse Marketplace if it wasn't pre-packaged with your version of Eclipse). This is alluded to in the IDE Setup section below.
43-
3. Gradle
44-
45-
46-
## IDE Setup
47-
48-
In the root directory, you'll find a subdirectory named `.eclipse_project_files`, which contains... you guessed it, Eclipse project files. They enable you to import a pre-configured project that "just works" so that you don't have to fuss around.
49-
50-
If you're an Eclipse user, you'll know that this is not where Eclipse keeps them - rather, they belong in the project root directory. I archived the project files in a different location so that they could be saved without interfering with people who like to set up projects their own way.
51-
52-
If you want to use them, read `.eclipse_project_files/README.txt` for a description of the Eclipse plugins you'll need to install. Copy `.classpath` and `.project` to the project root directory, then import the project.
53-
54-
5532
## Building
5633

57-
1. Update the path to BuildScripts in gradle.properties
58-
2. Provide a value for builtByName in gradle.properties
59-
3. Provide the path to the NumberUtil jar in build.gradle
34+
This project is known to build on Gradle 7.0.
35+
36+
1. Get [BuildScripts](https://github.com/kloverde/BuildScripts)
37+
2. Build [NumberUtil](https://github.com/kloverde/java-NumberUtil) and publish it locally with `gradle publishtomavenlocal`
38+
3. Set `buildScriptsDir` (the path to BuildScripts) in gradle.properties
39+
4. Set `builtBy` in gradle.properties
40+
5. Run `gradle build`
6041

6142

6243
## Donations

build.gradle

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,9 @@
1-
apply plugin: "eclipse" // Run 'gradle eclipse' to rebuild .classpath for other systems
2-
31
apply from: buildScriptsDir + "/build_java_lib.gradle"
42

5-
dependencies {
6-
compile files( "lib/numberutil/numberutil-1.0.jar" )
7-
8-
testCompile "junit:junit:4.12"
9-
testCompile "org.mockito:mockito-core:2.18.3"
10-
}
11-
12-
task release( type : Zip ) {
13-
dependsOn jars
143

15-
if( builtByName == null || builtByName.trim().isEmpty() ) {
16-
throw new GradleException( "Empty builtByName in gradle.properties" );
17-
}
18-
19-
archiveName projectName + "-" + releaseVersion + ".zip"
20-
21-
from( "/lib/numberutil" )
22-
include "*.jar"
23-
24-
from( "/build/libs" )
25-
include "*.jar"
4+
dependencies {
5+
implementation "org.loverde:numberutil:1.0.1"
266

27-
from( "/" )
28-
include "CHANGELOG.md"
29-
include "LICENSE"
30-
include "README.md"
7+
testImplementation "junit:junit:4.12"
8+
testImplementation "org.mockito:mockito-core:2.18.3"
319
}

gradle.properties

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
# Scripts for building the project. Always use the latest version of BuildScripts (https://github.com/kloverde/BuildScripts).
2-
31
buildScriptsDir=../BuildScripts
42

5-
6-
# BuildScripts configuration
7-
8-
projectName=GeographicCoordinate
9-
releaseVersion=4.2
10-
specVersion=4.2
113
javaSourceCompatibility=1.10
124
javaTargetCompatibility=1.10
13-
jarName=geographiccoordinate
14-
builtByName=
5+
6+
group=org.loverde.geographiccoordinate
7+
version=4.2.1
8+
builtBy=Kurtis LoVerde (github.com/kloverde)

lib/numberutil/numberutil-1.0.jar

-1.9 KB
Binary file not shown.
-20.1 KB
Binary file not shown.
-2.59 KB
Binary file not shown.

0 commit comments

Comments
 (0)