Merge "Enable Java language level 9 by default."
This commit is contained in:
@@ -386,13 +386,14 @@ func NewConfig(srcDir, buildDir string) (Config, error) {
|
||||
|
||||
func (c *config) fromEnv() error {
|
||||
switch c.Getenv("EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9") {
|
||||
case "":
|
||||
// Nothing, this is the default
|
||||
case "true":
|
||||
// Use -source 9 -target 9
|
||||
case "", "true":
|
||||
// Use -source 9 -target 9. This is the default.
|
||||
c.targetOpenJDK9 = true
|
||||
case "false":
|
||||
// Use -source 8 -target 8. This is the legacy behaviour.
|
||||
c.targetOpenJDK9 = false
|
||||
default:
|
||||
return fmt.Errorf(`Invalid value for EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9, should be "" or "true"`)
|
||||
return fmt.Errorf(`Invalid value for EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9, should be "", "true", or "false"`)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user