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

Make Docker plugin portable so that Windows is supported #765

Merged
merged 1 commit into from
Apr 24, 2016
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.typesafe.sbt
package packager
package docker

import java.io.File
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still? I don't understand what it wants. Maybe it doesn't support Java packages? Or should it be above the package declarations?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is an issue with the weird package notation used in native-packager. At some point I will fix this. For now ignore this warning. Thanks for paying attention :)

import sbt._
import sbt.Keys.{
name,
Expand Down Expand Up @@ -61,11 +62,11 @@ object DockerPlugin extends AutoPlugin {
* The separator for makeAdd force UNIX separator.
* The separator doesn't depend to OS where i build Dockerfile.
*/
val UnixSeparatorChar = '/'
val SeparatorChar = File.separatorChar

override def requires = universal.UniversalPlugin

override def projectConfigurations: Seq[Configuration] = Seq(Docker)
override def projectConfigurations: Seq[Configuration] = Seq(Docker)

override lazy val projectSettings = Seq(
dockerBaseImage := "java:latest",
Expand Down Expand Up @@ -157,7 +158,7 @@ object DockerPlugin extends AutoPlugin {
* @return ADD command adding all files inside the installation directory
*/
private final def makeAdd(dockerBaseDirectory: String): CmdLike = {
val files = dockerBaseDirectory.split(UnixSeparatorChar)(1)
val files = dockerBaseDirectory.split(SeparatorChar)(1)
Cmd("ADD", s"$files /$files")
}

Expand Down