machine:
   java:
       version: oraclejdk8
dependencies:
    override:
        - git config --global user.email "circuitsoft@tuta.io"
        - git config --global user.name "mastercoms"
        - git clone https://github.com/GlowstoneMC/Glowkit.git
        - (cd Glowkit && chmod +x glowkit && ./glowkit p)
        - (cd Glowkit/Glowkit-Patched && mvn install)
test:
    override:
        - ./setup.sh
        - cp -r target/glowstone*.jar $CIRCLE_ARTIFACTS/
        - mkdir -p $CIRCLE_TEST_REPORTS/junit/
        - find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;

deployment:
  master:
    branch: master
    commands:
      - "mvn javadoc:javadoc javadoc:jar"
      - "mvn deploy"
      - "chmod +x .circle/*"
      - "./.circle/deploy.sh"
