-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tycho-p2-director:director: Fix handling of destination on macOS
* In DirectorMojo, the adjustment of 'destination' must consider the actual target environment (p2os/p2ws/p2arch parameters) that is to be installed and only fall back to the running environment if no explicit target environment is given. * Document in the tycho-p2-director:director JavaDoc / mojo parameter description that this intentionally deviates from the behavior of the stand-alone director application invocation: eclipse -application org.eclipse.equinox.p2.director -destination <destination> ... * In DirectorMojo, add a consistency check that p2os/p2ws/p2arch must all be specified mutually. * The helper methods in DirectorRuntime are extended, to properly handle all three possible scenarios: 1) /path/without/app/bundle/layout --> /path/without/app/bundle/layout/Eclipse.app/Contents/Eclipse 2) /path/to/real.app/Contents/Eclipse --> /path/to/real.app/Contents/Eclipse 3) /path/to/real.app --> /path/to/real.app/Contents/Eclipse This allows us to remove redundant code in ProvisionedInstallationBuilder. Fixes #3548.
- Loading branch information
Showing
8 changed files
with
581 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 85 additions & 1 deletion
86
tycho-its/src/test/java/org/eclipse/tycho/test/P2DirectorPluginTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,99 @@ | ||
package org.eclipse.tycho.test; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertTrue; | ||
import static org.junit.Assert.fail; | ||
|
||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
|
||
import org.apache.maven.it.VerificationException; | ||
import org.apache.maven.it.Verifier; | ||
import org.eclipse.tycho.TargetEnvironment; | ||
import org.junit.Test; | ||
|
||
public class P2DirectorPluginTest extends AbstractTychoIntegrationTest { | ||
|
||
@Test | ||
public void testDirectorStandalone() throws Exception { | ||
public void testDirectorStandaloneWindows() throws Exception { | ||
Verifier verifier = getVerifier("tycho-p2-director-plugin/director-goal-standalone", true, true); | ||
verifier.addCliOption("-Pdirector-windows"); | ||
verifier.executeGoal("package"); | ||
verifier.verifyErrorFreeLog(); | ||
|
||
assertTrue(Files.isDirectory(Path.of(verifier.getBasedir(), "target", "productwindows", "plugins"))); | ||
} | ||
|
||
@Test | ||
public void testDirectorStandaloneLinux() throws Exception { | ||
Verifier verifier = getVerifier("tycho-p2-director-plugin/director-goal-standalone", true, true); | ||
verifier.addCliOption("-Pdirector-linux"); | ||
verifier.executeGoal("package"); | ||
verifier.verifyErrorFreeLog(); | ||
|
||
assertTrue(Files.isDirectory(Path.of(verifier.getBasedir(), "target", "productlinux", "plugins"))); | ||
} | ||
|
||
@Test | ||
public void testDirectorStandaloneMacOsDestinationWithAppSuffix() throws Exception { | ||
Verifier verifier = getVerifier("tycho-p2-director-plugin/director-goal-standalone", true, true); | ||
verifier.addCliOption("-Pdirector-macos-destination-with-app-suffix"); | ||
verifier.executeGoal("package"); | ||
verifier.verifyErrorFreeLog(); | ||
|
||
assertTrue(Files.isDirectory( | ||
Path.of(verifier.getBasedir(), "target", "productmacos.app", "Contents", "Eclipse", "plugins"))); | ||
} | ||
|
||
@Test | ||
public void testDirectorStandaloneMacOsDestinationWithoutAppSuffix() throws Exception { | ||
Verifier verifier = getVerifier("tycho-p2-director-plugin/director-goal-standalone", true, true); | ||
verifier.addCliOption("-Pdirector-macos-destination-without-app-suffix"); | ||
verifier.executeGoal("package"); | ||
verifier.verifyErrorFreeLog(); | ||
|
||
assertTrue(Files.isDirectory(Path.of(verifier.getBasedir(), "target", "productmacos", "Eclipse.app", "Contents", | ||
"Eclipse", "plugins"))); | ||
} | ||
|
||
@Test | ||
public void testDirectorStandaloneMacOsDestinationWithFullBundlePath() throws Exception { | ||
Verifier verifier = getVerifier("tycho-p2-director-plugin/director-goal-standalone", true, true); | ||
verifier.addCliOption("-Pdirector-macos-destination-with-full-bundle-path"); | ||
verifier.executeGoal("package"); | ||
verifier.verifyErrorFreeLog(); | ||
|
||
assertTrue(Files.isDirectory( | ||
Path.of(verifier.getBasedir(), "target", "productmacos.app", "Contents", "Eclipse", "plugins"))); | ||
} | ||
|
||
@Test | ||
public void testDirectorStandaloneUsingRunningEnvironment() throws Exception { | ||
Verifier verifier = getVerifier("tycho-p2-director-plugin/director-goal-standalone", true, true); | ||
verifier.addCliOption("-Pdirector-running-environment"); | ||
verifier.executeGoal("package"); | ||
verifier.verifyErrorFreeLog(); | ||
|
||
if ("macosx".equals(TargetEnvironment.getRunningEnvironment().getOs())) { | ||
assertTrue(Files.isDirectory(Path.of(verifier.getBasedir(), "target", "product", "Eclipse.app", "Contents", | ||
"Eclipse", "plugins"))); | ||
} else { | ||
assertTrue(Files.isDirectory(Path.of(verifier.getBasedir(), "target", "product", "plugins"))); | ||
} | ||
} | ||
|
||
@Test | ||
public void testDirectorStandaloneInconsistentP2Options() throws Exception { | ||
Verifier verifier = getVerifier("tycho-p2-director-plugin/director-goal-standalone", true, true); | ||
verifier.addCliOption("-Pdirector-iconsistent-p2-arguments"); | ||
try { | ||
verifier.executeGoal("package"); | ||
fail(VerificationException.class.getName() + " expected"); | ||
} catch (VerificationException e) { | ||
} | ||
verifier.verifyTextInLog( | ||
"p2os / p2ws / p2arch must be mutually specified, p2os=win32 given, p2ws missing, p2arch missing"); | ||
assertFalse(Files.isDirectory(Path.of(verifier.getBasedir(), "target", "product"))); | ||
} | ||
|
||
} |
Oops, something went wrong.