| Summary: | [Tooling] Split tooling and runtime | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Beyhan Veliev <beyhan.veliev> | ||||||||||||||||||||
| Component: | Demo | Assignee: | Project Inbox <rap-inbox> | ||||||||||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||||||||||
| Severity: | enhancement | ||||||||||||||||||||||
| Priority: | P3 | ||||||||||||||||||||||
| Version: | 1.4 | ||||||||||||||||||||||
| Target Milestone: | 1.4 M6 | ||||||||||||||||||||||
| Hardware: | PC | ||||||||||||||||||||||
| OS: | All | ||||||||||||||||||||||
| Whiteboard: | |||||||||||||||||||||||
| Bug Depends on: | |||||||||||||||||||||||
| Bug Blocks: | 336239, 336413 | ||||||||||||||||||||||
| Attachments: |
|
||||||||||||||||||||||
|
Description
Beyhan Veliev
This blog entry of Jeff provides some useful information about sharing of target content between workspaces in Eclipse Indigo http://mcaffer.com/2010/12/populate-target-definitions-faster/ Created attachment 187854 [details]
A proposal to spilt RAP-tooling and RAP-runtime
Attached patch uses PDE functionality to download the RAP-runtime from a remote P2 repository. With this approach it's no more required to include the RAP-runtime into RAP-tooling. Current install dialog allows to select between latest release and latest stable build. In a future version this can be extended.
Created attachment 187934 [details] Modified patch Hi Beyhan, thanks for your work. The changes are looking pretty good. I like the idea to having a fake p2 repository for the testing purpose. But I have some things to discuss: 1) The source code violates our coding conventions. I modified the source files. For the next changes please take a look at: http://wiki.eclipse.org/RAP/CodingConventions 2) When you edit a source file please update the year of the copyright headers. Also done in the attached version. 3) Before the patch we had only a discouraged access warning in one class. I know from RĂ¼diger that this was by purpose to have a cleaner code base. After the patch we have warnings in several classes. Is it possible to wrap all this discouraged access stuff in one class to have a cleaner code base? I think this could be done with some basic refactoring. 4) There is no reason to keep dead code. This means if you find unused classes or commented code please feel free to delete it. 5) The TargetSwitcher tests are red. As we discussed via Skype this is probably because of the corrupt p2 fake repository. Maybe we can create a p2 repository on-the-fly in a temporary folder? Here is the stacktrace: org.eclipse.core.runtime.CoreException: Problems occurred while resolving the target contents at org.eclipse.rap.ui.internal.intro.target.TargetSwitcher.downloadTarget(TargetSwitcher.java:142) at org.eclipse.rap.ui.internal.intro.target.TargetSwitcher.install(TargetSwitcher.java:88) at org.eclipse.rap.ui.internal.intro.target.TargetSwitcher_Test.testInstallTargetAvailable(TargetSwitcher_Test.java:77) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:164) at junit.framework.TestCase.runBare(TestCase.java:130) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62) at org.eclipse.pde.internal.junit.runtime.UITestApplication$1.run(UITestApplication.java:116) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3765) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3456) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.pde.internal.junit.runtime.UITestApplication.start(UITestApplication.java:47) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) at org.eclipse.equinox.launcher.Main.main(Main.java:1386) Contains: An error occurred while collecting items to be installed Contains: session context was:(profile=TARGET_DEFINITION:local:1296464837640.target, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=). Contains: java.lang.NullPointerException at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.downloadArtifact(SimpleArtifactRepository.java:525) at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.downloadArtifact(SimpleArtifactRepository.java:508) at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifact(SimpleArtifactRepository.java:575) at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.getArtifact(MirrorRequest.java:249) at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.transferSingle(MirrorRequest.java:224) at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.transfer(MirrorRequest.java:180) at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.perform(MirrorRequest.java:116) at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifact(SimpleArtifactRepository.java:564) at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifacts(SimpleArtifactRepository.java:615) at org.eclipse.equinox.internal.p2.engine.DownloadManager.fetch(DownloadManager.java:88) at org.eclipse.equinox.internal.p2.engine.DownloadManager.start(DownloadManager.java:77) at org.eclipse.equinox.internal.p2.engine.phases.Collect.completePhase(Collect.java:76) at org.eclipse.equinox.internal.p2.engine.Phase.postPerform(Phase.java:216) at org.eclipse.equinox.internal.p2.engine.Phase.perform(Phase.java:84) at org.eclipse.equinox.internal.p2.engine.PhaseSet.perform(PhaseSet.java:44) at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:75) at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:44) at org.eclipse.pde.internal.core.target.P2TargetUtils.resolveWithSlicer(P2TargetUtils.java:1131) at org.eclipse.pde.internal.core.target.P2TargetUtils.synchronize(P2TargetUtils.java:707) at org.eclipse.pde.internal.core.target.IUBundleContainer.resolveBundles(IUBundleContainer.java:223) at org.eclipse.pde.internal.core.target.AbstractBundleContainer.resolve(AbstractBundleContainer.java:97) at org.eclipse.pde.internal.core.target.TargetDefinition.resolve(TargetDefinition.java:265) at org.eclipse.rap.ui.internal.intro.target.TargetSwitcher.downloadTarget(TargetSwitcher.java:140) at org.eclipse.rap.ui.internal.intro.target.TargetSwitcher.install(TargetSwitcher.java:88) at org.eclipse.rap.ui.internal.intro.target.TargetSwitcher_Test.testInstallTargetAvailable(TargetSwitcher_Test.java:77) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:164) at junit.framework.TestCase.runBare(TestCase.java:130) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62) at org.eclipse.pde.internal.junit.runtime.UITestApplication$1.run(UITestApplication.java:116) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3765) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3456) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.pde.internal.junit.runtime.UITestApplication.start(UITestApplication.java:47) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) at org.eclipse.equinox.launcher.Main.main(Main.java:1386) The modified patch contains some formatting and refactoring. Created attachment 187935 [details]
fake p2 repository
I didn't include the fake repository to the patch because of some binary issues. The attached zip file is from Beyhan. It contains the "target" folder which should be copied in the root of "org.eclipse.rap.ui.tests".
Created attachment 187936 [details]
Updated version
I accidently removed InstallRAPTargetAction. The attached patches contains all changes form the 2nd version + InstallRAPTargetAction.
Created attachment 188075 [details]
Version 4
Hi Holger,
thank you for your comments. I create a new patch. Here is what I did:
3) Reduced the number of discouraged access to 2 classes. One of them "CreateContainer" will be obsolete with the next version of RAP that is why I didn't refactor it.
4)Actually, I removed all dead code that i found with the first patch. With this patch I removed some resources which are no more needed.
5)The problem here is bundle "org.eclipse.equinox.p2.transport.ecf" which is missing in your run configuration. I tested it under Windows but under Linux/Mac you need this additional bundle in your run configuration. It provides some services which P2 needs to download artifacts from a P2-repository.
6)We don't need any more the jared fake P2-repository. Tests cases create a P2-repository on the fly.
I applied your patch and added org.eclipse.equinox.p2.transport.ecf to my launch configs. The tests are still red and when I want to install the target from the tooling I get this exception: !ENTRY org.eclipse.core.jobs 4 2 2011-02-02 15:02:01.812 !MESSAGE An internal error occurred during: "Installing RAP target platform". !STACK 0 java.lang.NullPointerException at org.eclipse.pde.internal.core.target.P2TargetUtils.getAgent(P2TargetUtils.java:296) at org.eclipse.pde.internal.core.target.P2TargetUtils.getProfileRegistry(P2TargetUtils.java:787) at org.eclipse.pde.internal.core.target.P2TargetUtils.synchronize(P2TargetUtils.java:684) at org.eclipse.pde.internal.core.target.IUBundleContainer.resolveBundles(IUBundleContainer.java:223) at org.eclipse.pde.internal.core.target.AbstractBundleContainer.resolve(AbstractBundleContainer.java:97) at org.eclipse.pde.internal.core.target.TargetDefinition.resolve(TargetDefinition.java:265) at org.eclipse.rap.ui.internal.intro.target.TargetSwitcher.downloadTarget(TargetSwitcher.java:144) at org.eclipse.rap.ui.internal.intro.target.TargetSwitcher.install(TargetSwitcher.java:89) at org.eclipse.rap.ui.internal.intro.target.InstallRAPTargetHandler$2.run(InstallRAPTargetHandler.java:64) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Created attachment 188214 [details]
new version of the patch
I updated the launch configs and removed the target folder from the intro plugin.
Created attachment 188219 [details]
Version 6
This patch is extended with:
* Error message in case no internet connection available
* Error message in case RAP-target repository corrupted
Created attachment 188315 [details]
Version 7
The Version 6 installes not the latest build for the 1.4 Version. it installes bundles from 09.2010. I did a little formatting, so please use this path as a base for the fix.
Created attachment 188343 [details]
Version 8
Hmm, PDE-target provisioning doesn't behave deterministically if empty version is provided. In my opinion it should install the latest available version.
Anyway, the version 8 has following features in addition:
* RAP-runtime P2-repository is queried for the latest available version
* State location of bundle "org.eclipse.rap.ui.intro" is used as cache for P2-metadata. It is possible that different Eclipse workspaces have different versions of RAP-runtime therefore P2-metadata has to be workspace specific.
I tested your patch and did a little formatting. I didn't found errors ;) So, well done. The patch is in CVS HEAD. Thanks for your work. Looks good, I just have some minor ideas for improvement: 1) The dialog is very large and could well be reduced in height if possible. 2) The message in the title sounds a bit like a threat ;-) "Target content will be downloaded and this can take a few minutes." I think I would rather delete this sentence. Instead of this, we could add a label below the radio boxes saying "The target will be downloaded from the RAP repository" 3) I think we could further describe the version options like this: [x] Latest stable build (latest features, recommended for development) [ ] Latest release (???) 4) The Group box text "Target selection" should be changed to something like "Target activation". Accordingly, the first Group box should be renamed to "Target selection", not to repeat the title message. 5) What about a RAP branding in the title area? I opened a new bug for the UI refactoring, see bug 336794. |