@@ -51,9 +51,12 @@ object Environment {
51
51
/**
52
52
* Reads all jvm options required to start the Bloop server, in order of priority:
53
53
*
54
+ * Parses `-J` prefixed jvm options in the arguments passed to the server command.
55
+ *
56
+ * Prior to 1.5.0 it used to also:
54
57
* 1. Read `$$HOME/.bloop/.jvmopts` file.
55
58
* 2. Read `.jvmopts` file right next to the location of the bloop server jar.
56
- * 3. Parse `-J` prefixed jvm options in the arguments passed to the server command .
59
+ * Now, it only logs a warning if the file detected .
57
60
*
58
61
* Returns a list of jvm options with no `-J` prefix.
59
62
*/
@@ -62,27 +65,19 @@ object Environment {
62
65
serverArgs : List [String ],
63
66
logger : Logger
64
67
): List [String ] = {
65
- def readJvmOptsFile (jvmOptsFile : Path ): List [String ] = {
66
- if (! Files .isReadable(jvmOptsFile)) {
67
- if (Files .exists(jvmOptsFile)) {
68
- logger.error(s " Ignored unreadable ${jvmOptsFile.toAbsolutePath()}" )
69
- }
70
-
71
- Nil
72
- } else {
73
- val contents = new String (Files .readAllBytes(jvmOptsFile), StandardCharsets .UTF_8 )
74
- contents.linesIterator.toList
68
+ def detectJvmOptsFile (jvmOptsFile : Path ): Unit = {
69
+ if (Files .exists(jvmOptsFile)) {
70
+ logger.warn(s " Since Bloop 1.5.0 ${jvmOptsFile.toAbsolutePath()} is ignored. " )
75
71
}
76
72
}
77
-
78
73
val jvmServerArgs = serverArgs.filter(_.startsWith(" -J" ))
79
- val jvmOptionsFromHome = readJvmOptsFile (Environment .defaultBloopDirectory.resolve(" .jvmopts" ))
80
- val jvmOptionsFromPathNextToBinary = server match {
81
- case AvailableAtPath (binary) => readJvmOptsFile (binary.getParent.resolve(" .jvmopts" ))
74
+ detectJvmOptsFile (Environment .defaultBloopDirectory.resolve(" .jvmopts" ))
75
+ server match {
76
+ case AvailableAtPath (binary) => detectJvmOptsFile (binary.getParent.resolve(" .jvmopts" ))
82
77
case _ => Nil
83
78
}
84
79
85
- (jvmOptionsFromHome ++ jvmOptionsFromPathNextToBinary ++ jvmServerArgs) .map(_.stripPrefix(" -J" ))
80
+ jvmServerArgs.map(_.stripPrefix(" -J" ))
86
81
}
87
82
88
83
// TODO: Add more options to better tweak GC based on benchmarks
0 commit comments