diff options
author | Ed Merks | 2013-08-10 06:44:56 +0000 |
---|---|---|
committer | Ed Merks | 2013-08-10 06:44:56 +0000 |
commit | ff80020bdcfafd5ed221e40826a5e5d63bc25928 (patch) | |
tree | 91e96a9eab40797f9f7aa533491cbbcc7fdf8402 /plugins/org.eclipse.emf.cdo.releng.setup.product/src/org/eclipse/emf/cdo/releng/setup | |
parent | 02defe32410e41b300dac05f8835bb4307645c10 (diff) | |
download | cdo-ff80020bdcfafd5ed221e40826a5e5d63bc25928.tar.gz cdo-ff80020bdcfafd5ed221e40826a5e5d63bc25928.tar.xz cdo-ff80020bdcfafd5ed221e40826a5e5d63bc25928.zip |
Reset profile when installing the Eclipse IDE
Change-Id: I432eb615002766e565de53cf423cb261aae17612
Signed-off-by: Ed Merks <ed.merks@gmail.com>
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.releng.setup.product/src/org/eclipse/emf/cdo/releng/setup')
2 files changed, 28 insertions, 6 deletions
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup.product/src/org/eclipse/emf/cdo/releng/setup/product/Director.java b/plugins/org.eclipse.emf.cdo.releng.setup.product/src/org/eclipse/emf/cdo/releng/setup/product/Director.java index 81a2f054e4..7fbf725783 100644 --- a/plugins/org.eclipse.emf.cdo.releng.setup.product/src/org/eclipse/emf/cdo/releng/setup/product/Director.java +++ b/plugins/org.eclipse.emf.cdo.releng.setup.product/src/org/eclipse/emf/cdo/releng/setup/product/Director.java @@ -15,6 +15,7 @@ import org.eclipse.emf.cdo.releng.setup.InstallableUnit; import org.eclipse.emf.cdo.releng.setup.P2Repository; import org.eclipse.emf.cdo.releng.setup.SetupFactory; import org.eclipse.emf.cdo.releng.setup.SetupPackage; +import org.eclipse.emf.cdo.releng.setup.helper.Files; import org.eclipse.emf.cdo.releng.setup.helper.Progress; import org.eclipse.emf.cdo.releng.setup.helper.ProgressLog; @@ -23,6 +24,7 @@ import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EObject; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.Platform; import org.eclipse.equinox.internal.p2.director.app.DirectorApplication; @@ -39,6 +41,8 @@ public final class Director private String bundlePool; + private boolean resetProfile; + private Director(DirectorCall directorCall, String bundlePool) { this.directorCall = directorCall; @@ -68,6 +72,12 @@ public final class Director return iu(id + ".feature.group"); } + public Director resetProfile() + { + resetProfile = true; + return this; + } + public Director repository(String url) { P2Repository p2Repository = SetupFactory.eINSTANCE.createP2Repository(); @@ -76,7 +86,7 @@ public final class Director return this; } - public void install(String destination) + public void install(String destination) throws Exception { File eclipseFolder = new File(destination); eclipseFolder.mkdirs(); @@ -105,6 +115,11 @@ public final class Director String arch = Platform.getOSArch(); String bundleAgent = new File(bundlePool, "p2").getAbsolutePath(); + if (resetProfile) + { + Files.delete(new File(bundleAgent, "org.eclipse.equinox.p2.engine/profileRegistry/" + profileName + ".profile"), + new NullProgressMonitor()); + } String[] args = { "-destination", destination, "-repository", repositories, "-installIU", ius, "-profile", profileName, "-profileProperties", "org.eclipse.update.install.features=true", "-bundlepool", bundlePool, @@ -159,9 +174,15 @@ public final class Director return new Director(bundlePool); } - public static void install(String bundlePool, DirectorCall directorCall, String destination) + public static void install(String bundlePool, DirectorCall directorCall, String destination, boolean resetProfile) + throws Exception { Director director = new Director(directorCall, bundlePool); + if (resetProfile) + { + director.resetProfile(); + } + director.install(destination); } } diff --git a/plugins/org.eclipse.emf.cdo.releng.setup.product/src/org/eclipse/emf/cdo/releng/setup/product/SetupDialog.java b/plugins/org.eclipse.emf.cdo.releng.setup.product/src/org/eclipse/emf/cdo/releng/setup/product/SetupDialog.java index 8a812a0d45..b1e7a519a2 100644 --- a/plugins/org.eclipse.emf.cdo.releng.setup.product/src/org/eclipse/emf/cdo/releng/setup/product/SetupDialog.java +++ b/plugins/org.eclipse.emf.cdo.releng.setup.product/src/org/eclipse/emf/cdo/releng/setup/product/SetupDialog.java @@ -692,7 +692,7 @@ public class SetupDialog extends TitleAreaDialog String bundlePool = new File(installFolder, ".p2pool-ide").getAbsolutePath(); - install(bundlePool, destination, updateLocations, setup.getEclipseVersion().getDirectorCall()); + install(bundlePool, destination, updateLocations, setup.getEclipseVersion().getDirectorCall(), true); Director.from(bundlePool) // .feature("org.eclipse.egit") // @@ -737,13 +737,14 @@ public class SetupDialog extends TitleAreaDialog { for (DirectorCall directorCall : installation.getDirectorCalls()) { - install(bundlePool, destination, updateLocations, directorCall); + install(bundlePool, destination, updateLocations, directorCall, false); } } - private void install(String bundlePool, String destination, Set<String> updateLocations, DirectorCall directorCall) + private void install(String bundlePool, String destination, Set<String> updateLocations, DirectorCall directorCall, + boolean resetProfile) throws Exception { - Director.install(bundlePool, directorCall, destination); + Director.install(bundlePool, directorCall, destination, resetProfile); for (P2Repository p2Repository : directorCall.getP2Repositories()) { updateLocations.add(p2Repository.getUrl()); |