From 90277ec0bf7db6a6833f104118fbfbb4e4f23876 Mon Sep 17 00:00:00 2001 From: Mickael Istria Date: Mon, 19 Jul 2021 16:38:13 +0200 Subject: [PATCH] Issue #183 - avoid parallel execution of compiler Compiler cannot use parallel execution until related bugs is fixed in the version used and provided by default in Tycho. --- .../eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java b/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java index cfb349208c..dce6967b55 100644 --- a/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java +++ b/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java @@ -106,6 +106,8 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo */ public static final String RULE_EXCLUDE_ALL = "?**/*"; + private static final Object LOCK = new Object(); + private static final Set MATCH_ALL = Collections.singleton("**/*"); private static final String PREFS_FILE_PATH = ".settings" + File.separator + "org.eclipse.jdt.core.prefs"; @@ -330,7 +332,11 @@ public final void execute() throws MojoExecutionException, MojoFailureException checkTargetLevelCompatibleWithManifestBREEs(effectiveTargetLevel, manifestBREEs); - doCompile(); + synchronized (LOCK) { + // sync to workaround https://bugs.eclipse.org/bugs/show_bug.cgi?id=574450 + // TODO remove it when default ECJ has fix + doCompile(); + } doFinish(); }