Skip to content

Commit

Permalink
Enable GraalVM native tests for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kaneeldias committed Jun 9, 2023
1 parent 13c2eae commit 9e92305
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,21 @@ clean {
}
}

def graalvmFlag = ""

task testExamples {
if (project.hasProperty('balGraalVMTest')) {
graalvmFlag = '--graalvm'
}
doLast {
examples.each { example ->
try {
exec {
workingDir "${project.projectDir}/${example}"
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', '/c', "${ballerinaDist}/bin/bal.bat test --offline && exit %%ERRORLEVEL%%"
commandLine 'cmd', '/c', "${ballerinaDist}/bin/bal.bat test --offline ${graalvmFlag} && exit %%ERRORLEVEL%%"
} else {
commandLine 'sh', '-c', "${ballerinaDist}/bin/bal test --offline"
commandLine 'sh', '-c', "${ballerinaDist}/bin/bal test --offline ${graalvmFlag}"
}
}
} catch (Exception e) {
Expand Down

0 comments on commit 9e92305

Please sign in to comment.