Skip to content

Commit b7143d2

Browse files
committed
Issue eclipse-tycho#707 - fix logic detecting custom vs none EE profile
Fix some methods and conditions to better distinguish cases of ee=none vs custom EE. This allows further invocations of TargetPlatformFactoryImpl.createTargetPlatform to work with ee=none.
1 parent 6ce35b5 commit b7143d2

File tree

5 files changed

+78
-3
lines changed

5 files changed

+78
-3
lines changed

tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentConfigurationImpl.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ private String computeEffectiveProfileName() {
102102

103103
@Override
104104
public boolean isCustomProfile() {
105+
if (ignoreExecutionEnvironment()) {
106+
return false;
107+
}
105108
String profileName = getProfileName();
106109
boolean profileExists = ExecutionEnvironmentUtils.getProfileNames().contains(profileName);
107110
if (!profileExists && ignoredByResolver) {
@@ -127,16 +130,16 @@ public void setFullSpecificationForCustomProfile(List<SystemCapability> systemCa
127130

128131
@Override
129132
public ExecutionEnvironment getFullSpecification() throws IllegalStateException {
133+
if (ignoreExecutionEnvironment()) {
134+
return NoExecutionEnvironment.INSTANCE;
135+
}
130136
if (isCustomProfile()) {
131137
if (customExecutionEnvironment == null) {
132138
throw new IllegalStateException(
133139
"Full specification of custom profile '" + getProfileName() + "' is not (yet) determined");
134140
}
135141
return customExecutionEnvironment;
136142
}
137-
if (ignoreExecutionEnvironment()) {
138-
return NoExecutionEnvironment.INSTANCE;
139-
}
140143
return ExecutionEnvironmentUtils.getExecutionEnvironment(getProfileName(), toolchainManager, session, logger);
141144
}
142145

Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bin.includes = feature.xml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<feature
3+
id="feature"
4+
version="1.0.0.qualifier">
5+
6+
</feature>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>tycho-its-project.eeProfile.none</groupId>
7+
<artifactId>feature</artifactId>
8+
<packaging>eclipse-feature</packaging>
9+
<version>1.0.0-SNAPSHOT</version>
10+
11+
<build>
12+
<plugins>
13+
<plugin>
14+
<groupId>org.eclipse.tycho</groupId>
15+
<artifactId>tycho-maven-plugin</artifactId>
16+
<version>${tycho-version}</version>
17+
<extensions>true</extensions>
18+
</plugin>
19+
<plugin>
20+
<groupId>org.eclipse.tycho</groupId>
21+
<artifactId>target-platform-configuration</artifactId>
22+
<version>${tycho-version}</version>
23+
<configuration>
24+
<executionEnvironment>none</executionEnvironment>
25+
</configuration>
26+
</plugin>
27+
<plugin>
28+
<groupId>org.eclipse.tycho.extras</groupId>
29+
<artifactId>tycho-p2-extras-plugin</artifactId>
30+
<version>${tycho-version}</version>
31+
<executions>
32+
<execution>
33+
<goals><goal>compare-version-with-baselines</goal></goals>
34+
</execution>
35+
</executions>
36+
</plugin>
37+
</plugins>
38+
</build>
39+
40+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2022 Red Hat, Inc. and others.
3+
* This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License 2.0
5+
* which accompanies this distribution, and is available at
6+
* https://www.eclipse.org/legal/epl-2.0/
7+
*
8+
* SPDX-License-Identifier: EPL-2.0
9+
*******************************************************************************/
10+
11+
package org.eclipse.tycho.test.compare;
12+
13+
import org.apache.maven.it.Verifier;
14+
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
15+
import org.junit.Test;
16+
17+
public class CompareWithBaselineTest extends AbstractTychoIntegrationTest {
18+
19+
@Test
20+
public void testEENone() throws Exception {
21+
Verifier verifier = getVerifier("eeProfile.none/feature", false);
22+
verifier.executeGoal("verify");
23+
verifier.verifyErrorFreeLog();
24+
}
25+
}

0 commit comments

Comments
 (0)