diff options
| author | Jiuyang Liu | 2021-04-04 13:32:20 +0800 |
|---|---|---|
| committer | GitHub | 2021-04-04 01:32:20 -0400 |
| commit | ca8b670eac0b0def66249738e52ef8137d30a8b5 (patch) | |
| tree | f3d2f0f6bfed02bbcf9e5682af1e439d6b06cfd5 /build.sc | |
| parent | d0d3cd4ec4348eea381fe463ac9c96956fdd5eba (diff) | |
Fix mill cache download (#2171)
Diffstat (limited to 'build.sc')
| -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) } |
