variables:
  GRADLE_OPTS: "-Dorg.gradle.daemon=false"
  TERM: "dumb"

before_script:
  - chmod +x gradlew

stages:
  - test
  - check

java-8:
  stage: test
  image: openjdk:8
  script: ./gradlew clean build

java-11:
  stage: test
  image: openjdk:11
  script: ./gradlew clean build

check:
  stage: check
  image: openjdk:8
  script:
    - export JADX_LAST_TAG="$(git describe --abbrev=0 --tags)"
    - export JADX_VERSION="${JADX_LAST_TAG:1}-dev-$(git rev-parse --short HEAD)"
    - ./gradlew clean sonarqube -Dsonar.host.url=$SONAR_HOST -Dsonar.organization=$SONAR_ORG -Dsonar.login=$SONAR_TOKEN -Dsonar.branch.name=dev
    - ./gradlew clean dist
  artifacts:
    paths:
      - build/jadx*.zip
