Skip to content

Commit

Permalink
Initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieun committed Aug 8, 2017
0 parents commit 1dbcbe5
Show file tree
Hide file tree
Showing 1,046 changed files with 172,343 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
*/build/
*/bin/
.classpath
.project
.settings
.checkstyle
.gradle
.out
.dist
*.ipr
*.iml
*.iws
*.ws~
.idea/
/tags
/build/
.DS_Store
**/.DS_Store
**/out/
/bin/
**/ignored/
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
env:
global:
- # GITHUB_SECRET_TOKEN
- secure: "Zb8ww8gZm8LrU335UTFkLZxPvsUmHerRDIJ5sEiyhHZEt+edk3vVVRJboxHLHfa+2tr9PfO2s0SmCXF55gd/D63ya8kt711Z9vixzxxQ1uiX56zB3LfHJy1CY7wwC8gQk2pZuqhFkwnL/4UMHD47ISkN1QO1zupyqVpcU1a1zGRl4zyM30MokosmybExJOrrwvoyYGUk1OGWjfpLiINNpyy3l0eu5H9Xyoc4wrtuVtvMEv55TeChRA3BVo7cfRKGxNZyMc/Mi12K9f3iM/CeCzvOI03XPU91rq35443iODMa4YwxaVCmmn4832nZNWOjHOwiVTEFciIDrGg2z8TP5jdOCyu2etYOMB3keba1DxfKu2XrDp1f8sdX1vLOdzu0m9kM+rmkekeo+7t3WnlCUJ41ri2KA38vYf5x0Et1KvnkqVINtZPuecNv8L173NIH79eGzoorLogOz87Jq8O9+r99nw00fpXBQmmhpDGBYAdVxOMSkXKj5Jn3FrR8kO8E/7Rr1MXSWGy7X7UPK2Sv8idbA7j0WkBuoIy4pPSohdz+cQQZXQVf2ovMx4g8KCcCFH6Uu3G4DfIdK4JRv8sGndH54yCMas7z0HG2pLBjI/CczHhEkEeQdLAJcH9L5hweiSKnGhZjozjpzO4Wj4IV5ZN+I6NpaRXSFO+tTws3TDU="
- # SONATYPE_USERN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spK1MdmaD67FsUXekrDWDmxtofmwaZZvfoRpSTw3ikCSB3QlT4c3SnnQmzzd6Eymi4upkLuazbawGH2tFyEEyPBWQUOIF7J3Fgqpv5TxnLgy2e9/Yc4DKz7RWi2Mxg9wyBPsu4sMzoU5TovRsYHeaKFGn39HOxPhLIm+4gCL6s44/od+wVPXb18IZCAEh3/A7bv5Dvz3XaTaeNpPnLXIH6I63iq5S1u5kMdI+wq5qZxc7auG3x/ujvYga0Aj76rjXvW/YODPN6wxMvH73OVdpsOrxR6qbrPWsjj/xf3v3HQBm5xXqVbqS3IhWlCSAWAWjS/mnbK3NgoS8l14vJtOxtOYSqwDlGtMlbZWKXKeGzVoXb+4bH26KfdOtKLwA9GeAfWYOBI+neJIrYKCnCWUeujD0VzDM7b9A//kmU0Z6wv9g+cYHNc9gyNFQUwpK1NfP7kssuHKcLAmKBMfZF8AgSaxvT71S0UsZCmtBC/rIQPzqwJvI1X8mq3QdV2Y98AwKN9fOS0r2kRXm9ZV0bbtWwhh5vI8hNlhcOXF+yZwgVXCaPKXvEWLNJ7/awGpA1tptn7aP8A6tDSsLNoE1e7NE2p1r+3BAEIklv27RQKzkKkMi8cFcq9gsl49y6wbd4z5IgZsbirkbpKoOvLNYfMUE="
- GPG_KEY_LOCATION=".travis/secring.gpg"
- ENCRYPTED_GPG_KEY_LOCATION=".travis/secring.gpg.enc"
branches:
only:
- master
- dev
language: java
jdk:
- oraclejdk8
before_install:
- chmod -R ug+x .travis
- .travis/install.sh
script:
- chmod -R ug+x .travis
- .travis/build.sh
- .travis/merge-dev-to-master-gate.sh
- .travis/deploy-gate.sh
- .travis/tag-master-gate.sh
21 changes: 21 additions & 0 deletions .travis/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env sh

chmod u+x gradlew

if [ "$MANUAL_RELEASE_TRIGGERED" = "true" ];
then
# This is a release job, triggered manually
# Change the version locally to remove the -SNAPSHOT
sed -i "s/-SNAPSHOT//g" gradle.properties
echo "This is a manual release!"
else
echo "Not a manual release"
fi

if [ "$TRAVIS_PULL_REQUEST" != "false" ];
then
echo "Skip integration tests in pull request builds"
./gradlew clean build -x integrationTest
else
./gradlew clean build
fi
11 changes: 11 additions & 0 deletions .travis/deploy-gate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh

if [ $TRAVIS_TEST_RESULT -eq 0 ];
then
.travis/deploy.sh
RETURN_VALUE=$?
if [ "$RETURN_VALUE" != "0" ];
then
exit $RETURN_VALUE
fi
fi
14 changes: 14 additions & 0 deletions .travis/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env sh

if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ];
then
echo "Sign Archives"
./gradlew signArchives
echo "Upload Archives"
./gradlew uploadArchives
if [ "$MANUAL_RELEASE_TRIGGERED" = "true" ];
then
echo "Promote repository"
./gradlew closeAndReleaseRepository
fi
fi
6 changes: 6 additions & 0 deletions .travis/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh

if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ];
then
openssl aes-256-cbc -K $encrypted_188d9cfa26f4_key -iv $encrypted_188d9cfa26f4_iv -in $ENCRYPTED_GPG_KEY_LOCATION -out $GPG_KEY_LOCATION -d
fi
11 changes: 11 additions & 0 deletions .travis/merge-dev-to-master-gate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh

if [ $TRAVIS_TEST_RESULT -eq 0 ];
then
.travis/merge-dev-to-master.sh
RETURN_VALUE=$?
if [ "$RETURN_VALUE" != "0" ];
then
exit $RETURN_VALUE
fi
fi
45 changes: 45 additions & 0 deletions .travis/merge-dev-to-master.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env sh

GITHUB_REPO="matthieun/wkb-wkt-converter"
MERGE_BRANCH=master
SOURCE_BRANCH=dev

FUNCTION_NAME="merge-$SOURCE_BRANCH-to-$MERGE_BRANCH"

echo "$FUNCTION_NAME: $GITHUB_REPO"
echo "$FUNCTION_NAME: TRAVIS_BRANCH = $TRAVIS_BRANCH"
echo "$FUNCTION_NAME: TRAVIS_PULL_REQUEST = $TRAVIS_PULL_REQUEST"

if [ "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ];
then
echo "$FUNCTION_NAME: Exiting! Branch is not $SOURCE_BRANCH: ($TRAVIS_BRANCH)"
exit 0;
fi

if [ "$TRAVIS_PULL_REQUEST" != "false" ];
then
echo "$FUNCTION_NAME: Exiting! This is a Pull Request: $TRAVIS_PULL_REQUEST"
exit 0;
fi

: ${GITHUB_SECRET_TOKEN:?"GITHUB_SECRET_TOKEN needs to be set in .travis.yml!"}

export GIT_COMMITTER_EMAIL="travis@travis.org"
export GIT_COMMITTER_NAME="Travis CI"

TEMPORARY_REPOSITORY=$(mktemp -d)
git clone "https://github.com/$GITHUB_REPO" "$TEMPORARY_REPOSITORY"
cd $TEMPORARY_REPOSITORY

echo "Checking out $SOURCE_BRANCH"
git checkout $SOURCE_BRANCH

echo "Checking out $MERGE_BRANCH"
git checkout $MERGE_BRANCH

echo "Merging $SOURCE_BRANCH into $MERGE_BRANCH"
git merge --ff-only "$SOURCE_BRANCH"

echo "Pushing to $GITHUB_REPO"
# Redirect to /dev/null to avoid secret leakage
git push "https://$GITHUB_SECRET_TOKEN@github.com/$GITHUB_REPO" $MERGE_BRANCH > /dev/null 2>&1
Binary file added .travis/secring.gpg.enc
Binary file not shown.
11 changes: 11 additions & 0 deletions .travis/tag-master-gate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh

if [ $TRAVIS_TEST_RESULT -eq 0 ];
then
.travis/tag-master.sh
RETURN_VALUE=$?
if [ "$RETURN_VALUE" != "0" ];
then
exit $RETURN_VALUE
fi
fi
50 changes: 50 additions & 0 deletions .travis/tag-master.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env sh

GITHUB_REPO="matthieun/wkb-wkt-converter"
RELEASE_BRANCH=master

FUNCTION_NAME="tag-$RELEASE_BRANCH"

echo "$FUNCTION_NAME: $GITHUB_REPO"
echo "$FUNCTION_NAME: TRAVIS_BRANCH = $TRAVIS_BRANCH"
echo "$FUNCTION_NAME: TRAVIS_PULL_REQUEST = $TRAVIS_PULL_REQUEST"

if [ "$TRAVIS_BRANCH" != "$RELEASE_BRANCH" ];
then
echo "$FUNCTION_NAME: Exiting! Branch is not $RELEASE_BRANCH: ($TRAVIS_BRANCH)"
exit 0;
fi

if [ "$TRAVIS_PULL_REQUEST" != "false" ];
then
echo "$FUNCTION_NAME: Exiting! This is a Pull Request: $TRAVIS_PULL_REQUEST"
exit 0;
fi

if [ "$MANUAL_RELEASE_TRIGGERED" != "true" ];
then
echo "$FUNCTION_NAME: Exiting! This is not a release build."
exit 0;
fi

: ${GITHUB_SECRET_TOKEN:?"GITHUB_SECRET_TOKEN needs to be set in .travis.yml!"}

export GIT_COMMITTER_EMAIL="travis@travis.org"
export GIT_COMMITTER_NAME="Travis CI"

TEMPORARY_REPOSITORY=$(mktemp -d)
git clone "https://github.com/$GITHUB_REPO" "$TEMPORARY_REPOSITORY"
cd $TEMPORARY_REPOSITORY

echo "Checking out $RELEASE_BRANCH"
git checkout $RELEASE_BRANCH

PROJECT_VERSION=$(cat gradle.properties | grep "\-SNAPSHOT" | awk -F '=' '{print $2}' | awk -F '-' '{print $1}')
: ${PROJECT_VERSION:?"PROJECT_VERSION could not be found."}

echo "Tagging $RELEASE_BRANCH at version $PROJECT_VERSION"
git tag -a $PROJECT_VERSION -m "Release $PROJECT_VERSION"

echo "Pushing tag $PROJECT_VERSION to $GITHUB_REPO"
# Redirect to /dev/null to avoid secret leakage
git push "https://$GITHUB_SECRET_TOKEN@github.com/$GITHUB_REPO" $PROJECT_VERSION > /dev/null 2>&1
35 changes: 35 additions & 0 deletions .travis/trigger-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env sh

# Use Travis to trigger a release from Master

GITHUB_ORGANIZATION=osmlab
GITHUB_REPOSITORY_NAME=atlas

# Assumptions
# - This is called from the root of the project
# - The travis client is installed: gem install travis
# - travis login --org has been called to authenticate

TRAVIS_PERSONAL_TOKEN=$(travis token)

:${TRAVIS_PERSONAL_TOKEN:?"TRAVIS_PERSONAL_TOKEN needs to be set to access the Travis API to trigger the build"}

body='
{
"request":
{
"branch": "master",
"config":
{
"before_script": "export MANUAL_RELEASE_TRIGGERED=true"
}
}
}'

curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token $TRAVIS_PERSONAL_TOKEN" \
-d "$body" \
https://api.travis-ci.org/repo/$GITHUB_ORGANIZATION%2F$GITHUB_REPOSITORY_NAME/requests
70 changes: 70 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Contributing to Atlas

Thanks for taking the time to contribute!

## Where to ask a question

This project uses [StackOverflow](https://stackoverflow.com/) to handle all software related questions. If unsure about an issue, please first ask a question on StackOverflow, and then file an issue if necessary. Do not ask questions in GitHub issues as those will be closed and redirected to StackOverflow.

## Suggestions and bug reports

### Reporting bugs

If you have found a bug to report, that is great! Please search for similar bugs in GitHub issues, as your bug might have been filed already. If not, filing a GitHub issue is the next thing to do!

### Filing a Github issue

When submitting an issue, here is the information to include:

* Title: Use a title that is as self explanatory as possible
* Summary: Detailed description of the issue, including screenshots and/or stack traces
* Steps to reproduce: Do not forget to include links to data samples that can help in reproducing the issue
* Actual vs. Expected: Describe the results and how they differ from the expected behavior
* Workaround: If you have found a temporary workaround the issue, please also include it there!

### Suggesting enhancements

Enhancements are also handled with GitHub issues. Make sure to include the following:

* Title: Use a title that is as self explanatory as possible
* Summary: Use-case description of the proposed enhancement
* Desired: Describe the desired behavior of the proposed enhancement
* Implementation proposal: If you have an idea of how to implement the enhancement

## Submitting code

### Requirements

* Oracle JDK 8
* Gradle

### First contribution

The first step would be to fork the project in your own github account, then clone the project locally using `git clone`. Then use gradle to build the code, and run tests:

```
cd <my clone location>
./gradlew build
```

To start contributing to your fork, the best way is to make sure that your IDE is setup to follow the [code formatting template](config/format/code_format.xml).

Once you have fixed an issue or added a new feature, it is time to submit [a pull request](#pull-request-guidelines)!

### Code formatting

The project's code is checked by Checkstyle as part of the `gradle check` step.

There also is an eclipse code formatting template [here](config/format/code_format.xml) that is used by [Spotless](https://github.com/diffplug/spotless) to check that the formatting rules are being followed. In case those are not, the `gradle spotlessCheck` step will fail and the build will not pass. Spotless provides an easy fix though, with `gradle spotlessApply` which will refactor your code so it follows the formatting guidelines.

### Testing

The codebase contains an extensive range of unit tests, and integration tests. Unit tests are supposed to run fairly fast. If the test takes a long time to run, we put it in the integrationTest repository, to allow users to run them only when wanted. All the tests will be run for every pull request build, though! When contributing new code, make sure to not break existing tests (or modify them and explain why the modification is needed) and to add new tests for new features.

### Pull Request Guidelines

Pull requests comments should follow the template below:

* An as extensive as reasonable description of the change proposed, in easy to read [Markdown](https://guides.github.com/features/mastering-markdown/), with as many code snippet examples, screen captures links and diagrams as possible
* A Benefit/Drawback analysis: what does this improve, and at what cost? Is the performance impacted or improved?
* Label: If applicable, apply one of the available labels to the pull request
26 changes: 26 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright (c) 2015-2017, Apple Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder(s) nor the names of any
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Loading

0 comments on commit 1dbcbe5

Please sign in to comment.