Resource Creation tasks not executed in new workspace [message #1751882] |
Mon, 16 January 2017 08:20  |
Eclipse User |
|
|
|
I've made a setup which includes Resource Creation tasks *for the installation* like this below:
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<setup:ResourceCreationTask
xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
content="<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
	<section name="org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart">
		<item value="2" key="layout"/>
		<item value="true" key="group_libraries"/>
		<item value="2" key="rootMode"/>
		<item value="true" key="linkWithEditor"/>
	</section>
</section>"
targetURL="${workspace.location|uri}/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml"
encoding="UTF-8"/>
That works fine if I run the installer and start Eclipse with the workspace configured by installer.
However, if I simply say from the properly configured Eclipse "File->Switch Workspace->Other..." and enter a non-existing workspace path, the Eclipse instance started with the new workspace, executes only Preferences Tasks, but does *not* execute any of Resource Creation tasks (even if they are specified for "installation").
I guess the problem here is that the workspace starts JDT (or other plugins) *before* Oomph so that they manage to create those files before setup engine can create them (e.g. .metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml).
How I can deal with that? I would like that those files are "touched" once by Oomph even if they exists already. Is there any trick to do so?
|
|
|
|
Re: Resource Creation tasks not executed in new workspace [message #1751893 is a reply to message #1751887] |
Mon, 16 January 2017 10:08   |
Eclipse User |
|
|
|
Ed Merks wrote on Mon, 16 January 2017 15:29What kind of setup?
I'm trying to setup the entire product/workspace/project chain.
Ed Merks wrote on Mon, 16 January 2017 15:29
Note that workspace.location is only known if there is a Workspace task (as in the Project catalogs in the standard index).
Yep, there is a Workspace task.
Ed Merks wrote on Mon, 16 January 2017 15:29
If you want the installation to do such a thing for all workspace's even when there is no project stream referenced by the workspace's workspace.setup, you can use ${osgi.instance.area|file} instead.
Dou you mean, instead of writing
${workspace.location|uri}/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml
I should use
${osgi.instance.area|file}/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml
What would be the difference? Wouldn't be the same location then?
If I try to use this, installer tolds me that "osgi.instance.area" variable is undefined (in the variables page), so I have to remove BOOTSTRAP from the triggers. After that Eclipse can't resolve the variable at startup either, so the files aren't created at all.
Probably what would help (but need to be implemented): it would be nice if Oomph could plug-in itself into the "Switch workspace" dialog, so that it could run the Resource Creation tasks for the new workspace before workspace is started.
What wonders me: everything works absolutely fine for the workspaces created with the installer. I guess the installer runs the "Resource Creation" tasks *before* workspace startup?
Or the difference is, that if installer creates workspace, it creates the files for the selected project/stream but while switching to the new workspace there is no stream configured yet for that workspace?
|
|
|
Re: Resource Creation tasks not executed in new workspace [message #1751908 is a reply to message #1751893] |
Mon, 16 January 2017 13:12  |
Eclipse User |
|
|
|
The point is that if you open a new workspace, there is no stream linked into that workspace.setp (which is demand created but empty), so it's a question of whether there is a workspace task in scope for the resource creation task you've specified. That's why I asked what kind of setup. Is the resource creation task in a project setup? If not, then in a new workspace there will be nothing to define the vale of that variable.
And yes, it's a question of when does that task perform. If it performs at bootstrap time, and a workspace task is in scope, then it will do it's thing (creating the resource) while the installer is running and so the resource will exist when the IDE runs. A resource creation task does not necessarily involve the workspace locations at all, so performing tasks during workspace switching (before the IDE actually launches with that workspace)) could affect any number of tasks and types of tasks. So yes, a new workspace has no streams so will not perform any tasks that are defined by some project setup...
|
|
|
Powered by
FUDForum. Page generated in 0.03545 seconds