Commit 68d780a5 authored by Luke081515's avatar Luke081515

Setup CI

* Add java-lint
parent d2cab609
image: openjdk:7u131-jdk
before_script:
- bash ci/docker_install.sh > /dev/null
test:java-lint:
script:
- bash ci/javalint.sh ./
\ No newline at end of file
#!/bin/bash
# We need to install dependencies only for Docker
[[ ! -e /.dockerenv ]] && exit 0
set -xe
# Install git (the php image doesn't have it) which is required by composer
apt-get update -yqq
apt-get install git -yqq
\ No newline at end of file
#!/bin/bash
#Usage: `javalint.sh /path/to/dir` or `javalint.sh /path/to/file.php`
error=false
while test $# -gt 0; do
current=$1
shift
if [ ! -d $current ] && [ ! -f $current ] ; then
echo "Invalid directory or file: $current"
error=true
continue
fi
for file in `find $current -type f -name "*.java"` ; do
RESULTS=`javac $file`
if [ "$RESULTS" != "" ] ; then
echo $RESULTS
error=true
fi
done
done
if [ "$error" = true ] ; then
exit 1
else
exit 0
fi
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment