Skip to content

Commit

Permalink
Scala CLI package - set priority, section and maintainer
Browse files Browse the repository at this point in the history
  • Loading branch information
lwronski committed Sep 12, 2022
1 parent 8ea26df commit 19fa509
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
10 changes: 6 additions & 4 deletions .github/scripts/generate-os-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ generate_deb() {
--source-app-path "$(launcher)" \
--output "$ARTIFACTS_DIR/scala-cli.deb" \
--description "Scala CLI" \
--maintainer "Scala CLI" \
--launcher-app "scala-cli"
--maintainer "scala-cli@virtuslab.com" \
--launcher-app "scala-cli" \
--priority "optional" \
--section "devel" \
mv "$ARTIFACTS_DIR/scala-cli.deb" "$ARTIFACTS_DIR/scala-cli-x86_64-pc-linux.deb"
}

Expand All @@ -57,7 +59,7 @@ generate_rpm() {
--source-app-path "$(launcher)" \
--output "$ARTIFACTS_DIR/scala-cli-x86_64-pc-linux.rpm" \
--description "Scala CLI" \
--maintainer "Scala CLI" \
--maintainer "scala-cli@virtuslab.com" \
--license "ASL 2.0" \
--launcher-app "scala-cli"
}
Expand All @@ -84,7 +86,7 @@ generate_msi() {
--source-app-path "$(launcher)" \
--output "$ARTIFACTS_DIR/scala-cli-x86_64-pc-win32.msi" \
--product-name "Scala CLI" \
--maintainer "Scala CLI" \
--maintainer "scala-cli@virtuslab.com" \
--launcher-app "scala-cli" \
--license-path "./LICENSE" \
--exit-dialog "To run Scala CLI, open a Command window, and type scala-cli + Enter. If scala-cli cannot be found, ensure that the Command window was opened after Scala CLI was installed." \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ class NativePackagerTests extends ScalaCliSuite {

testInputs.fromRoot { root =>

val appName = helloWorldFileName.stripSuffix(".scala").toLowerCase()
val appName = helloWorldFileName.stripSuffix(".scala").toLowerCase()
val priority = "optional"
val section = "devel"

val destDir = os.rel / "package"
os.makeDir.all(root / destDir)
Expand All @@ -127,7 +129,9 @@ class NativePackagerTests extends ScalaCliSuite {
"--output", destDir / s"$appName.deb",
"--maintainer", "scala-cli-test",
"--description", "scala-cli-test",
"--launcher-app", appName
"--launcher-app", appName,
"--priority", priority,
"--section", section,
)
// format: on
os.proc(cmd).call(
Expand All @@ -139,6 +143,11 @@ class NativePackagerTests extends ScalaCliSuite {
val launcher = root / destDir / s"$appName.deb"
expect(os.isFile(launcher))

// check flags
val debInfo = os.proc("dpkg", "--info", launcher).call().out.text().trim
expect(debInfo.contains(s"Priority: $priority"))
expect(debInfo.contains(s"Section: $section"))

if (hasDocker) {
val script =
s"""#!/usr/bin/env bash
Expand Down

0 comments on commit 19fa509

Please sign in to comment.