Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Use slash syntax in scripted #1649

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,26 +77,26 @@ If you have enabled one of the archetypes (app or server),
you can build your application with

```bash
sbt <config-scope>:packageBin
sbt <config-scope>/packageBin
```

### Examples

```bash
# universal zip
sbt universal:packageBin
sbt Universal/packageBin

# debian package
sbt debian:packageBin
sbt Debian/packageBin

# rpm package
sbt rpm:packageBin
sbt Rpm/packageBin

# docker image
sbt docker:publishLocal
sbt Docker/publishLocal

# graalvm image
sbt graalvm-native-image:packageBin
sbt GraalVMNativeImage/packageBin
```

Read more in the specific [format documentation][formats] on how to configure and build your package.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -euo pipefail
IFS=$'\n\t'

sbt --warn update compile
sbt 'rpm:packageBin'
sbt 'Rpm/packageBin'
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class JDebConsole(log: Logger) extends org.vafer.jdeb.Console {
* ==JDeb Packaging Task==
*
* This private class contains all the jdeb-plugin specific implementations. It's only invoked when the jdeb plugin is
* enabled and the `debian:packageBin` task is called. This means that all classes in `org.vafer.jdeb._` are only
* enabled and the `Debian/packageBin` task is called. This means that all classes in `org.vafer.jdeb._` are only
* loaded when required and allows us to put the dependency in the "provided" scope. The provided scope means that we
* have less dependency issues in an sbt build.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/com/typesafe/sbt/packager/debian/Keys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ trait DebianKeys {
val debianCombinedMappings =
TaskKey[Seq[LinuxPackageMapping]]("debian-combined-mappings", "All the mappings of files for the final package.")

@deprecated("Use debian:stage instead", "1.2.0")
@deprecated("Use Debian/stage instead", "1.2.0")
val debianExplodedPackage = TaskKey[File]("debian-exploded-package", "makes an exploded debian package")
val lintian = TaskKey[Unit]("lintian", "runs the debian lintian tool on the current package.")
val debianSign = TaskKey[File]("debian-sign", "runs the dpkg-sig command to sign the generated deb file.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ object DockerSpotifyClientPlugin extends AutoPlugin {
* ==Docker Client Task==
*
* This private class contains all the docker-plugin specific implementations. It's only invoked when the docker plugin
* is enabled and the `docker:publishLocal` task is called. This means that all classes in
* is enabled and the `Docker/publishLocal` task is called. This means that all classes in
* `com.spotify.docker.client._` are only loaded when required and allows us to put the dependency in the "provided"
* scope. The provided scope means that we have less dependency issues in an sbt build.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import java.io.File
* Mapping of file to intermediate layers.
*
* @param layerId
* The identifier in the layer used to increase cache hits in docker caching. LayerId is present in docker:stage
* The identifier in the layer used to increase cache hits in docker caching. LayerId is present in Docker/stage
* directory structure and in intermediate image produced in the multi-stage docker build. None means the layering is
* skipped for this file.
* @param file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ trait ValidationKeys {

/**
* A task that implements various validations for a format. Example usage:
* - `sbt universal:packageBin::validatePackage`
* - `sbt debian:packageBin::validatePackage`
* - `sbt Universal/packageBin/validatePackage`
* - `sbt Debian/packageBin/validatePackage`
*
* Each format should implement it's own validate. Implemented in #1026
*/
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/daemon-group-gid-deb/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

$ exists target/debian-test-0.1.0/etc
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/daemon-user-deb/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

# Check defaults
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/daemon-user-homedir-deb/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

# Check defaults
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/daemon-user-shell-deb/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

# Check defaults
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/daemon-user-uid-deb/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

$ exists target/debian-test-0.1.0/etc
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/file-permissions/test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb
2 changes: 1 addition & 1 deletion src/sbt-test/debian/gen-changes/test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Run the debian packaging.
> debian:genChanges
> Debian/genChanges
$ exists target/debian-test_0.1.0_all.deb
$ exists target/debian-test_0.1.0_all.changes
2 changes: 1 addition & 1 deletion src/sbt-test/debian/java-app-archetype/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb
> stage
$ exists target/universal/stage/bin/debian-test
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/jdeb-conflicts/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
$ mkdir src/resources/empty
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb
> checkConflicts
2 changes: 1 addition & 1 deletion src/sbt-test/debian/jdeb-dependencies/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
$ mkdir src/resources/empty
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb
> checkDependencies
2 changes: 1 addition & 1 deletion src/sbt-test/debian/jdeb-dir-mappings/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
$ mkdir src/resources/empty
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb
> checkDirMappings
2 changes: 1 addition & 1 deletion src/sbt-test/debian/jdeb-provides/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
$ mkdir src/resources/empty
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb
> checkProvides
2 changes: 1 addition & 1 deletion src/sbt-test/debian/jdeb-script-replacements/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
$ mkdir src/resources/empty
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb
> checkControlFiles
2 changes: 1 addition & 1 deletion src/sbt-test/debian/log-directory/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

# Check defaults
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/native-build-compress/test
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
> debian:packageBin
> Debian/packageBin
> checkDebCompression
2 changes: 1 addition & 1 deletion src/sbt-test/debian/native-build-default/test
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
> debian:packageBin
> Debian/packageBin
> checkDebCompression
2 changes: 1 addition & 1 deletion src/sbt-test/debian/override-control-files/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

$ exists target/debian-test-0.1.0/etc
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/override-etc-default/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

# Check files for defaults
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/override-loader-functions/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

# Check files for defaults
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/override-start-script-systemd/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

# Check files for defaults
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/override-start-script-systemv/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

# Check files for defaults
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/override-start-script-upstart/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

# Check files for defaults
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/simple-deb/test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb
2 changes: 1 addition & 1 deletion src/sbt-test/debian/simple-jdeb/test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb
8 changes: 4 additions & 4 deletions src/sbt-test/debian/systemd-deb/test
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

$ exists target/debian-test-0.1.0/lib/systemd/system/debian-test.service
> show debian:serverLoader
> show debian:linuxStartScriptTemplate
> show Debian/serverLoader
> show Debian/linuxStartScriptTemplate
> plugins

> checkStartupScript
Expand All @@ -15,5 +15,5 @@ $ exists target/debian-test-0.1.0/lib/systemd/system/debian-test.service
# Test that serviceAutostart can be disabled

> set every NativePackagerKeys.serviceAutostart := false
> debian:packageBin
> Debian/packageBin
> checkNoAutostart
4 changes: 2 additions & 2 deletions src/sbt-test/debian/sysvinit-deb/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

$ exists target/debian-test-0.1.0/etc
Expand All @@ -13,5 +13,5 @@ $ exists target/debian-test-0.1.0/etc/init.d/debian-test
# Test that serviceAutostart can be disabled

> set every NativePackagerKeys.serviceAutostart := false
> debian:packageBin
> Debian/packageBin
> checkNoAutostart
2 changes: 1 addition & 1 deletion src/sbt-test/debian/sysvinit-stoptimeouts-deb/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

$ exists target/debian-test-0.1.0/etc
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/test-executableScriptName/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb
# Testing the packageName configuration
$ exists target/debian-test-0.1.0/DEBIAN
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/test-mapping-helpers/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

# Template directories
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/test-mapping/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test-override_0.1.0_all.deb
# Testing the packageName configuration
$ exists target/debian-test-override-0.1.0/DEBIAN
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/test-packageName/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test-override_0.1.0_all.deb
# Testing the packageName configuration
$ exists target/debian-test-override-0.1.0/DEBIAN
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/debian/upstart-deb-facilities/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb
$ exists target/debian-test-0.1.0/etc/init/debian-test.conf

Expand Down
4 changes: 2 additions & 2 deletions src/sbt-test/debian/upstart-deb/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run the debian packaging.
> debian:packageBin
> Debian/packageBin
$ exists target/debian-test_0.1.0_all.deb

$ exists target/debian-test-0.1.0/etc
Expand All @@ -20,5 +20,5 @@ $ exists target/debian-test-0.1.0/DEBIAN/postinst
# Test that serviceAutostart can be disabled

> set every NativePackagerKeys.serviceAutostart := false
> debian:packageBin
> Debian/packageBin
> checkNoAutostart
2 changes: 1 addition & 1 deletion src/sbt-test/docker/alias/test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Stage the distribution and ensure files show up.
> docker:publishLocal
> Docker/publishLocal
$ exec bash -c 'docker run docker-alias-test:0.1.0 | grep -q "Hello world"'
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# First make sure we start clean
$ exec bash -c 'docker image prune -f --filter label=snp-multi-stage=intermediate'
# Generate the Docker image locally
> docker:publishLocal
> Docker/publishLocal
# By default intermediate images will be removed
-$ exec bash -c 'docker images --filter label=snp-multi-stage=intermediate | grep -q "<none>"'
# Now lets change the default so we keep those images
> set dockerAutoremoveMultiStageIntermediateImages := false
> docker:publishLocal
> Docker/publishLocal
$ exec bash -c 'docker images --filter label=snp-multi-stage=intermediate | grep -q "<none>"'
# Alright, now let's remove them by hand
$ exec bash -c 'docker image prune -f --filter label=snp-multi-stage=intermediate'
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/docker/build-command/test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Stage the distribution and ensure files show up.
> docker:publishLocal
> Docker/publishLocal
$ exec bash -c 'docker run docker-build-command-test:0.1.0 | grep -q "docker build command override test"'
2 changes: 1 addition & 1 deletion src/sbt-test/docker/build-options/test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Stage the distribution and ensure files show up.
> docker:publishLocal
> Docker/publishLocal
$ exec bash -c 'docker run docker-build-options-test:0.1.0 | grep -q "Hello world"'
$ exec bash -c 'docker run docker-build-options-test:0.1.0-random-tag | grep -q "Hello world"'
2 changes: 1 addition & 1 deletion src/sbt-test/docker/entrypoint/test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Stage the distribution and ensure files show up.
> docker:stage
> Docker/stage
$ exec grep -q -F 'ENTRYPOINT ["/bin/sh", "-c", "env"]' target/docker/stage/Dockerfile
2 changes: 1 addition & 1 deletion src/sbt-test/docker/envVars/test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Stage the distribution and ensure files show up.
> docker:stage
> Docker/stage
> checkDockerfile
Loading