-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use sbt-native-packager instead of sbt-pack
- Loading branch information
1 parent
e2dfea3
commit ae7a49c
Showing
3 changed files
with
45 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,15 @@ import Process._ | |
import Modes._ | ||
import ScaladocGeneration._ | ||
import com.jsuereth.sbtpgp.PgpKeys | ||
import sbt.Keys._ | ||
import sbt._ | ||
import complete.DefaultParsers._ | ||
import com.typesafe.sbt.packager.Keys._ | ||
import com.typesafe.sbt.packager.MappingsHelper.directory | ||
import com.typesafe.sbt.packager.universal.UniversalPlugin | ||
import com.typesafe.sbt.packager.universal.UniversalPlugin.autoImport.Universal | ||
import com.typesafe.sbt.packager.windows.WindowsPlugin | ||
import com.typesafe.sbt.packager.windows.WindowsPlugin.autoImport.Windows | ||
import sbt.Keys.* | ||
import sbt.* | ||
import complete.DefaultParsers.* | ||
import pl.project13.scala.sbt.JmhPlugin | ||
import pl.project13.scala.sbt.JmhPlugin.JmhKeys.Jmh | ||
import sbt.Package.ManifestAttributes | ||
|
@@ -16,8 +22,6 @@ import dotty.tools.sbtplugin.RepublishPlugin | |
import dotty.tools.sbtplugin.RepublishPlugin.autoImport._ | ||
import sbt.plugins.SbtPlugin | ||
import sbt.ScriptedPlugin.autoImport._ | ||
import xerial.sbt.pack.PackPlugin | ||
import xerial.sbt.pack.PackPlugin.autoImport._ | ||
import xerial.sbt.Sonatype.autoImport._ | ||
import com.typesafe.tools.mima.plugin.MimaPlugin.autoImport._ | ||
import org.scalajs.sbtplugin.ScalaJSPlugin | ||
|
@@ -2121,18 +2125,20 @@ object Build { | |
) | ||
|
||
lazy val commonDistSettings = Seq( | ||
packMain := Map(), | ||
publishArtifact := false, | ||
packGenerateMakefile := false, | ||
republishRepo := target.value / "republish", | ||
packResourceDir += (republishRepo.value / "bin" -> "bin"), | ||
packResourceDir += (republishRepo.value / "maven2" -> "maven2"), | ||
Compile / pack := (Compile / pack).dependsOn(republish).value, | ||
Universal / packageName := packageName.value, | ||
Universal / stage := (Universal / stage).dependsOn(republish).value, | ||
Universal / packageBin := (Universal / packageBin).dependsOn(republish).value, | ||
// ======== | ||
Universal / mappings ++= directory(republishRepo.value / "bin"), | ||
Universal / mappings ++= (Compile / dependencyClasspathAsJars).value.map(jar => jar.data -> s"lib/${jar.data.getName}"), | ||
Universal / mappings ++= directory(republishRepo.value / "maven2"), | ||
) | ||
|
||
lazy val dist = project.asDist(Bootstrapped) | ||
.settings(packageName := "scala3-" + dottyVersion) | ||
.settings( | ||
packArchiveName := "scala3-" + dottyVersion, | ||
republishBinDir := baseDirectory.value / "bin", | ||
republishCoursier += | ||
("coursier.jar" -> s"https://github.com/coursier/coursier/releases/download/v$coursierJarVersion/coursier.jar"), | ||
|
@@ -2141,51 +2147,62 @@ object Build { | |
) | ||
|
||
lazy val `dist-mac-x86_64` = project.in(file("dist/mac-x86_64")).asDist(Bootstrapped) | ||
.settings(packageName := (dist / packageName).value + "-x86_64-apple-darwin") | ||
.settings( | ||
republishBinDir := (dist / republishBinDir).value, | ||
packArchiveName := (dist / packArchiveName).value + "-x86_64-apple-darwin", | ||
republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides", | ||
republishFetchCoursier := (dist / republishFetchCoursier).value, | ||
republishLaunchers += | ||
("scala-cli" -> s"gz+https://github.com/VirtusLab/scala-cli/releases/download/v$scalaCliLauncherVersion/scala-cli-x86_64-apple-darwin.gz") | ||
) | ||
|
||
lazy val `dist-mac-aarch64` = project.in(file("dist/mac-aarch64")).asDist(Bootstrapped) | ||
.settings(packageName := (dist / packageName).value + "-aarch64-apple-darwin") | ||
.settings( | ||
republishBinDir := (dist / republishBinDir).value, | ||
packArchiveName := (dist / packArchiveName).value + "-aarch64-apple-darwin", | ||
republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides", | ||
republishFetchCoursier := (dist / republishFetchCoursier).value, | ||
republishLaunchers += | ||
("scala-cli" -> s"gz+https://github.com/VirtusLab/scala-cli/releases/download/v$scalaCliLauncherVersion/scala-cli-aarch64-apple-darwin.gz") | ||
) | ||
|
||
lazy val `dist-win-x86_64` = project.in(file("dist/win-x86_64")).asDist(Bootstrapped) | ||
.enablePlugins(WindowsPlugin) // TO GENERATE THE `.msi` installer | ||
.settings(packageName := (dist / packageName).value + "-x86_64-pc-win32") | ||
.settings( | ||
republishBinDir := (dist / republishBinDir).value, | ||
packArchiveName := (dist / packArchiveName).value + "-x86_64-pc-win32", | ||
republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides", | ||
republishFetchCoursier := (dist / republishFetchCoursier).value, | ||
republishExtraProps += ("cli_version" -> scalaCliLauncherVersion), | ||
mappings += (republishRepo.value / "etc" / "EXTRA_PROPERTIES" -> "EXTRA_PROPERTIES"), | ||
republishLaunchers += | ||
("scala-cli.exe" -> s"zip+https://github.com/VirtusLab/scala-cli/releases/download/v$scalaCliLauncherVersionWindows/scala-cli-x86_64-pc-win32.zip!/scala-cli.exe") | ||
) | ||
.settings( | ||
Universal / mappings += (republishRepo.value / "etc" / "EXTRA_PROPERTIES" -> "EXTRA_PROPERTIES"), | ||
) | ||
.settings( | ||
Windows / mappings := (Universal / mappings).value, | ||
maintainer := "Josh Suereth <[email protected]>", | ||
packageSummary := "test-windows", | ||
packageDescription := """Test Windows MSI.""", | ||
wixProductId := "ce07be71-510d-414a-92d4-dff47631848a", | ||
wixProductUpgradeId := "4552fb0e-e257-4dbd-9ecb-dba9dbacf424" | ||
) | ||
|
||
lazy val `dist-linux-x86_64` = project.in(file("dist/linux-x86_64")).asDist(Bootstrapped) | ||
.settings(packageName := (dist / packageName).value + "-x86_64-pc-linux") | ||
.settings( | ||
republishBinDir := (dist / republishBinDir).value, | ||
packArchiveName := (dist / packArchiveName).value + "-x86_64-pc-linux", | ||
republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides", | ||
republishFetchCoursier := (dist / republishFetchCoursier).value, | ||
republishLaunchers += | ||
("scala-cli" -> s"gz+https://github.com/VirtusLab/scala-cli/releases/download/v$scalaCliLauncherVersion/scala-cli-x86_64-pc-linux.gz") | ||
) | ||
|
||
lazy val `dist-linux-aarch64` = project.in(file("dist/linux-aarch64")).asDist(Bootstrapped) | ||
.settings(packageName := (dist / packageName).value + "-aarch64-pc-linux") | ||
.settings( | ||
republishBinDir := (dist / republishBinDir).value, | ||
packArchiveName := (dist / packArchiveName).value + "-aarch64-pc-linux", | ||
republishBinOverrides += (dist / baseDirectory).value / "bin-native-overrides", | ||
republishFetchCoursier := (dist / republishFetchCoursier).value, | ||
republishLaunchers += | ||
|
@@ -2323,7 +2340,7 @@ object Build { | |
settings(scala3PresentationCompilerBuildInfo) | ||
|
||
def asDist(implicit mode: Mode): Project = project. | ||
enablePlugins(PackPlugin, RepublishPlugin). | ||
enablePlugins(UniversalPlugin, RepublishPlugin). | ||
withCommonSettings. | ||
settings(commonDistSettings). | ||
dependsOn( | ||
|
@@ -2419,7 +2436,6 @@ object ScaladocConfigs { | |
} | ||
|
||
lazy val DefaultGenerationConfig = Def.task { | ||
def distLocation = (dist / Compile / pack).value | ||
DefaultGenerationSettings.value | ||
} | ||
|
||
|
This file contains 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
This file contains 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