Skip to content

Commit

Permalink
merge develop 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolu1990 committed May 14, 2018
2 parents 8ceb084 + 9046247 commit 7bd3368
Show file tree
Hide file tree
Showing 107 changed files with 2,036 additions and 858 deletions.
37 changes: 21 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
language: java
jdk:
- openjdk6
- openjdk7
- oraclejdk7
- oraclejdk8

# blacklist
branches:
except:
- gh-pages

# whitelist
branches:
only:
- master
- develop
- master
- develop

# Use the container-based infrastructure
sudo: false

cache:
directories:
- $HOME/.m2
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'

# Use to publish the gdx2d API Javadoc to the gdx2d website
env:
global:
secure: Trl21W5O4XR8sTR9JPrYk4Rl/9j3CfbXLvFOWepQ8dcl5r90OeqUtBZvEygxzem1fqBGDHPryC/hSMoimac5YQj9J7PFqi15zQ4JhYNbg8zvpgfGk4tJwmJ+nBzz9TF6lkZQsRGwqpWYaSnv5BlL8fnuIRREe2FbHyCEZEcLeNk=
# Publish the gdx2d API Javadoc to the gdx2d website
# - secure: Trl21W5O4XR8sTR9JPrYk4Rl/9j3CfbXLvFOWepQ8dcl5r90OeqUtBZvEygxzem1fqBGDHPryC/hSMoimac5YQj9J7PFqi15zQ4JhYNbg8zvpgfGk4tJwmJ+nBzz9TF6lkZQsRGwqpWYaSnv5BlL8fnuIRREe2FbHyCEZEcLeNk=

# Publish snapshots to Sonatype (CI_DEPLOY_USERNAME, CI_DEPLOY_PASSWORD)
- secure: "kNBemLDqDCzTf0OUtBImE68EO6s4nhXM5fxn+iGfEtAk+W70KlV6L5BkKmAbmlI/iZqtwA13FMmj4cIK9gNDj0nydgDLuCUGRIbnYdOnxrVc6Ykkw0ja61aRtiFpJs/WWqIqrZOJqnp/f9pmx+s3QKnHvTndepqv8/LKEdfeYLQ="
- secure: "H4ipPQ5dP0P1hmRBXQSIvmgEgZS4YI8ZrRjl2pNKImJ3KVN+pM9Jft9+DxOC8kCbLyI6dPHRkNFIa5A2BWoWrj20nOz2fTBNtW/kJQReAALoCycMZilN5YXKFsPERSSfJpws2qXTfIZq9A1PwsfsNOgdUM3z58T5Zyp5rzoTzVg="

# SonarQube analysis (SONAR_TOKEN)
- secure: "QY0AlaKUXRfzNGm5M9by4EV5PrZst7FFtLgpmk7WKj/fYgCrh5LAO3q49+OQn+rAoY7TsxZoF+KNtBC7Xdq0/9FzhYhGLXlsCZpvuc1NVU8qCSA1mNs1bkEadITVBguxQkNtL9C8mhBEXsWZ90t1QGBYUaXFtbnwd3yUv4ZbECA="

# Maven build only (test and gpg signature disabled)
# Snapshots and releases are upload manually to Sonatype for now
install:
- mvn install -DskipTests=true -Dgpg.skip=true

# Run the SonarQube analysis
script:
- .travis/sonar-analysis.sh

# Publish snapshots to Sonatype
after_success:
- .travis/deploy-snapshot.sh

# Do not generate the javadoc for each modules any more
# after_success:
# - ./.travis/publish-javadoc-api.sh
13 changes: 13 additions & 0 deletions .travis/deploy-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<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>
<server>
<!--
Maven deploy settings for Travis
OSSRH login and password must be encrypted and available in the environment.
-->
<id>ossrh</id>
<username>${env.CI_DEPLOY_USERNAME}</username>
<password>${env.CI_DEPLOY_PASSWORD}</password>
</server>
</servers>
</settings>
25 changes: 25 additions & 0 deletions .travis/deploy-snapshot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Deploy a jar, source jar, and javadoc jar to Sonatype's snapshot repo.
#
# Adapted from https://coderwall.com/p/9b_lfq and
# http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/

SLUG="hevs-isi/gdx2d"
JDK="openjdk6"
BRANCH="develop"

set -e
if [ "$TRAVIS_REPO_SLUG" != "$SLUG" ]; then
echo "Skipping snapshot deployment: wrong repository. Expected '$SLUG' but was '$TRAVIS_REPO_SLUG'."
elif [ "$TRAVIS_JDK_VERSION" != "$JDK" ]; then
echo "Skipping snapshot deployment: wrong JDK. Expected '$JDK' but was '$TRAVIS_JDK_VERSION'."
elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "Skipping snapshot deployment: was pull request."
elif [ "$TRAVIS_BRANCH" != "$BRANCH" ]; then
echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '$TRAVIS_BRANCH'."
else
echo "Deploying snapshot..."
mvn deploy -DskipTests -Dgpg.skip --settings ./.travis/deploy-settings.xml
echo "Snapshot deployed!"
fi
39 changes: 39 additions & 0 deletions .travis/sonar-analysis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh
# Exit on failure
set -e

# Adapted from https://github.com/bellingard/multi-language-project/blob/master/runSonarQubeAnalysis.sh
# This assumes that the following variable is defined:
# - SONAR_TOKEN => token of a user who has the "Execute Analysis" permission on the SQ server

if [ "$TRAVIS_JDK_VERSION" != "openjdk6" ]; then
echo "Skipping analysis: wrong JDK. Expected 'openjdk6' but was '$TRAVIS_JDK_VERSION'."

# And run the analysis
# It assumes that the project uses Maven and has a POM at the root of the repo
elif [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
# => This will run a full analysis of the project and push results to the SonarQube server.
#
# Analysis is done only on master so that build of branches don't push analyses to the same project and therefore "pollute" the results
echo "Starting analysis by SonarQube..."
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -B -e -V \
-Dsonar.host.url=https://nemo.sonarqube.org \
-Dsonar.login=$SONAR_TOKEN

elif [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -n "${GITHUB_TOKEN-}" ]; then
# => This will analyse the PR and display found issues as comments in the PR, but it won't push results to the SonarQube server
#
# For security reasons environment variables are not available on the pull requests
# coming from outside repositories
# http://docs.travis-ci.com/user/pull-requests/#Security-Restrictions-when-testing-Pull-Requests
# That's why the analysis does not need to be executed if the variable GITHUB_TOKEN is not defined.
echo "Starting Pull Request analysis by SonarQube..."
mvn clean package sonar:sonar -B -e -V \
-Dsonar.host.url=https://nemo.sonarqube.org \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.analysis.mode=preview \
-Dsonar.github.oauth=$GITHUB_TOKEN \
-Dsonar.github.repository=$TRAVIS_REPO_SLUG \
-Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST
fi
# When neither on master branch nor on a non-external pull request => nothing to do
41 changes: 40 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,35 @@ If you are using IntelliJ IDEA, [see this article](http://blog.jetbrains.com/ide

Please do use tabs, no spaces! Encoding of files should be defaulted to UTF-8. An [editor configuration file](https://github.com/hevs-isi/gdx2d/blob/master/.editorconfig) is also available.

## Import project in eclipse

```sh
cd rootOfThisRepository
mvn clean package
- import/Existing Projects into Workspace/ Don't use the maven import.
- Select the root of the gdx2d clone
- Enable "Search for nested projects"
- Finish
```
Note : sub projects like gdx2d-demoDesktop are using jar generated from the "mvn clean package".
## Update gdx2d-demoDesktop library jars from gdx2d-library
Assumption :
- gdx2d-demoDesktop/build.properties/gdx2d.version=1.2.2-SNAPSHOT
- gdx2d-library/gdx2d-core/src/main/java/ch/hevs/gdx2d/lib/Version.java/Version/VERSION=1.2.2-SNAPSHOT
```sh
cd rootOfThisRepository
mvn clean package
cp gdx2d-library/gdx2d-desktop/target/gdx2d-desktop-1.2.2-SNAPSHOT.jar gdx2d-demoDesktop/libs/gdx2d-desktop-1.2.2-SNAPSHOT.jar
cp gdx2d-library/gdx2d-desktop/target/gdx2d-desktop-1.2.2-SNAPSHOT-sources.jar gdx2d-demoDesktop/libs/gdx2d-desktop-1.2.2-SNAPSHOT-sources.jar
```
## Publishing
The gdxd library is built using Maven and its modules are distributed as jar files since version `1.2.0`. Both artifacts `gdx2d-core` and `gdx2d-desktop` are published on Sonatype as [snapshots releases](https://oss.sonatype.org/content/repositories/snapshots/ch/hevs/gdx2d/) and official releases are published [on the Maven Central repository](http://search.maven.org/#search%7Cga%7C1%7Cch.hevs.gdx2d).
Expand All @@ -17,14 +46,24 @@ In order to deploy to Maven central, the project has to meet a number of require
Snapshot and release versions of the gdx2d library can be uploaded [to Sonatype](https://oss.sonatype.org/#nexus-search;quick~ch.hevs) using the Maven deploy task (`$ mvn clean deploy`). Please have a look [at this guide](http://central.sonatype.org/pages/apache-maven.html) to setup the environment and read [this guide](http://central.sonatype.org/pages/releasing-the-deployment.html) to publish a release version from OSSRH to the Maven Central Repository.
### Publish gdx2d snapshot
Snapshots are automatically deployed from the `develop` branch to the [Sonatype repository](https://oss.sonatype.org/content/repositories/snapshots/ch/hevs/gdx2d/) using Travis (valid Sonatype OSS username and password is required).
1. Install the [Travis CI Client (CLI and Ruby library)](https://github.com/travis-ci/travis.rb)
2. [Encrypt](https://docs.travis-ci.com/user/encryption-keys/) your Sonatype OSS password with `travis encrypt "CI_DEPLOY_PASSWORD='<my-password>'" --add`
3. Add your Sonatype OSS login with `CI_DEPLOY_USERNAME='<my-username>'` in the `.travis.yml` file
Deployment will only happen when the build was successful and the encrypted variables are available. If the deployment itself was unsuccessful, then the build still passes.
### New gdx2d release
Before releasing any gdx2d version, please:
1. Create a release branch from the develop branch to start a release (see the [Gitflow Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow)).
2. Update the `Version.java` file in the `gdx2d-core` project. The version name and the `isSnapshot` must be set correctly. Output debug information must be disabled for official releases.
3. Update the `CHANGELOG.md`, `README.md` files and guides before releasing a new version. These files are included in the released jar files.
4. Install the Maven artifacts locally. In the generated Jar file, check the Manifest and all included files. All artifacts must be signed. The sources and the Javadoc must also be released.
4. Install the Maven artifacts locally. In the generated Jar file, check the Manifest and all included files. All artifacts must be signed (be sure you have installed and configured `gpg` [as described here](http://central.sonatype.org/pages/working-with-pgp-signatures.html)). The sources and the Javadoc must also be released.
5. Publish and test a `SNAPSHOT` releases first.
6. Finally, when ready, publish the final release to the Maven Central repository.
7. Close the current release branch. Merge into develop and master and add a tag for the latest version.
Expand Down
2 changes: 1 addition & 1 deletion gdx2d-demoDesktop/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<classpathentry kind="src" output="data" path="data"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="lib" path="libs/accordion-1.2.0-jar-with-dependencies.jar"/>
<classpathentry kind="lib" path="libs/gdx2d-desktop-1.2.1.jar" sourcepath="libs/gdx2d-desktop-1.2.1-sources.jar"/>
<classpathentry kind="lib" path="libs/gdx2d-desktop-1.2.2.jar" sourcepath="libs/gdx2d-desktop-1.2.2.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions gdx2d-demoDesktop/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.metadata
.gradle
bin/
classes/
tmp/
*.tmp
*.bak
Expand Down
2 changes: 1 addition & 1 deletion gdx2d-demoDesktop/build.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Ant build properties file for the gdx2d-demoDesktop project

# Gdx2d library version
gdx2d.version=1.2.1
gdx2d.version=1.2.2
Binary file modified gdx2d-demoDesktop/data/images/Android_PI_48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gdx2d-demoDesktop/data/images/clock_second.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gdx2d-demoDesktop/data/images/color_pattern.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gdx2d-demoDesktop/data/images/lumberjack_sheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gdx2d-demoDesktop/data/images/noun_45114_cc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gdx2d-demoDesktop/data/images/star.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gdx2d-demoDesktop/data/maps/tmw_desert_spacing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions gdx2d-demoDesktop/data/shader/advanced/perspective.fp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// in from the java side
uniform sampler2D backbuffer;
uniform vec2 resolution;
uniform float time;
uniform int enabled;
uniform vec3 cameraPosition;
uniform vec3 cameraAxis;
uniform float cameraAngle;
uniform float screenPlanDistance;

//"in" varyings from our vertex shader
varying vec4 vColor;
varying vec2 vTexCoord;


mat3 rotationMatrix(vec3 axis, float angle)
{
axis = normalize(axis);
float s = sin(angle);
float c = cos(angle);
float oc = 1.0 - c;

return mat3(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s,
oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s,
oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c);
}

void main() {
if(enabled == 1){
//Calculate the vector coming out from the camera to the pixel of the screen in the 3D space.
vec3 pixelRay;
pixelRay.xz = (gl_FragCoord.xy / resolution.xy)*vec2(1.0, -1.0) + vec2(-0.5, 0.5);
pixelRay.y = screenPlanDistance;
pixelRay *= rotationMatrix(cameraAxis,cameraAngle);

//Calculate the colision point from the cameraPosition with the pixelRay, to the z plan.
vec2 hitPosition = cameraPosition.xy + pixelRay.xy * (cameraPosition.z / pixelRay.z) + vec2(0.5, 0);

//Graphic stuff
hitPosition = hitPosition - floor(hitPosition); //Optional texture repeat
vec4 me = texture2D(backbuffer, hitPosition);

//final color
gl_FragColor = me.rgba;
} else {
gl_FragColor = texture2D(backbuffer, gl_FragCoord.xy / resolution.xy);
}
}

Binary file modified gdx2d-demoDesktop/data/ui/uiskin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions gdx2d-demoDesktop/gdx2d-demoDesktop.iml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/libs/gdx2d-desktop-1.2.1.jar!/" />
<root url="jar://$MODULE_DIR$/libs/gdx2d-desktop-1.2.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/libs/gdx2d-desktop-1.2.1-sources.jar!/" />
<root url="jar://$MODULE_DIR$/libs/gdx2d-desktop-1.2.2-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class DemoAccelerometer extends PortableApplication {
// For low-pass filtering
private float smoothedValue = 0;

public static void main(String args[]) {
public static void main(String[] args) {
new DemoAccelerometer();
}

Expand Down
Loading

0 comments on commit 7bd3368

Please sign in to comment.