Skip to content

Commit

Permalink
Set --release javac option to 8 (#1458)
Browse files Browse the repository at this point in the history
* Set --release javac option to 8

* replace usage of var
  • Loading branch information
hugo-vrijswijk authored Nov 16, 2023
1 parent d6ed31c commit 73533c8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions modules/api/src/main/java/stryker4s/log/Logger.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
package stryker4s.log;

import java.util.function.Supplier;
import java.util.Map;

public interface Logger {

public void log(Level level, Supplier<String> msg);

public void log(Level level, Supplier<String> msg, Throwable t);

/**
/**
* Whether colors are enabled in the log
*/
*/
public default boolean colorEnabled() {
var env = System.getenv();
// Explicitly disable color https://no-color.org/
boolean notNoColor = !env.containsKey("NO_COLOR");
// If there is a TERM on Linux (or Windows Git Bash), assume we support color
boolean unixEnabled = env.containsKey("TERM");
// On Windows there's no easy way. But if we're in Windows Terminal or ConEmu, we can assume we support color
boolean windowsEnabled = env.containsKey("WT_SESSION") || (System.getenv().containsKey("ConEmuANSI") && System.getenv("ConEmuANSI").equals("ON"));
Map<String, String> env = System.getenv();
// Explicitly disable color https://no-color.org/
boolean notNoColor = !env.containsKey("NO_COLOR");
// If there is a TERM on Linux (or Windows Git Bash), assume we support color
boolean unixEnabled = env.containsKey("TERM");
// On Windows there's no easy way. But if we're in Windows Terminal or ConEmu,
// we can assume we support color
boolean windowsEnabled = env.containsKey("WT_SESSION")
|| (System.getenv().containsKey("ConEmuANSI") && System.getenv("ConEmuANSI").equals("ON"));

return notNoColor && (unixEnabled || windowsEnabled);
return notNoColor && (unixEnabled || windowsEnabled);
}
}
2 changes: 1 addition & 1 deletion project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ object Settings {
name := "stryker4s-api",
crossPaths := false, // drop off Scala suffix from artifact names.
autoScalaLibrary := false, // exclude scala-library from dependencies
javacOptions ++= Seq("--release", "11")
javacOptions ++= Seq("--release", "8")
)

lazy val testkitSettings: Seq[Setting[?]] = Seq(
Expand Down

0 comments on commit 73533c8

Please sign in to comment.