Skip to content

Commit

Permalink
Use non-toolchain version
Browse files Browse the repository at this point in the history
  • Loading branch information
dondonz committed Apr 12, 2023
1 parent 37c8ae5 commit c67260a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ plugins {
id "biz.aQute.bnd.builder" version "6.4.0"
}

if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
def msg = String.format("This build must be run with java 1.8 - you are running %s - gradle finds the JDK via JAVA_HOME=%s",
JavaVersion.current(), System.getenv("JAVA_HOME"))
throw new GradleException(msg)
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

def getDevelopmentVersion() {
def output = new StringBuilder()
def error = new StringBuilder()
Expand All @@ -25,18 +34,11 @@ def getDevelopmentVersion() {
"0.0.0-" + new SimpleDateFormat('yyyy-MM-dd\'T\'HH-mm-ss').format(new Date()) + "-" + gitHash
}


def releaseVersion = System.env.RELEASE_VERSION
version = releaseVersion ? releaseVersion : getDevelopmentVersion()
println "Building version = " + version
group = 'com.graphql-java'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

repositories {
mavenCentral()
mavenLocal()
Expand Down

0 comments on commit c67260a

Please sign in to comment.