Skip to content

Commit 272e373

Browse files
committed
Running scalariform
1 parent 20d56d6 commit 272e373

9 files changed

Lines changed: 24 additions & 48 deletions

File tree

src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppBashScript.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ object JavaAppBashScript {
2626
mainClass: String,
2727
appClasspath: Seq[String] = Seq("*"),
2828
configFile: Option[String] = None,
29-
extras: Seq[String] = Nil
30-
): Seq[String] =
29+
extras: Seq[String] = Nil): Seq[String] =
3130
Seq(mainClassDefine(mainClass)) ++
3231
(configFile map configFileDefine).toSeq ++
3332
Seq(makeClasspathDefine(appClasspath)) ++

src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppBatScript.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ object JavaAppBatScript {
2828
name: String,
2929
mainClass: String,
3030
appClasspath: Seq[String] = Seq("*"),
31-
extras: Seq[String] = Nil
32-
): Seq[(String, String)] = {
31+
extras: Seq[String] = Nil): Seq[(String, String)] = {
3332
val replacements = Seq(
3433
"APP_NAME" -> name,
3534
"APP_ENV_NAME" -> makeEnvFriendlyName(name)
@@ -51,8 +50,7 @@ object JavaAppBatScript {
5150
}
5251

5352
def generateScript(
54-
replacements: Seq[(String, String)], template: java.net.URL = bashTemplateSource
55-
): String =
53+
replacements: Seq[(String, String)], template: java.net.URL = bashTemplateSource): String =
5654
TemplateWriter.generateScript(template, replacements, "\r\n", TemplateWriter.batFriendlyKeySurround)
5755

5856
}

src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerBashScript.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ object JavaServerBashScript {
4040
archetype: String,
4141
config: Configuration,
4242
replacements: Seq[(String, String)],
43-
template: Option[URL] = None
44-
): Option[String] = {
43+
template: Option[URL] = None): Option[String] = {
4544
// use template or else search for a default
4645
val url = template orElse {
4746
Option(getClass getResource s"$archetype/${config.name}/$script-template")

src/main/scala/com/typesafe/sbt/packager/archetypes/TemplateWriter.scala

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ object TemplateWriter {
3333
private def replace(
3434
line: String,
3535
replacements: Seq[(String, String)],
36-
keySurround: String => String
37-
): String = {
36+
keySurround: String => String): String = {
3837
replacements.foldLeft(line) {
3938
case (line, (key, value)) =>
4039
keySurround(key).r.replaceAllIn(line, java.util.regex.Matcher.quoteReplacement(value))
@@ -45,8 +44,7 @@ object TemplateWriter {
4544
lines: Seq[String],
4645
replacements: Seq[(String, String)],
4746
eol: String,
48-
keySurround: String => String
49-
): String = {
47+
keySurround: String => String): String = {
5048
val sb = new StringBuilder
5149
for (line <- lines) {
5250
sb append replace(line, replacements, keySurround)
@@ -60,8 +58,7 @@ object TemplateWriter {
6058
replacements: Seq[(String, String)],
6159
eol: String = "\n",
6260
keySurround: String => String = bashFriendlyKeySurround,
63-
charset: java.nio.charset.Charset = defaultCharset
64-
): String = {
61+
charset: java.nio.charset.Charset = defaultCharset): String = {
6562
val lines = sbt.IO.readLinesURL(source, charset)
6663
replaceValues(lines, replacements, eol, keySurround)
6764
}
@@ -71,8 +68,7 @@ object TemplateWriter {
7168
replacements: Seq[(String, String)],
7269
eol: String = "\n",
7370
keySurround: String => String = bashFriendlyKeySurround,
74-
charset: java.nio.charset.Charset = defaultCharset
75-
): String = {
71+
charset: java.nio.charset.Charset = defaultCharset): String = {
7672
replaceValues(source split eol, replacements, eol, keySurround)
7773
}
7874
}

src/main/scala/com/typesafe/sbt/packager/debian/DebianMetadata.scala

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ case class PackageInfo(
77
version: String,
88
maintainer: String,
99
summary: String,
10-
description: String
11-
)
10+
description: String)
1211

1312
/** Represents package meta used by debian when constructing packages. */
1413
case class PackageMetaData(
@@ -17,8 +16,7 @@ case class PackageMetaData(
1716
architecture: String = "all",
1817
section: String = "java",
1918
depends: Seq[String] = Seq.empty,
20-
recommends: Seq[String] = Seq.empty
21-
) {
19+
recommends: Seq[String] = Seq.empty) {
2220
def makeContent(installSizeEstimate: Long = 0L): String = {
2321
// TODO: Pretty print with line wrap.
2422
val sb = new StringBuilder
@@ -66,8 +64,7 @@ case class DebianControlScriptReplacements(
6664
author: String,
6765
descr: String,
6866
name: String,
69-
version: String
70-
) {
67+
version: String) {
7168

7269
/**
7370
* Generates the replacement sequence for the debian

src/main/scala/com/typesafe/sbt/packager/linux/LinuxPackageMapping.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ case class LinuxFileMetaData(
1010
group: String = Users.Root,
1111
permissions: String = "755",
1212
config: String = "false",
13-
docs: Boolean = false
14-
) {
13+
docs: Boolean = false) {
1514

1615
def withUser(u: String) = copy(user = u)
1716
def withGroup(g: String) = copy(group = g)
@@ -23,8 +22,7 @@ case class LinuxFileMetaData(
2322
case class LinuxPackageMapping(
2423
mappings: Traversable[(File, String)],
2524
fileData: LinuxFileMetaData = LinuxFileMetaData(),
26-
zipped: Boolean = false
27-
) {
25+
zipped: Boolean = false) {
2826

2927
def withUser(user: String) = copy(fileData = fileData withUser user)
3028
def withGroup(group: String) = copy(fileData = fileData withGroup group)

src/main/scala/com/typesafe/sbt/packager/rpm/RpmHelper.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ object RpmHelper {
6666
private[this] def buildPackage(
6767
workArea: File,
6868
spec: RpmSpec,
69-
log: sbt.Logger
70-
): Unit = {
69+
log: sbt.Logger): Unit = {
7170
val buildRoot = workArea / "buildroot"
7271
val specsDir = workArea / "SPECS"
7372
val gpg = false

src/main/scala/com/typesafe/sbt/packager/rpm/RpmMetadata.scala

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ case class RpmMetadata(
1818
summary: String,
1919
description: String,
2020
autoprov: String,
21-
autoreq: String
22-
) {
21+
autoreq: String) {
2322
}
2423

2524
/**
@@ -32,16 +31,14 @@ case class RpmDescription(
3231
group: Option[String] = None,
3332
packager: Option[String] = None,
3433
icon: Option[String] = None,
35-
changelogFile: Option[String] = None
36-
)
34+
changelogFile: Option[String] = None)
3735

3836
case class RpmDependencies(
3937
provides: Seq[String] = Seq.empty,
4038
requirements: Seq[String] = Seq.empty,
4139
prereq: Seq[String] = Seq.empty,
4240
obsoletes: Seq[String] = Seq.empty,
43-
conflicts: Seq[String] = Seq.empty
44-
) {
41+
conflicts: Seq[String] = Seq.empty) {
4542
def contents: String = {
4643
val sb = new StringBuilder
4744
def appendSetting(prefix: String, values: Seq[String]) =
@@ -62,8 +59,7 @@ case class RpmScripts(
6259
verifyscript: Option[String] = None,
6360
posttrans: Option[String] = None,
6461
preun: Option[String] = None,
65-
postun: Option[String] = None
66-
) {
62+
postun: Option[String] = None) {
6763
def contents(): String = {
6864
val labelledScripts = Seq("%pretrans", "%pre", "%post", "%verifyscript", "%posttrans", "%preun", "%postun")
6965
.zip(Seq(pretrans, pre, post, verifyscript, posttrans, preun, postun))
@@ -78,8 +74,7 @@ case class RpmSpec(
7874
deps: RpmDependencies = RpmDependencies(),
7975
scriptlets: RpmScripts = RpmScripts(),
8076
mappings: Seq[LinuxPackageMapping] = Seq.empty,
81-
symlinks: Seq[LinuxSymlink] = Seq.empty
82-
) {
77+
symlinks: Seq[LinuxSymlink] = Seq.empty) {
8378

8479
// TODO - here we want to validate that all the data we have is ok to place
8580
// in the RPM. e.g. the Description/vendor etc. must meet specific requirements.

src/main/scala/com/typesafe/sbt/packager/windows/WixHelper.scala

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ case class WindowsProductInfo(
1717
comments: String = "",
1818
installScope: String = "perMachine",
1919
installerVersion: String = "200",
20-
compressed: Boolean = true
21-
)
20+
compressed: Boolean = true)
2221

2322
sealed trait FeatureComponent
2423
/** Define a new feature, that will be selectable in the default MSI. */
@@ -29,22 +28,19 @@ case class WindowsFeature(
2928
absent: String = "allow",
3029
level: String = "1",
3130
display: String = "collapse",
32-
components: Seq[FeatureComponent] = Seq.empty
33-
) extends FeatureComponent {}
31+
components: Seq[FeatureComponent] = Seq.empty) extends FeatureComponent {}
3432
/** Adds a file into a given windows feature. */
3533
case class ComponentFile(
3634
source: String,
37-
editable: Boolean = false
38-
) extends FeatureComponent
35+
editable: Boolean = false) extends FeatureComponent
3936
/**
4037
* Will add the directory to the windows path. NOTE: Only one of these
4138
* per MSI.
4239
*/
4340
case class AddDirectoryToPath(dir: String = "") extends FeatureComponent
4441
case class AddShortCuts(
4542
target: Seq[String],
46-
workingDir: String = "INSTALLDIR"
47-
) extends FeatureComponent
43+
workingDir: String = "INSTALLDIR") extends FeatureComponent
4844

4945
// TODO - Shortcut as a component element.
5046

@@ -208,8 +204,7 @@ object WixHelper {
208204
def makeWixConfig(
209205
name: String, // package name
210206
product: WindowsProductInfo,
211-
rest: xml.Node
212-
): xml.Node = {
207+
rest: xml.Node): xml.Node = {
213208
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'>
214209
<Product Id={ product.id } Name={ product.title } Language='1033' Version={ product.version } Manufacturer={ product.maintainer } UpgradeCode={ product.upgradeId }>
215210
<Package Description={ product.description } Comments={ product.comments } Manufacturer={ product.maintainer } InstallScope={ product.installScope } InstallerVersion={ product.installerVersion } Compressed={ if (product.compressed) "yes" else "no" }/>

0 commit comments

Comments
 (0)