Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow parallel execution of compilation and package plugin #27

Merged
merged 2 commits into from Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -104,11 +104,6 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo
*/
public static final String RULE_EXCLUDE_ALL = "?**/*";

/**
* Lock object to ensure thread-safety
*/
private static final Object LOCK = new Object();

private static final Set<String> MATCH_ALL = Collections.singleton("**/*");

private static final String PREFS_FILE_PATH = ".settings" + File.separator + "org.eclipse.jdt.core.prefs";
Expand Down Expand Up @@ -333,9 +328,7 @@ public final void execute() throws MojoExecutionException, MojoFailureException

checkTargetLevelCompatibleWithManifestBREEs(effectiveTargetLevel, manifestBREEs);

synchronized (LOCK) {
doCompile();
}
doCompile();
doFinish();
}

Expand Down
Expand Up @@ -55,7 +55,6 @@
*/
@Mojo(name = "package-plugin", threadSafe = true)
public class PackagePluginMojo extends AbstractTychoPackagingMojo {
private static final Object LOCK = new Object();

/**
* The output directory of the jar file
Expand Down Expand Up @@ -158,20 +157,16 @@ public class PackagePluginMojo extends AbstractTychoPackagingMojo {

@Override
public void execute() throws MojoExecutionException {
synchronized (LOCK) {
ReactorProject reactorProject = DefaultReactorProject.adapt(project);
pdeProject = (EclipsePluginProject) reactorProject
.getContextValue(TychoConstants.CTX_ECLIPSE_PLUGIN_PROJECT);

createSubJars();
ReactorProject reactorProject = DefaultReactorProject.adapt(project);
pdeProject = (EclipsePluginProject) reactorProject.getContextValue(TychoConstants.CTX_ECLIPSE_PLUGIN_PROJECT);

File pluginFile = createPluginJar();
project.getArtifact().setFile(pluginFile);
File testPluginFile = createTestPluginJar(reactorProject);
if (testPluginFile != null) {
projectHelper.attachArtifact(project, "jar", ArtifactType.TYPE_ECLIPSE_TEST_FRAGMENT, testPluginFile);
}
createSubJars();

File pluginFile = createPluginJar();
project.getArtifact().setFile(pluginFile);
File testPluginFile = createTestPluginJar(reactorProject);
if (testPluginFile != null) {
projectHelper.attachArtifact(project, "jar", ArtifactType.TYPE_ECLIPSE_TEST_FRAGMENT, testPluginFile);
}
}

Expand Down