Skip to content

Instantly share code, notes, and snippets.

@fbaierl
Created March 3, 2022 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fbaierl/f50e6049509eb4aede73ab97dd95b80b to your computer and use it in GitHub Desktop.
Save fbaierl/f50e6049509eb4aede73ab97dd95b80b to your computer and use it in GitHub Desktop.
gradle: build scala.js (on linux)
tasks.register('buildui') {
doLast {
// clone & pull the sbt-extras repository from github
def sbtExtrasDirPath = 'sbt-extras'
def sbtExtrasDir = file(sbtExtrasDirPath)
try{
if(!sbtExtrasDir.exists()){
org.ajoberstar.grgit.Grgit.clone(dir: sbtExtrasDir, uri: 'https://github.com/dwijnand/sbt-extras.git')
}
Grgit.open(dir: project.file(sbtExtrasDir)).pull(rebase: false)
} catch (TransportException e){
logger.warn("Unable to clone & push sbt-extras repository. " +
"Failure is imminent if this is the first time this build is executed on this machine.")
}
// copy shell script to working dir
// for now this has to be located in the correct dir
copy {
from sbtExtrasDirPath + '/sbt'
into '.'
}
// invoke sbt-extras to build ui
exec {
workingDir '.'
executable 'sbt'
args 'fastOptJS'
}
// remove previously copied file
delete 'sbt'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment