| steps: |
| - name: 'gcr.io/cloud-builders/git' |
| args: ['clone', '${_REPO}', '/workspace/code'] |
| id: 'CLONE' |
| waitFor: |
| - '-' |
| - name: 'gcr.io/cloud-builders/git' |
| dir: '/workspace/code' |
| args: |
| - 'checkout' |
| - '${_COMMIT}' |
| id: 'CHECKOUT' |
| waitFor: |
| - 'CLONE' |
| - name: 'ubuntu' |
| args: ['mkdir', '/workspace/out'] |
| waitFor: |
| - '-' |
| - name: 'gcr.io/kythe-public/kythe-javac-extractor-artifacts:stable' |
| volumes: |
| - name: 'kythe_extractors' |
| path: '/opt/kythe/extractors' |
| id: 'JAVA-ARTIFACTS' |
| waitFor: |
| - '-' |
| - name: 'gcr.io/kythe-public/build-preprocessor:stable' |
| args: ['/workspace/code/build.gradle'] |
| id: 'PREPROCESS' |
| waitFor: |
| - 'CHECKOUT' |
| - name: 'gradle:5.2.1-jdk8-slim' |
| entrypoint: 'gradle' |
| args: |
| - 'clean' |
| - 'build' |
| - '-s' |
| - '-S' |
| - '-d' |
| - '-b' |
| - '/workspace/code/build.gradle' |
| env: |
| - 'KYTHE_CORPUS=${_CORPUS}' |
| - 'KYTHE_OUTPUT_DIRECTORY=/workspace/out' |
| - 'KYTHE_ROOT_DIRECTORY=/workspace/code' |
| - 'JAVAC_EXTRACTOR_JAR=/opt/kythe/extractors/javac_extractor.jar' |
| - 'REAL_JAVAC=/usr/bin/javac' |
| - 'TMPDIR=/workspace/out' |
| - 'KYTHE_JAVA_RUNTIME_OPTIONS=-Xbootclasspath/p:/opt/kythe/extractors/javac9_tools.jar' |
| volumes: |
| - name: 'kythe_extractors' |
| path: '/opt/kythe/extractors' |
| id: 'EXTRACT' |
| waitFor: |
| - 'JAVA-ARTIFACTS' |
| - 'PREPROCESS' |
| - name: 'gcr.io/kythe-public/kzip-tools:stable' |
| entrypoint: 'bash' |
| args: |
| - '-c' |
| - '/opt/kythe/tools/kzip merge --output /workspace/out/${_COMMIT}.kzip /workspace/out/*.kzip' |
| artifacts: |
| objects: |
| location: 'gs://${_BUCKET_NAME}/${_CORPUS}/' |
| paths: |
| - '/workspace/out/javac-extractor.err' |
| - '/workspace/out/${_COMMIT}.kzip' |
| |