Skip to content

Commit 6f443d2

Browse files
committed
Rename IConsumer & add missing global toolchains on context
configuration.
1 parent 5249bdb commit 6f443d2

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

org.eclipse.m2e.core.tests/src/org/eclipse/m2e/core/IBiConsumer.java renamed to org.eclipse.m2e.core.tests/src/org/eclipse/m2e/core/CoreBiConsumer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @author Georg Tsakumagos
3232
*/
3333
@FunctionalInterface
34-
public interface IBiConsumer<T, U> {
34+
public interface CoreBiConsumer<T, U> {
3535

3636
/**
3737
* Performs this operation on the given arguments.

org.eclipse.m2e.core.tests/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegateTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import org.eclipse.jdt.launching.IVMInstallType;
3838
import org.eclipse.jdt.launching.JavaRuntime;
3939
import org.eclipse.m2e.actions.MavenLaunchConstants;
40-
import org.eclipse.m2e.core.IBiConsumer;
40+
import org.eclipse.m2e.core.CoreBiConsumer;
4141
import org.eclipse.m2e.core.MavenPlugin;
4242
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
4343
import org.eclipse.m2e.tests.common.AbstractMavenProjectTestCase;
@@ -229,7 +229,7 @@ public void testUserToolchains_Invalid() throws Exception {
229229
* @param relativePath Relative path for the file. Must not be <code>null</code>.
230230
* @throws Exception Usually only on missed assertions.
231231
*/
232-
private void assertMavenLaunchConfig(IBiConsumer<IMavenConfiguration, String> configSetter, String goal, IBiConsumer<MavenLaunchDelegate, ILaunchConfigurationWorkingCopy> verifier, String relativePath)
232+
private void assertMavenLaunchConfig(CoreBiConsumer<IMavenConfiguration, String> configSetter, String goal, CoreBiConsumer<MavenLaunchDelegate, ILaunchConfigurationWorkingCopy> verifier, String relativePath)
233233
throws Exception {
234234

235235
waitForJobsToComplete();
@@ -273,7 +273,7 @@ private void assertMavenLaunchConfig(IBiConsumer<IMavenConfiguration, String> co
273273
* @param relativePath Relative path for the file. Must not be <code>null</code>.
274274
* @throws Exception Usually only on missed assertions.
275275
*/
276-
private void assertMavenLaunchFileSetting(IBiConsumer<IMavenConfiguration, String> configSetter, String key, String relativePath)
276+
private void assertMavenLaunchFileSetting(CoreBiConsumer<IMavenConfiguration, String> configSetter, String key, String relativePath)
277277
throws Exception {
278278
this.assertMavenLaunchConfig(configSetter, null, (launcher, config) -> {
279279
String programArguments = launcher.getProgramArguments(config);
@@ -296,7 +296,7 @@ private void assertMavenLaunchFileSetting(IBiConsumer<IMavenConfiguration, Strin
296296
* @param relativePath Relative path for the file. Must not be <code>null</code>.
297297
* @throws Exception Usually only on missed assertions.
298298
*/
299-
private void assertMavenLaunchFileSettingGoalOverride(IBiConsumer<IMavenConfiguration, String> configSetter, String key, String relativePath)
299+
private void assertMavenLaunchFileSettingGoalOverride(CoreBiConsumer<IMavenConfiguration, String> configSetter, String key, String relativePath)
300300
throws Exception {
301301
final String userDerivedPath = "./resources/settings/empty_settings/this_do_not_exists.xml";
302302
final String goalConfig = "clean " + key + " " + userDerivedPath;
@@ -323,7 +323,7 @@ private void assertMavenLaunchFileSettingGoalOverride(IBiConsumer<IMavenConfigur
323323
* @param key Key of the configuration. Must not be <code>null</code>.
324324
* @throws Exception Usually only on missed assertions.
325325
*/
326-
private void assertMavenLaunchFileSettingPathInvalid(IBiConsumer<IMavenConfiguration, String> configSetter) throws Exception {
326+
private void assertMavenLaunchFileSettingPathInvalid(CoreBiConsumer<IMavenConfiguration, String> configSetter) throws Exception {
327327
final String path = "./resources/settings/empty_settings/this_do_not_exists.xml";
328328
try {
329329
this.assertMavenLaunchConfig(configSetter, null, (launcher, config) -> {}, path);

org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ISupplier.java renamed to org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/CoreSupplier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* @author Georg Tsakumagos
2929
*/
3030
@FunctionalInterface
31-
public interface ISupplier<T> {
31+
public interface CoreSupplier<T> {
3232

3333
/**
3434
* Gets a result.

org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExecutionContext.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ static MavenExecutionRequest createExecutionRequest(IMavenConfiguration mavenCon
208208
updateSettingsFiles(request, settingsLocations);
209209
//and settings are actually derived from IMavenConfiguration
210210
File userToolchainsFile = MavenCli.DEFAULT_USER_TOOLCHAINS_FILE;
211+
if(mavenConfiguration.getGlobalToolchainsFile() != null) {
212+
request.setGlobalToolchainsFile(new File(mavenConfiguration.getGlobalToolchainsFile()));
213+
}
211214
if(mavenConfiguration.getUserToolchainsFile() != null) {
212215
userToolchainsFile = new File(mavenConfiguration.getUserToolchainsFile());
213216
}

org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
import org.eclipse.m2e.actions.MavenLaunchConstants;
6565
import org.eclipse.m2e.core.MavenPlugin;
6666
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
67-
import org.eclipse.m2e.core.embedder.ISupplier;
67+
import org.eclipse.m2e.core.embedder.CoreSupplier;
6868
import org.eclipse.m2e.core.internal.IMavenConstants;
6969
import org.eclipse.m2e.core.internal.launch.AbstractMavenRuntime;
7070
import org.eclipse.m2e.core.project.IMavenProjectFacade;
@@ -127,7 +127,7 @@ public MavenLaunchDelegate() {
127127
* @throws IllegalArgumentException If the configured file does not exists.
128128
*/
129129
private void appendFileSetting(String name, String arg, StringBuilder sb, String goals, boolean substitute,
130-
ISupplier<String> source) throws CoreException, IllegalArgumentException {
130+
CoreSupplier<String> source) throws CoreException, IllegalArgumentException {
131131
if(!goals.contains(arg) && 0 >= sb.indexOf(arg)) {
132132
String setting = source.get();
133133

org.eclipse.m2e.model.edit/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-Name: M2E Maven Project Model Edit
33
Bundle-RequiredExecutionEnvironment: JavaSE-17
44
Bundle-Vendor: Eclipse.org - m2e
5-
Bundle-Version: 2.0.400.qualifier
5+
Bundle-Version: 2.0.401.qualifier
66
Bundle-ManifestVersion: 2
77
Bundle-SymbolicName: org.eclipse.m2e.model.edit;singleton:=true
88
Require-Bundle: org.eclipse.core.runtime,

0 commit comments

Comments
 (0)