Skip to content

Commit bdf74c1

Browse files
[release/9.0.1xx] pass -Xlint:-options for javac -target/source 1.8
Fixes: #9925 Partial backport of: #10050 For backporting to .NET 9, we just need to suppress a warning that JDK 21 will show when using `javac -source 1.8 -target 1.8`.
1 parent 1d79963 commit bdf74c1

File tree

1 file changed

+4
-0
lines changed
  • src/Xamarin.Android.Build.Tasks/Tasks

1 file changed

+4
-0
lines changed

src/Xamarin.Android.Build.Tasks/Tasks/Javac.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ protected override string GenerateCommandLineCommands ()
7171
} else {
7272
cmd.AppendSwitchIfNotNull ("-target ", JavacTargetVersion);
7373
cmd.AppendSwitchIfNotNull ("-source ", JavacSourceVersion);
74+
// Ignore warning when targeting older Java versions
75+
// JAVAC : warning : [options] source value 8 is obsolete and will be removed in a future release
76+
// JAVAC : warning : [options] target value 8 is obsolete and will be removed in a future release
77+
cmd.AppendSwitchIfNotNull ("-Xlint:", "-options");
7478
}
7579

7680
return cmd.ToString ();

0 commit comments

Comments
 (0)