From f0537d565b73e5e32fdb28d08a1445e70b850939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Tue, 12 Dec 2023 05:08:49 +0100 Subject: [PATCH] Adjust to changes in plexus API --- .../org/eclipse/tycho/compiler/jdt/JDTCompiler.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java b/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java index 8376a62980..5ef9838584 100644 --- a/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java +++ b/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java @@ -44,6 +44,7 @@ import org.codehaus.plexus.compiler.CompilerResult; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.cli.CommandLineException; import org.codehaus.plexus.util.cli.CommandLineUtils; @@ -83,6 +84,9 @@ public class JDTCompiler extends AbstractCompiler { @Requirement private JdkLibraryInfoProvider jdkLibInfoProvider; + @Requirement + private Logger logger; + public JDTCompiler() { super(CompilerOutputStyle.ONE_OUTPUT_FILE_PER_INPUT_FILE, ".java", ".class", null); } @@ -107,7 +111,7 @@ public CompilerResult performCompile(CompilerConfiguration config) throws Compil return new CompilerResult(); } - getLogger().info("Compiling " + sourceFiles.length + " " + "source file" + (sourceFiles.length == 1 ? "" : "s") + logger.info("Compiling " + sourceFiles.length + " " + "source file" + (sourceFiles.length == 1 ? "" : "s") + " to " + destinationDir.getAbsolutePath() + " using " + COMPILER_NAME + ""); Collection> customCompilerArgumentEntries = config @@ -313,7 +317,7 @@ public String[] buildCompilerArguments(CompilerConfiguration config, CustomCompi args.add("--release"); args.add(config.getReleaseVersion()); } else { - getLogger().debug("Custom java home and --release are incompatible, ignore --release=" + logger.debug("Custom java home and --release are incompatible, ignore --release=" + config.getReleaseVersion() + " setting "); } } @@ -415,12 +419,12 @@ CompilerResult compileInProcess(String[] args, CompilerConfiguration config, Cus addToCompilerArgumentsIfNotSet("--system", custom.javaHome, jdtCompilerArgs); } } - getLogger().debug("JDT compiler args: " + jdtCompilerArgs); + logger.debug("JDT compiler args: " + jdtCompilerArgs); boolean success = compiler.compile(jdtCompilerArgs.toArray(new String[0])); try { String output = err.toString(); - getLogger().debug("Original compiler output: " + output); + logger.debug("Original compiler output: " + output); messages = parseModernStream(new BufferedReader(new StringReader(output))); } catch (IOException e) { throw new RuntimeException(e);