Created
March 3, 2022 09:55
-
-
Save fbaierl/f50e6049509eb4aede73ab97dd95b80b to your computer and use it in GitHub Desktop.
gradle: build scala.js (on linux)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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