Skip to content

Commit b50694d

Browse files
committed
Merge branch 'master' into issue-714
2 parents 1f251e6 + 12f46fd commit b50694d

File tree

789 files changed

+25775
-6899
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

789 files changed

+25775
-6899
lines changed

.gitignore

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
.idea
22
*.iml
33
target
4+
build
5+
6+
# eclipse ignores
47
.classpath
58
.project
69
.settings
710
.externalToolBuilders
8-
build
11+
.checkstyle
12+
.eclipse-pmd
13+
.pmd
14+
.ruleset
915

1016
# standard ignores
1117
*.class
@@ -14,4 +20,7 @@ build
1420
hs_err_pid*
1521

1622
# operating system specific
17-
.DS_Store
23+
.DS_Store
24+
25+
# maven ignores
26+
pom.xml.versionsBackup

DEVELOPING.md

Lines changed: 124 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -22,78 +22,153 @@ The JTS build chain uses Maven. Build commands are executed at the project root
2222

2323
* Build everything:
2424

25-
mvn install -Pall
25+
mvn install -Dall=true
2626

27-
## Javadoc
28-
29-
* Build Javadoc for core modules
30-
31-
mvn javadoc:aggregate
32-
33-
## Eclipse Configuration
34-
35-
* Generate Eclipse configuration using `mvn eclipse:eclipse`
36-
* Import the generated projects into an Eclipse workspace
27+
* Limit build to release artifacts:
3728

38-
### Run Configurations
29+
mvn install -Drelease=true
3930

40-
It is convenient to define the following Run Configurations:
31+
## Quality Assurance
4132

33+
JTS build verify stage includes pmd, checkstyle and more:
4234

43-
* **JTS TestRunner** - for executing XML tests:
35+
mvn verify
4436

45-
Field | Value
46-
------|------
47-
Type | Java Application
48-
Project | `jts-tests`
49-
Main class | `org.locationtech.jtstest.testrunner.JTSTestRunnerCmd`
50-
Program arguments | `validate general`
51-
Working directory | `${workspace_loc:jts-tests/src/test/resources/testxml}`
37+
To skip QA checks:
5238

53-
* **JTS TestBuilder** - for viewing and processing geometry with JTS
39+
mvn verify -Dpmd.skip=true -Dcheckstyle.skip=true
5440

55-
Field | Value
56-
------|------
57-
Type | Java Application
58-
Project | `jts-app`
59-
Main class | `org.locationtech.jtstest.testbuilder.JTSTestBuilder`
60-
Program arguments (optional) | `-geomfunc <classname> ...`
61-
VM args | `-Xmx1000M`
62-
VM args (optional, for Mac) | `-Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel`
63-
Working directory | Default
41+
To browse QA errors:
42+
43+
mvn site:site
44+
open modules/core/target/site/index.html
6445

65-
## Testing
46+
### JUnit tests
6647

6748
JTS aims for 100% code coverage for unit tests.
49+
Unit tests are written in Java using JUnit.
50+
They are used for verifying API code, internal data structures, and ancillary algorithms.
6851

69-
There are two kinds of unit tests:
70-
71-
### JUnit tests
72-
73-
Used for verifying API code, internal data structures, and ancillary algorithms.
74-
These tests are written in Java.
75-
This allows testing all parts of the codebase,
76-
and can provide richer error detection and reporting.
77-
However, the tests are not as readable or portable
78-
as the XML tests.
52+
This allows testing all parts of the codebase, and can provide richer error detection and reporting.
53+
However, the tests are not as readable or portable as the XML tests.
7954

80-
* To run the unit tests in a module (`jts-core`):
55+
* Run the unit tests in a module (e.g. `jts-core`):
8156

8257
mvn test -pl modules/core
8358

8459
### XML Tests
8560

86-
JTS provides a code-independent, declarative XML-based format for expressing geometric functional tests.
61+
JTS provides a simple language-independent, declarative XML-based format for expressing geometric functional tests.
62+
8763
This format has the following advantages:
8864

89-
* allows encoding large geometries
90-
* provides geometric test cases in a reusable way
91-
* easily consumed by tools such as the JTS TestBuilder or by other geometry libraries (e.g. GEOS)
65+
* allows encoding large geometries more easily
66+
* provides geometric test cases in a reusable, language-independent way
67+
* easily consumed by tools such as the **JTS TestBuilder**
68+
* easily used by JTS ports (e.g. [GEOS](https://trac.osgeo.org/geos)) or other geometry libraries
9269
* allows geometric tests to be used with other operation implementations, for testing or comparison purposes
9370

94-
This format should be used for tests which involve large geometries, or which
71+
This format should be used for tests which
9572
express fundamental geometric semantics of the JTS library.
9673

97-
The XML test format can be executed using the JTS TestRunner, or imported into the JTS TestBuilder.
74+
The XML test format can be executed using the **JTS TestRunner**, or imported into the **JTS TestBuilder**.
75+
76+
### External QA tools
9877

78+
#### LGTM CodeQL analysis
79+
[![Total alerts](https://img.shields.io/lgtm/alerts/g/locationtech/jts.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/locationtech/jts/alerts/)
80+
[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/locationtech/jts.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/locationtech/jts/context:java)
81+
* [Alerts report](https://lgtm.com/projects/g/locationtech/jts/alerts/?mode=tree)
82+
83+
84+
#### ABI Laboratory Tracker
85+
* [Binary compatibility report for JTS core](https://abi-laboratory.pro/?view=timeline&lang=java&l=jts-core)
86+
* [Binary compatibility for JTS 1.15 and before](https://abi-laboratory.pro/index.php?view=timeline&lang=java&l=jts)
87+
88+
## Javadoc
89+
90+
* Build Javadoc for core modules
91+
92+
mvn javadoc:aggregate
93+
94+
## Eclipse Configuration
95+
96+
Project:
97+
98+
1. Startup eclipse, creating a new `jts-workspace` location. This folder is used by eclipse to keep track of settings alongside your jts source code.
99+
100+
2. Use *File > Import*, and the wizard *Maven > Existing Maven Project*.
101+
102+
Select top-level `jts` folder as the Root directory.
103+
104+
3. Once imported eclipse will build the project using built-in maven support.
105+
106+
4. During initial build warning is shown for maven lifecycle mapping for `checkstyle:check`. Use the quickfix to **ignore** this lifecycle mapping.
107+
108+
Do not try the *maven-checkstyle-plugin* connector as it fails to install.
109+
110+
Plugins:
111+
112+
* Install *Eclipse-CS* from the market place.
113+
114+
1. Select *jts-core* project properties and navigate to *Checkstyle* preference page.
115+
116+
2. From the *Local check configuration* tab use *new* to create a check configuration.
117+
118+
3. Setup a *Project Relative Configuration* named `jts`, selecting ``build-tools/src/main/resources/jts/checkstyle.xml``
119+
120+
4. Press *Additional properties* to open the *Additional Checkstyle configuration file properties* dialog.
121+
122+
5. Press *Find unresolved properties* to define:
123+
124+
* property `checkstyle.header.file` value: Absolute path to `src/main/resources/jts/header.txt`
125+
* property `checkstyle.header.file`value: Absolute path to `src/main/resources/jts/suppressions.xml`
126+
127+
6. From the *Main* tab:
128+
129+
* Enable *Checkstyle active for this project*.
130+
* Select ``jts`` configuration
131+
132+
7. You can *jts-core* as a blueprint to copy the Checkstyle configuration to other modules.
133+
134+
Checkstyle is integrated into the build cycle updating warnings each time you save.
135+
136+
* Install *eclipse-pmd* following directions for [offline install](https://acanda.github.io/eclipse-pmd/getting-started.html) to download a [recent release](https://github.com/eclipse-pmd/eclipse-pmd/releases/).
137+
138+
1. Select *jts-core* project properties and navigate to *PMD* preference page.
139+
2. Use *add* button to add a workspace ruleset using `build-tools/src/main/resources/jts/pmd-ruleset.xml`
140+
3. Name the ruleset `jts`
141+
142+
PMD is integrated into the build cycle updating warnings each time you save, and providing some quickfixes.
143+
144+
* Alternative: Install *pmd-eclipse-plugin* from the market place.
145+
146+
1. Select *jts-core* project properties and navigate to *PMD* preference page.
147+
2. Enable PMD
148+
3. Use a the ruleset configured in a project file, selecting `build-tools/src/main/resources/jts/pmd-ruleset.xml`
149+
150+
You can use *PMD > Check code* to list errors and warnings. The results are shown in their own view, and quickfixes are not available.
151+
152+
Run Configurations:
153+
154+
* **JTS TestRunner** - for executing XML tests:
155+
156+
Field | Value
157+
------|------
158+
Type | Java Application
159+
Project | `jts-tests`
160+
Main class | `org.locationtech.jtstest.testrunner.JTSTestRunnerCmd`
161+
Program arguments | `validate general`
162+
Working directory | `${workspace_loc:jts-tests/src/test/resources/testxml}`
163+
164+
* **JTS TestBuilder** - for viewing and processing geometry with JTS
99165

166+
Field | Value
167+
------|------
168+
Type | Java Application
169+
Project | `jts-app`
170+
Main class | `org.locationtech.jtstest.testbuilder.JTSTestBuilder`
171+
Program arguments (optional) | `-geomfunc <classname> ...`
172+
VM args | `-Xmx1000M`
173+
VM args (optional, for Mac) | `-Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel`
174+
Working directory | Default

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ Currently JTS targets Java 1.8 and above.
3232
* [Mailing List](https://accounts.eclipse.org/mailing-list/jts-dev)
3333
* [Gitter Channel](https://gitter.im/locationtech/jts)
3434

35+
### Forums
36+
* [Stack Overflow](https://stackoverflow.com/questions/tagged/jts)
37+
* [GIS Stack Exchange](https://gis.stackexchange.com/questions/tagged/jts-topology-suite)
38+
3539
## License
3640

3741
JTS is open source software. It is dual-licensed under:
@@ -70,6 +74,7 @@ If you are interested in contributing to JTS please read the [**Contributing Gui
7074
* [**GEOS**](https://trac.osgeo.org/geos) - C++
7175
* [**NetTopologySuite**](https://github.com/NetTopologySuite/NetTopologySuite) - .NET
7276
* [**JSTS**](https://github.com/bjornharrtell/jsts) - JavaScript
77+
* [**dart_jts]([https://pub.dev/packages/dart_jts](https://github.com/moovida/dart_jts)) - Dart
7378

7479
### Via GEOS
7580
* [**Shapely**](https://github.com/Toblerity/Shapely) - Python wrapper of GEOS

RELEASING.md

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,28 @@ On master:
5858
2. Update version number in Maven POMs (run the Maven release plugin at project root:
5959

6060
```
61-
mvn versions:set -DnewVersion=1.18.0
61+
mvn versions:set -DnewVersion=1.19.0
6262
```
6363

64+
3. Edit ``build-tools/pom.xml`` by hand, and compile to test.
65+
66+
```
67+
mvn clean install
68+
```
69+
6470
3. Commit this change.
6571

6672
```
67-
git commit -m "Release version 1.18.0"
73+
git add .
74+
git commit -m "Release version 1.19.0"
6875
git push
6976
```
7077
7178
4. Tag this commit, and push the tag to GitHub.
7279

7380
```
74-
git tag -a 1.18.0 -m "Release version 1.18.0"
81+
git tag -a 1.19.0 -m "Release version 1.19.0"
82+
git push --tags
7583
```
7684

7785
This is the commit that will form the GitHub release below.
@@ -87,9 +95,8 @@ On master:
8795

8896
To interact with the agent (so it asks you the passphrase):
8997

90-
````
91-
gpg --use-agent --armor --detach-sign --output $output pom.xml
92-
rm pom.xml.asc
98+
```
99+
gpg --use-agent --armor --detach-sign --output - pom.xml
93100
```
94101

95102
Reference: [Configuring GPG/PGP for Maven Releases to Sonatype on Mac OS X](https://nblair.github.io/2015/10/29/maven-gpg-sonatype/)
@@ -149,10 +156,33 @@ Update [Javadoc on JTS Github IO](http://locationtech.github.io/jts/javadoc/):
149156

150157
2. Update branch [`gh-pages`](https://github.com/locationtech/jts/tree/gh-pages):
151158

152-
* clone
153-
* branch
154-
* copy new Javadoc
155-
* commit
159+
```bash
160+
cd ..
161+
git clone https://github.com/locationtech/jts.git jts-docs
162+
cd jts-docs
163+
git checkout --track origin/gh-pages
164+
git mv javadoc javadoc-1.18.0
165+
git mv javadoc-io javadoc-io-1.18.0
166+
cp -r ../jts/modules/core/target/apidocs/ javadoc
167+
cp -r ../jts/modules/io/common/target/apidocs javadoc-io
168+
```
169+
170+
Edit ``index.html`` with new details:
171+
172+
```
173+
<li>Javadoc for JTS 1.19.0 (
174+
<a href="javadoc/index.html" target="javadoc">jts-core</a> |
175+
<a href="javadoc-io/index.html" target="javadoc">jts-io-common</a>)</li>
176+
<li>Javadoc for JTS 1.18.0 (
177+
<a href="javadoc-1.18.0/index.html" target="javadoc">jts-core</a> |
178+
<a href="javadoc-io-1.18.0/index.html" target="javadoc">jts-io-common</a>)</li>
179+
```
180+
181+
Commit
182+
```
183+
git add .
184+
git commit -m "JTS 1.19.0 javadocs"
185+
```
156186

157187
### Post release
158188

@@ -164,7 +194,7 @@ Update master to the next release version:
164194

165195
```
166196
public static final int MAJOR = 1;
167-
public static final int MINOR = 18;
197+
public static final int MINOR = 19;
168198
public static final int PATCH = 0;
169199
private static final String RELEASE_INFO = "";
170200
```
@@ -173,23 +203,31 @@ Update master to the next release version:
173203

174204
```
175205
public static final int MAJOR = 1;
176-
public static final int MINOR = 19;
206+
public static final int MINOR = 20;
177207
public static final int PATCH = 0;
178208
private static final String RELEASE_INFO = "SNAPSHOT";
179209
```
180210

181211
2. Update version number in Maven POMs (run the Maven release plugin at project root:
182212

183213
```
184-
mvn versions:set -DnewVersion=1.19.0-SNAPSHOT
214+
mvn versions:set -DnewVersion=1.20.0-SNAPSHOT
215+
```
216+
217+
3. Edit ``build-tools/pom.xml`` by hand, and compile to test.
218+
219+
```
220+
mvn clean install
185221
```
186222

187-
3. Commit this change.
223+
3. Compile to test, and commit this change.
188224

189225
```
190-
git commit -m "Version 1.19.0-SNAPSHOT"
226+
git add .
227+
git commit -m "Version 1.20.0-SNAPSHOT"
191228
git push
192-
```
229+
```
230+
193231
4. Add a new version entry to the [Version History](https://github.com/locationtech/jts/blob/master/doc/JTS_Version_History.md)
194232

195233
### Announcing

0 commit comments

Comments
 (0)