---

machine:
  java:
    version: oraclejdk8
  environment:
    TERM: dumb

checkout:
  override:
    - git clone https://github.com/DMDirc/Meta.git $HOME/meta
    - git submodule update --init --remote:
        pwd:
          ../meta
    - git remote set-url origin https://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git:
        pwd:
          ../meta/client
    - >
      cd ../meta/client;
      if [ -n "$CIRCLE_PR_NUMBER" ]; then
          git fetch origin pull/$CIRCLE_PR_NUMBER/head:circleci;
      else
          git fetch origin $CIRCLE_BRANCH:circleci;
      fi
    - git fetch --tags:
        pwd:
          ../meta/client
    - git checkout circleci:
        pwd:
          ../meta/client

test:
  override:
    - ./gradlew --stacktrace --parallel client:jar client:test:
        pwd:
          ../meta

general:
  artifacts:
    - ../meta/client/build/libs/

---

machine:
  java:
    version: oraclejdk8
  environment:
    TERM: dumb

checkout:
  override:
    - git clone https://github.com/DMDirc/Meta.git $HOME/meta
    - git submodule update --init --remote:
        pwd:
          ../meta
    - git remote set-url origin https://github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME.git:
        pwd:
          ../meta/client
    - >
      cd ../meta/client;
      if [ -n "$CIRCLE_PR_NUMBER" ]; then
          git fetch origin pull/$CIRCLE_PR_NUMBER/head:circleci;
      else
          git fetch origin $CIRCLE_BRANCH:circleci;
      fi
    - git fetch --tags:
        pwd:
          ../meta/client
    - git checkout circleci:
        pwd:
          ../meta/client

dependencies:
  override:
    - ./gradlew dependencies:
        pwd: ../meta

test:
  override:
    - ./gradlew --stacktrace --parallel client:jar client:test:
        pwd:
          ../meta

general:
  artifacts:
    - ../meta/client/build/libs/

Make dependencies use gradlew again.
Make dependencies use gradlew again.

This should cache the gradle binary and save us a load of time.
