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

Issue #707 - fix logic detecting custom vs none EE profile #709

Merged
merged 1 commit into from
Mar 1, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import java.util.AbstractMap.SimpleEntry;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
Expand Down Expand Up @@ -45,8 +44,6 @@ public StandardEEResolutionHandler(ExecutionEnvironmentResolutionHints resolutio
@Override
public void readFullSpecification(Collection<IInstallableUnit> targetPlatformContent) {
if (environmentConfiguration.ignoreExecutionEnvironment()) {
//if it is ignored not setting the specification leads to strange errors in downstream mojos...
environmentConfiguration.setFullSpecificationForCustomProfile(Collections.emptyList());
//and we might want to inform the user about ignored items...
logger.info("The following Execution Environments are currently known but are ignored by configuration:");
Map<String, Collection<String>> map = targetPlatformContent.stream()//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ private String computeEffectiveProfileName() {

@Override
public boolean isCustomProfile() {
if (ignoreExecutionEnvironment()) {
return false;
}
String profileName = getProfileName();
boolean profileExists = ExecutionEnvironmentUtils.getProfileNames().contains(profileName);
if (!profileExists && ignoredByResolver) {
Expand All @@ -127,16 +130,16 @@ public void setFullSpecificationForCustomProfile(List<SystemCapability> systemCa

@Override
public ExecutionEnvironment getFullSpecification() throws IllegalStateException {
if (ignoreExecutionEnvironment()) {
return NoExecutionEnvironment.INSTANCE;
}
if (isCustomProfile()) {
if (customExecutionEnvironment == null) {
throw new IllegalStateException(
"Full specification of custom profile '" + getProfileName() + "' is not (yet) determined");
}
return customExecutionEnvironment;
}
if (ignoreExecutionEnvironment()) {
return NoExecutionEnvironment.INSTANCE;
}
return ExecutionEnvironmentUtils.getExecutionEnvironment(getProfileName(), toolchainManager, session, logger);
}

Expand Down
1 change: 1 addition & 0 deletions tycho-its/projects/eeProfile.none/feature/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin.includes = feature.xml
6 changes: 6 additions & 0 deletions tycho-its/projects/eeProfile.none/feature/feature.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="feature"
version="1.0.0.qualifier">

</feature>
40 changes: 40 additions & 0 deletions tycho-its/projects/eeProfile.none/feature/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>tycho-its-project.eeProfile.none</groupId>
<artifactId>feature</artifactId>
<packaging>eclipse-feature</packaging>
<version>1.0.0-SNAPSHOT</version>

<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<executionEnvironment>none</executionEnvironment>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-p2-extras-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<goals><goal>compare-version-with-baselines</goal></goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*******************************************************************************
* Copyright (c) 2022 Red Hat, Inc. and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/

package org.eclipse.tycho.test.compare;

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.junit.Test;

public class CompareWithBaselineTest extends AbstractTychoIntegrationTest {

@Test
public void testEENone() throws Exception {
Verifier verifier = getVerifier("eeProfile.none/feature", false);
verifier.executeGoal("verify");
verifier.verifyErrorFreeLog();
}
}