diff options
| -rw-r--r-- | build.sc | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -97,7 +97,9 @@ class firrtlCrossModule(val crossScalaVersion: String) extends CrossSbtModule wi } def downloadAntlr4Jar = T.persistent { - Util.download(s"https://www.antlr.org/download/antlr-$antlr4Version-complete.jar") + if (!os.isFile( T.ctx.dest / "antlr4" )) + Util.download(s"https://www.antlr.org/download/antlr-$antlr4Version-complete.jar", os.rel / "antlr4") + PathRef(T.ctx.dest / "antlr4") } def generatedAntlr4Source = T.sources { @@ -155,16 +157,20 @@ class firrtlCrossModule(val crossScalaVersion: String) extends CrossSbtModule wi else throw new Exception("mill cannot detect your architecture of your Windows") else throw new Exception("mill cannot detect your operation system.") - val zip = Util.downloadUnpackZip( - s"https://github.com/protocolbuffers/protobuf/releases/download/v$protocVersion/protoc-$protocVersion-$protocBinary.zip" - ) + val unpackPath = os.rel / "unpacked" + val bin = if(isWindows) - zip.path / "bin" / "protoc.exe" + T.ctx.dest / unpackPath / "bin" / "protoc.exe" else - zip.path / "bin" / "protoc" + T.ctx.dest / unpackPath / "bin" / "protoc" + if (!os.exists(bin)) + Util.downloadUnpackZip( + s"https://github.com/protocolbuffers/protobuf/releases/download/v$protocVersion/protoc-$protocVersion-$protocBinary.zip", + unpackPath + ) // Download Linux/Mac binary doesn't have x. - if (!isWindows) os.perms.set(bin, "--x------") + if (!isWindows) os.perms.set(bin, "rwx------") PathRef(bin) } |
