Skip to content

Commit

Permalink
Merge branch '1.0.X'
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo.rodriguez.mier committed Feb 22, 2016
2 parents 628438b + 6c54e95 commit 5a7ea50
Show file tree
Hide file tree
Showing 45 changed files with 1,570 additions and 522 deletions.
18 changes: 7 additions & 11 deletions .config/deploy-artifacts.sh 100644 → 100755
@@ -1,16 +1,12 @@
#!/bin/bash

echo "Auto-deploying Hipster artifacts..."
echo "Auto-deploying Hipster4j snapshots..."
echo "Current branch: $TRAVIS_BRANCH"

if [ "$TRAVIS_REPO_SLUG" == "citiususc/hipster" ] && [ "$TRAVIS_JDK_VERSION" == "oraclejdk7" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo "Running mvn deploy, current directory: `pwd`"
# Deploy to CITIUS
#mvn --settings .config/maven-settings.xml -P citius-snapshot-deploy deploy -DskipTests=true
# Deploy to Sonatype Nexus OSS
mvn --settings .config/maven-settings.xml -P sonatype-nexus-snapshots deploy -DskipTests=true
else
echo "Skipping deployment for this build..."
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "Skipping snapshot deployment for pull request"
exit
fi

echo "Running mvn deploy, current directory: `pwd`"
# Deploy to Sonatype Nexus OSS
mvn --settings .config/maven-settings.xml deploy -DskipTests=true
echo "Deployment script finished."
74 changes: 0 additions & 74 deletions .config/deploy-site.sh

This file was deleted.

45 changes: 37 additions & 8 deletions .config/maven-settings.xml
Expand Up @@ -15,19 +15,48 @@
~ limitations under the License.
-->

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<!-- Internal organization repository for snapshots -->
<!-- Sonatype Maven repository for snapshots -->
<server>
<id>citius-nexus-snapshots</id>
<username>${env.NEXUS_SNAPSHOT_USERNAME}</username>
<password>${env.NEXUS_SNAPSHOT_PASSWORD}</password>
</server>
<!-- Sonatype Maven repository for snapshots -->
<server>
<id>sonatype-nexus-snapshots</id>
<username>${env.SONATYPE_SNAPSHOT_USERNAME}</username>
<password>${env.SONATYPE_SNAPSHOT_PASSWORD}</password>
</server>
<server>
<id>bintray-hipster4j-maven</id>
<username>${env.BINTRAY_USER}</username>
<password>${env.BINTRAY_API_KEY}</password>
</server>
</servers>

<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-hipster4j-maven</id>
<name>bintray</name>
<url>http://dl.bintray.com/hipster4j/maven</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-hipster4j-maven</id>
<name>bintray-plugins</name>
<url>http://dl.bintray.com/hipster4j/maven</url>
</pluginRepository>
</pluginRepositories>
<id>bintray</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>bintray</activeProfile>
</activeProfiles>
</settings>
58 changes: 58 additions & 0 deletions .config/publish-javadocs.sh
@@ -0,0 +1,58 @@
#!/bin/bash

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "Skipping Javadoc publication for pull request"
exit
fi

if [ "$TRAVIS_TAG" == "" ]; then
echo "Current version is not a release, skipping Javadoc publication"
exit
fi

echo "Auto publishing latest javadocs..."
echo "TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG - TRAVIS_JDK_VERSION=$TRAVIS_JDK_VERSION - TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST"

# Decide the documentation version folder name depending on the branch and the version in the pom.xml
VERSION=`grep -m 1 "<hipster.version>" pom.xml | cut -d ">" -f 2 | cut -d "<" -f 1`

# Validate if the version is correct (example 1.0.0-SNAPSHOT, or 1.0.0-alpha-1)
VERSION_REGEX='^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9_]+(-[0-9]+)?)?$'
if [[ $VERSION =~ $VERSION_REGEX ]]; then
echo "Current version is $VERSION"
else
echo "Version error. Unrecognized version $VERSION"
exit 1
fi

echo "Deploying Hipster [$VERSION] javadocs to GitHub gh-pages"
echo "Current directory is: `pwd`"

echo "Building javadocs..."
# Generate Javadocs in target/apidocs
mvn javadoc:aggregate

# Clone Hipster4j GitHub gh-pages for Javadocs
git clone --quiet --branch=gh-pages https://github.com/hipster4j/hipster-javadocs.git gh-pages > /dev/null

# Overwrite the previous version with the new one
cp -Rf target/apidocs/* gh-pages/

# Create a new folder with the version number and copy the latest version to it
mkdir gh-pages/$VERSION
cp -Rf target/apidocs/* gh-pages/$VERSION/

# Now prepare for uploading the site to gh-pages
cd gh-pages

# Config git user and credentials
git config --global user.email "travis@travis-ci.org"
git config --global user.name "travis-ci"
git config credential.helper "store --file=.git/credentials"
echo "https://${GITHUB_TOKEN}:@github.com" > .git/credentials

git add -A
git commit -a -m "auto-commit $TRAVIS_BRANCH Hipster4j Javadocs v$VERSION (build $TRAVIS_BUILD_NUMBER)"
git push -q origin gh-pages > /dev/null
echo "Finished"

4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -24,3 +24,7 @@ nb-configuration.xml
# Idea specific #
*.iml
.idea

# Eclipse specific #
.metadata/

19 changes: 5 additions & 14 deletions .travis.yml
@@ -1,22 +1,13 @@
language: java
jdk:
- oraclejdk7
- oraclejdk8
- openjdk7
branches:
except:
- /^(?i:wip).*$/
sudo: false
before_install:
- pip install --user codecov
after_success:
#- chmod +x .config/deploy-site.sh
#- .config/deploy-site.sh
- chmod +x .config/deploy-artifacts.sh
- .config/deploy-artifacts.sh
- mvn clean cobertura:cobertura coveralls:report
env:
global:
- secure: ILdOYjPt+8g5rlexXBYAhECtn5Zm26FRf0/nwCxUU303qtzFQyMcxinIC93aun880OnINjA7fzQeBkG4P+LSVOAXbmGTGhtyPBzMOGcnZouJM/RyXHUft6tAXPimXQ7JjDFjyv7EzSeStk/4WEp0mkxheIryZS3X1pbED1TqgUM=
- secure: cwV1rA8+CUHonJg40dRHCcd8KmYl9EzpCUcnS8vm/1qNkXpRmEAvwNKjZct0sZ8ZFKjKEUEzhyG0+cZVRzvEhi108/WZ5pIxp01EdtSFZTlIg73llALb2P8HClHuy4XSBDz0G4nTLES11usUGpCsLckSudNtb7bdUAH356NxFvQ=
- secure: XNFSHaGHiJfj4TvW6Oud1Z1dKnkXYk0njX2xjfljfFlHf4eCSIUxO9giad4xq2sE7vrjk+JpLLj/te7qjug91Ih7KH0i9T56d57q9vfu8juW49NBQxRnfhlvYWyrto5rmnKEa8Mcs/smgER6dllsURz10AqLKM32mkijG4VgdcM=
- secure: VFkAqPydQ9NTxXkp/gNzNUoaYd/xvryKy+ARXJhbvgUkpO2VMyo2D2wU1G6ECVzitqpO+gaUn2mu7fO1M0KjpeKp5Si7HG3fUVb4sXg6Sim563iot2rJUfiXpu6FOqPfUwQHpyUXqUfAPOA6bI9ZNKNBAurGxgLgt4AP2PjObV4=
- secure: Q5UXkBKvrqcC09peZa/U/XilT4q32fm2tWEu/0Pq0JquKS+BmOevEmntW0zMBe8R5K5AzbuDKurAyelCqXDNj3W8Tjg/xreIqR3ccnfo202wkLiIAtko8oUXzyiLgeMjjyge76lHIkaGxWXNGzsDUZmq5qUQW2YEQ5vGiv0vc5A=
- .config/deploy-artifacts.sh
- .config/publish-javadocs.sh
- codecov
113 changes: 113 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,113 @@
# Contributing to Hipster4j

First of all, thank you so much for being interested in contributing to Hipster4j!. This document will guide you through this process. You can contribute in different ways:

- Reporting issues
- Fixing bugs or developing new features
- Creating new examples
- Sending a motivating email telling us how do you like the library (or dislike) :)

## Issues
Feel free to open new issues or participating in the discussion of the existing ones on
[this repository](https://github.com/citiususc/hipster/issues), but before doing so, please make sure that the issue is not duplicated and/or the discussion is related to the topic of the issue.

## Pull requests
Code contributions are welcome following a process which guarantees the long-term maintainability of the project.
You can contribute either with bugfixes or new features. Before submitting a new feature, we highly encourage you to first open a new issue describing its motivation and details and discuss it with one of the project mantainers. This will ensure that the feature fits well in the project.

### Step 1: Open a new issue (if not opened yet)
Before starting to code, it is desirable to first open an issue describing the bug or the new feature. Please be sure the issue is not duplicated.

### Step 2: Fork the repository
Fork the project https://github.com/citiususc/hipster into your account. Then, check out your copy of the project locally.
```
git clone git@github.com:username/hipster.git
cd hipster
git remote add upstream https://github.com/citiususc/hipster.git
```

### Step 3: Create a new feature branch `contrib/issue-number`
Put your code in a new feature branch. The name of the new branch should start with `contrib/`. This convention will help us to keep track of future changes from pull requests.
```
git checkout -b contrib/issue-number origin/branch
```
Note that origin/‘branch’ would correspond with any of the current development branches (for example 1.0.X) but never the origin/master branch. For example, suppose that the latest version of the project is v1.0.0 and you want to fix a new bug that you discovered in this version. If the new reported issue has an id, say, #186, then you would create your feature branch in this way:
```
git checkout -b contrib/issue-186 origin/1.0.X
```

### Step 4: Committing your changes
First of all, make sure that git is configured with your complete name and email address. It is desirable to use the same email of your Github account, this will help to identify the contributions:
```
git config --global user.name "Your Name"
git config --global user.email "your@email.com"
```
Write a good commit message. It should describe the changes you made and its motivation. Be sure to reference the issue you are working in the commit that finishes your contribution using one the [keywords to close issues in Github](https://help.github.com/articles/closing-issues-via-commit-messages/).
If your commit message is too long, try to summarize the changes in the header of the message, like this:
```
fix #xx : summarize your commit in one line
If needed, explain more in detail the changes introduced in your
commit and the motivation. You could introduce some background
about the issue you worked in.
This message can contain several paragraphs and be as long as
you need, but try to do a good indentation: the columns should
be shorter than 72 characters and with a proper word-wrap.
The command `git log` will print this complete text in a nice
way if you format it properly.
```
The header and the body of the commit message must be separated by a line in blank. The header is the message shown when running the command `git shortlog`.

#### Keep your branch in sync
Remember to keep in sync your version. Use git rebase instead of git merge to bring all the changes from the upstream branch to your feature branch:

```
git fetch upstream
git rebase upstream/branch #where branch would be 1.0.X, 1.1.X etc
```

#### Test your code
Verify that your changes are actually working by adding the required unit tests. It is desirable to include unit test covering all new features you implement. Also, if you find a bug which is not currently detected by the unit tests you might consider to implement a new one or modify the current implementation. After this, you can verify that everything works fine after your changes with:

```
mvn clean test
```

### Step 5: Push your changes

Push your changes to your forked project with:
```
git push origin my-feature-branch
```

### Step 6: Create and submit a pull request
Go to your forked project on GitHub, select your feature branch and click the “Compare, review, create a pull request button”. After that, we will review your pull request in a few days (hopefully!), but if we delay please be patient :). We do our best in our spare time to keep the project updated, but unfortunately there may be some periods of time in which we simply can’t work in the project.



### License Agreement
By contributing your code, you agree to license your contribution under the terms of the [Apache 2.0 license](https://raw.githubusercontent.com/citiususc/hipster/4ca93e681ad7335acbd0bea9e49fe678d56f3519/LICENSE).

Also, remember to add this header to each new file that you’ve created:

```
/*
* Copyright 2015 Centro de Investigación en Tecnoloxías da Información (CITIUS),
* University of Santiago de Compostela (USC).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
```

That’s all!

0 comments on commit 5a7ea50

Please sign in to comment.