Skip to content

Commit

Permalink
Remove the reconciler product
Browse files Browse the repository at this point in the history
  • Loading branch information
laeubi committed Feb 11, 2024
1 parent a4337e3 commit 9e742a9
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 50 deletions.
11 changes: 0 additions & 11 deletions bundles/org.eclipse.equinox.p2.tests.reconciler.product/.project

This file was deleted.

This file was deleted.

This file was deleted.

68 changes: 45 additions & 23 deletions bundles/org.eclipse.equinox.p2.tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,59 @@
<testClass>org.eclipse.equinox.p2.tests.AutomatedTests</testClass>
<defaultSigning-excludeInnerJars>true</defaultSigning-excludeInnerJars>
<archiveExtension>tar.gz</archiveExtension>
<dropinsProduct>org.eclipse.equinox.p2.reconciler-${tycho.env.osgi.os}.${tycho.env.osgi.ws}.${tycho.env.osgi.arch}.${archiveExtension}</dropinsProduct>
<dropinsProduct>${project.build.directory}/products/org.eclipse.equinox.p2.reconciler/${tycho.env.osgi.os}/${tycho.env.osgi.ws}/${tycho.env.osgi.arch}</dropinsProduct>
</properties>
<profiles>
<profile>
<id>windows</id>
<activation>
<os><family>win</family></os>
</activation>
<properties>
<archiveExtension>zip</archiveExtension>
</properties>
</profile>
</profiles>

<dependencies>
<!-- The tests require the reconciler product -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>org.eclipse.equinox.p2.reconciler</artifactId>
<version>1.1.0-SNAPSHOT</version>
<type>pom</type>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<environments combine.self="override">
<!-- clear to enforce using the default environment only -->
</environments>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-publisher-plugin</artifactId>
<version>${tycho.version}</version>
<executions>
<execution>
<id>publish-products</id>
<goals>
<goal>publish-products</goal>
</goals>
<phase>pre-integration-test</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<executions>
<execution>
<id>materialize-products</id>
<goals>
<goal>materialize-products</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<products>
<product>
<id>org.eclipse.equinox.p2.reconciler</id>
</product>
</products>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx512m -Dorg.eclipse.equinox.p2.reconciler.tests.platform.archive=${project.build.directory}/../../org.eclipse.equinox.p2.tests.reconciler.product/target/products/${dropinsProduct} -Dorg.eclipse.equinox.p2.reconciler.tests.35.platform.archive=${platform.archive.name} -Dorg.eclipse.equinox.p2.repository -Dorg.eclipse.equinox.p2.transport.ecf.retry=5</argLine>
<argLine>-Xmx512m -Dorg.eclipse.equinox.p2.reconciler.tests.platform.archive=${dropinsProduct} -Dorg.eclipse.equinox.p2.reconciler.tests.35.platform.archive=${platform.archive.name} -Dorg.eclipse.equinox.p2.repository -Dorg.eclipse.equinox.p2.transport.ecf.retry=5</argLine>
<appArgLine>-consoleLog -debug</appArgLine>
<explodedBundles>
<explodedBundle>org.apache.ant</explodedBundle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@

<plugins>
<plugin id="org.eclipse.equinox.p2.installer"/>
<plugin id="org.eclipse.swt.cocoa.macosx.x86_64" fragment="true"/>
<plugin id="org.eclipse.swt.gtk.linux.x86_64" fragment="true"/>
<plugin id="org.eclipse.swt.win32.win32.x86_64" fragment="true"/>
</plugins>

<features>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
Expand Down Expand Up @@ -102,26 +107,43 @@ public AbstractReconcilerTest(String name, String propertyToPlatformArchive) {
*/
public void initialize() throws Exception {
initialized = false;
File file = getPlatformZip();
File platform = getPlatformZip();
output = getUniqueFolder();
toRemove.add(output);
// for now we will exec to un-tar archives to keep the executable bits
if (file.getName().toLowerCase().endsWith(".zip")) {
if (platform.isDirectory()) {
final Path targetPath = output.toPath();
final Path sourcePath = platform.toPath();
Files.walkFileTree(sourcePath, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult preVisitDirectory(final Path dir, final BasicFileAttributes attrs)
throws IOException {
Files.createDirectories(targetPath.resolve(sourcePath.relativize(dir)));
return FileVisitResult.CONTINUE;
}

@Override
public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException {
Files.copy(file, targetPath.resolve(sourcePath.relativize(file)));
return FileVisitResult.CONTINUE;
}
});
} else if (platform.getName().toLowerCase().endsWith(".zip")) {
try {
FileUtils.unzipFile(file, output);
FileUtils.unzipFile(platform, output);
} catch (IOException e) {
fail("0.99", e);
}
} else if (file.getName().toLowerCase().endsWith(".dmg")) {
extractDmg("1.1", file);
} else if (platform.getName().toLowerCase().endsWith(".dmg")) {
extractDmg("1.1", platform);
} else {
untar("1.0", file);
untar("1.0", platform);
}
File exe = new File(output, getExeFolder() + "eclipse.exe");
if (!exe.exists()) {
exe = new File(output, getExeFolder() + "eclipse");
if (!exe.exists())
fail("Executable file: " + exe.getAbsolutePath() + "(or .exe) not found after extracting: " + file.getAbsolutePath() + " to: " + output);
fail("Executable file: " + exe.getAbsolutePath() + "(or .exe) not found after extracting: " + platform.getAbsolutePath() + " to: " + output);
if (!exe.canExecute()) {
// Try first to set --x--x--x, then --x------ if we can't do the former
if (!exe.setExecutable(true, false) || !exe.setExecutable(true, true)) {
Expand Down Expand Up @@ -279,6 +301,9 @@ private File getPlatformZip() {
} catch (IOException e) {
// then use the non canonical one...
}
if (file.isDirectory()) {
return file;
}
}
StringBuilder detailedMessage = new StringBuilder(600);
detailedMessage.append(" propertyToPlatformArchive was ").append(propertyToPlatformArchive == null ? " not set " : propertyToPlatformArchive).append('\n');
Expand Down

0 comments on commit 9e742a9

Please sign in to comment.