Skip to content

Commit

Permalink
Copy with executable flag (#5033)
Browse files Browse the repository at this point in the history
Re: #5029
  • Loading branch information
max-leuthaeuser authored Oct 28, 2024
1 parent 7d82f3f commit b200a36
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 deletions.
11 changes: 5 additions & 6 deletions joern-cli/frontends/csharpsrc2cpg/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,15 @@ astGenDlTask := {
astGenDir.mkdirs()

astGenBinaryNames.value.foreach { fileName =>
DownloadHelper.ensureIsAvailable(s"${astGenDlUrl.value}$fileName", astGenDir / fileName)
val file = astGenDir / fileName
DownloadHelper.ensureIsAvailable(s"${astGenDlUrl.value}$fileName", file)
// permissions are lost during the download; need to set them manually
file.setExecutable(true, false)
}

val distDir = (Universal / stagingDirectory).value / "bin" / "astgen"
distDir.mkdirs()
IO.copyDirectory(astGenDir, distDir)

// permissions are lost during the download; need to set them manually
astGenDir.listFiles().foreach(_.setExecutable(true, false))
distDir.listFiles().foreach(_.setExecutable(true, false))
IO.copyDirectory(astGenDir, distDir, preserveExecutable = true)
}

Compile / compile := ((Compile / compile) dependsOn astGenDlTask).value
Expand Down
11 changes: 5 additions & 6 deletions joern-cli/frontends/gosrc2cpg/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,15 @@ goAstGenDlTask := {
val goAstGenDir = baseDirectory.value / "bin" / "astgen"

goAstGenBinaryNames.value.foreach { fileName =>
DownloadHelper.ensureIsAvailable(s"${goAstGenDlUrl.value}$fileName", goAstGenDir / fileName)
val file = goAstGenDir / fileName
DownloadHelper.ensureIsAvailable(s"${goAstGenDlUrl.value}$fileName", file)
// permissions are lost during the download; need to set them manually
file.setExecutable(true, false)
}

val distDir = (Universal / stagingDirectory).value / "bin" / "astgen"
distDir.mkdirs()
IO.copyDirectory(goAstGenDir, distDir)

// permissions are lost during the download; need to set them manually
goAstGenDir.listFiles().foreach(_.setExecutable(true, false))
distDir.listFiles().foreach(_.setExecutable(true, false))
IO.copyDirectory(goAstGenDir, distDir, preserveExecutable = true)
}

Compile / compile := ((Compile / compile) dependsOn goAstGenDlTask).value
Expand Down
11 changes: 5 additions & 6 deletions joern-cli/frontends/jssrc2cpg/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,15 @@ astGenDlTask := {
val astGenDir = baseDirectory.value / "bin" / "astgen"

astGenBinaryNames.value.foreach { fileName =>
DownloadHelper.ensureIsAvailable(s"${astGenDlUrl.value}$fileName", astGenDir / fileName)
val file = astGenDir / fileName
DownloadHelper.ensureIsAvailable(s"${astGenDlUrl.value}$fileName", file)
// permissions are lost during the download; need to set them manually
file.setExecutable(true, false)
}

val distDir = (Universal / stagingDirectory).value / "bin" / "astgen"
distDir.mkdirs()
IO.copyDirectory(astGenDir, distDir)

// permissions are lost during the download; need to set them manually
astGenDir.listFiles().foreach(_.setExecutable(true, false))
distDir.listFiles().foreach(_.setExecutable(true, false))
IO.copyDirectory(astGenDir, distDir, preserveExecutable = true)
}

Compile / compile := ((Compile / compile) dependsOn astGenDlTask).value
Expand Down
11 changes: 5 additions & 6 deletions joern-cli/frontends/swiftsrc2cpg/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,15 @@ astGenDlTask := {
val astGenDir = baseDirectory.value / "bin" / "astgen"

astGenBinaryNames.value.foreach { fileName =>
DownloadHelper.ensureIsAvailable(s"${astGenDlUrl.value}$fileName", astGenDir / fileName)
val file = astGenDir / fileName
DownloadHelper.ensureIsAvailable(s"${astGenDlUrl.value}$fileName", file)
// permissions are lost during the download; need to set them manually
file.setExecutable(true, false)
}

val distDir = (Universal / stagingDirectory).value / "bin" / "astgen"
distDir.mkdirs()
IO.copyDirectory(astGenDir, distDir)

// permissions are lost during the download; need to set them manually
astGenDir.listFiles().foreach(_.setExecutable(true, false))
distDir.listFiles().foreach(_.setExecutable(true, false))
IO.copyDirectory(astGenDir, distDir, preserveExecutable = true)
}

Compile / compile := ((Compile / compile) dependsOn astGenDlTask).value
Expand Down

0 comments on commit b200a36

Please sign in to comment.