version: 2.1
jobs:
  build:

    docker:
      - image: circleci/openjdk:8-jdk

    steps:

      - restore_cache:
          keys:
            - source-v1-{{ .Branch }}-{{ .Revision }}
            - source-v1-{{ .Branch }}-
            - source-v1-
      - checkout
      - save_cache:
          key: source-v1-{{ .Branch }}-{{ .Revision }}
          paths:
            - ".git"

      - restore_cache:
          keys:
            # when lock file changes, use increasingly general patterns to restore cache
            - gradle-v1-{{ .Branch }}-{{ checksum "build.gradle" }}
            - gradle-v1-{{ .Branch }}-
            - gradle-v1-

      - run: ./gradlew build javadoc
      - run: ./gradlew requireJavadoc

      - save_cache:
          paths:
            - ~/.gradle
          key: gradle-v1-{{ .Branch }}-{{ checksum "build.gradle" }}

workflows:
  version: 2
  build:
    jobs:
      - build

version: 2.1
jobs:
  build:

    docker:
      - image: circleci/openjdk:8-jdk

    steps:

      - restore_cache:
          keys:
            - source-v1-{{ .Branch }}-{{ .Revision }}
            - source-v1-{{ .Branch }}-
            - source-v1-
      - checkout
      - save_cache:
          key: source-v1-{{ .Branch }}-{{ .Revision }}
          paths:
            - ".git"

      - restore_cache:
          keys:
            # when lock file changes, use increasingly general patterns to restore cache
            - gradle-v1-{{ .Branch }}-{{ checksum "build.gradle" }}
            - gradle-v1-{{ .Branch }}-
            - gradle-v1-

      - run: cd .. && git clone --depth 1 https://github.com/typetools/checker-framework.git
      - run: cd ../checker-framework && checker/bin-devel/build.sh

      # "-PcfLocal" is needed for both `build` and `javadoc` tasks
      - run: export CHECKERFRAMEWORK=$(cd ../checker-framework && pwd) && ./gradlew build javadoc -PcfLocal
      - run: ./gradlew requireJavadoc

      - save_cache:
          paths:
            - ~/.gradle
          key: gradle-v1-{{ .Branch }}-{{ checksum "build.gradle" }}

workflows:
  version: 2
  build:
    jobs:
      - build

Build Checker Framework from source in CI
Build Checker Framework from source in CI

