Skip to content

Commit 643a2bf

Browse files
authored
Revert "fix duplicate application.ini mappings when both BASH and BAT are used (#1056)"
This reverts commit 6c9351c.
1 parent 6c9351c commit 643a2bf

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/ApplicationIniGenerator.scala

+10-18
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,17 @@ trait ApplicationIniGenerator {
2121
val pathMapping = cleanApplicationIniPath(location)
2222
//Do not use writeLines here because of issue #637
2323
IO.write(configFile, ("# options from build" +: javaOptions).mkString("\n"))
24-
val filteredMappings = universalMappings.filter {
25-
case (`configFile`, `pathMapping`) =>
26-
// ignore duplicate application.ini mappings with identical contents
27-
// for example when using both the BASH and BAT plugin
28-
false
29-
30-
case (_, `pathMapping`) =>
31-
// specified a custom application.ini file *and* JVM options
32-
// TODO: merge JVM options into the existing application.ini?
33-
log.warn("--------!!! JVM Options are defined twice !!!-----------")
34-
log.warn(
35-
"application.ini is already present in output package. Will be overridden by 'javaOptions in Universal'"
36-
)
37-
false
38-
39-
case _ =>
40-
true
24+
val hasConflict = universalMappings.exists {
25+
case (file, path) => file != configFile && path == pathMapping
26+
}
27+
// Warn the user if he tries to specify options
28+
if (hasConflict) {
29+
log.warn("--------!!! JVM Options are defined twice !!!-----------")
30+
log.warn(
31+
"application.ini is already present in output package. Will be overridden by 'javaOptions in Universal'"
32+
)
4133
}
42-
(configFile -> pathMapping) +: filteredMappings
34+
(configFile -> pathMapping) +: universalMappings
4335

4436
}
4537
.getOrElse(universalMappings)

0 commit comments

Comments
 (0)