Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 84065 - [RCP] Product export UI should support automation
Summary: [RCP] Product export UI should support automation
Status: RESOLVED DUPLICATE of bug 107272
Alias: None
Product: PDE
Classification: Eclipse Project
Component: Build (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 enhancement with 6 votes (vote)
Target Milestone: ---   Edit
Assignee: pde-build-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 96350 111656 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-01-31 12:35 EST by Ed Burnette CLA
Modified: 2013-10-20 13:04 EDT (History)
17 users (show)

See Also:


Attachments
patch that automates the product export (12.94 KB, application/octet-stream)
2006-01-26 19:57 EST, Erik Bengtson CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Burnette CLA 2005-01-31 12:35:31 EST
This request is split off from bug 49592.
For a fully automatic build and test cycle we would like the ability to build
and re-package the rcp application through an ant script. This could be done by
having the wizard output an ant script, or maybe by defining some export
specific ant tasks.
Comment 1 Jeff McAffer CLA 2005-01-31 12:55:45 EST
Perhaps this should be phrased more in terms of what is missing from PDE Build 
rather than PDE UI.  Under the covers the "real" work (sorry Wassim) is carried 
out by PDE build.  That is entirely done in terms of Ant tasks etc.  I 
regularly use this and the Eclipse releng builds are done entirely this way.  
So what is missing?
Comment 2 Chris Wege CLA 2005-01-31 15:02:22 EST
To build features and plugins, you can use the ant tasks "pde.exportfeatures"
and "pde.exportplugins". However, they are running asychronously (as reported in
bug 58413). The rcp export wizard should
1) provide a task like pde.exportrcpapplication and
2) allow to run this task sychronously

Do the releng tools provide this in a convenient way already?
Comment 3 Chris Wege CLA 2005-01-31 15:04:27 EST
Added Frank, since we were discussing this issue recently.
Comment 4 Wassim Melhem CLA 2005-01-31 15:32:48 EST
>Under the covers the "real" work (sorry Wassim) is carried out by PDE build.
Ouch, that hurt.  Luckily, I'm thick-skinned.

PDE/UI certainly should/would not want to be in the business in duplicating 
what PDE/Build does.  That is what I made clear in bug 58413.

I guess the appeal of ant tasks such as pde.exportFeatures and 
pde.exportPlugins is the simplicity.  The unattractive part is the fact that 
they are asynchronous.  Making them synchronous without increasing the 
complexity would be difficult as explained in bug 58413. 
Comment 5 Wassim Melhem CLA 2005-01-31 22:42:42 EST
resolving as dup of bug 58413, as implementation-wise, it all boils down to 
pde.exportFeatures being synchronous and headless.

*** This bug has been marked as a duplicate of 58413 ***
Comment 6 Ed Burnette CLA 2005-02-14 11:39:51 EST
This is not a duplicate. Regardless of whether or not some ant task somewhere is
synchronous, the Product Configuration editor in I20050209 currently lists
Export as a three step process:

1. Synchronize this configuration with the product's defining plug-in. (whatever
that means)
2. Specify the export destination, and
3. Press the Export button.

An export button is not automation. Consider two other examples from the UI:

If you select File > Export > Jar file, you can Save the description of this JAR
in the workspace by giving a path to a .jardesc file. Later you can right-click
on the jardesc file and select Open JAR Packager, or Create Jar. This is not
really automation either but it's a little closer.

If you select File > Export > Deployable plug-ins and fragments, you are given
the option Save this export operation as an Ant build script. This script,
whatever tasks it refers to I don't care, can theoretically be used later as
part of an automated build process. This kind of thing is missing from the
Product Configuration story.
Comment 7 Wassim Melhem CLA 2005-02-14 12:14:11 EST
I was thinking of providing an action to export a product via the PDE Tools 
context menu of the .product file itself.

That is the best PDE/UI can do. 

Is that what is being alluded to here?
Comment 8 Ed Burnette CLA 2005-02-14 13:09:26 EST
That would be helpful but doesn't go far enough. I want to be able to run that
action (rebuild the deployable package) every time the source code changes and
the project rebuilds. I want to also run it from CruiseControl.

As far as implementation goes, if the UI provided an option to save whatever
'Export' does as an ant script then I think I could do both these things.
Comment 9 Jeff McAffer CLA 2005-02-14 23:43:17 EST
Seems like this is why the bug was closed as a duplicate.  Everything you are 
asking for is reasonable but ultimately boils down to being able to run this 
function without PDE UI in the picture.  

No one is arguing with the suggested function, just that it is not as easy as 
you might think.  There is a very significant amount of magic in this area.
Comment 10 Ed Burnette CLA 2005-02-15 10:38:19 EST
Ok, how about if I rephrase the request as follows:

For a fully automatic build and test cycle we would like the ability to
re-package RCP products after builds or through Cruise Control (most likely via
ant). The Product Configuration Editor has an Export button as of I20050209 but
it's manual. This request is to expose automated export capabilities through the
UI, for example by having an option visible in the editor or on a popup menu to
save the export operation as an Ant script (see the Deployable plug-ins and
fragments export wizard). Bug 58413 is related but is concerned only with the
tasks in the script, while this entry is concerned with how the capability is
exposed to the user through the UI. The idea is to make it easier for the user
to discover this capability.

I've modified the summary as well to clarify things.
Comment 11 Jeff McAffer CLA 2005-02-15 11:37:51 EST
I might be obtuse here but say there is a way of saving the script as you 
outlined.  Are you not then going to say that you want bug 58413 address to 
make the generated script useful?

If you are ok with something "just like the deployable wizard" then (correct me 
if you disagree Wassim) that seems doable.  We needn't really even provide the 
button whatever as the generated script is so trivial an automated build 
mechanism could likely generate one.  What you really want is the task.
Comment 12 Wassim Melhem CLA 2005-02-15 11:42:45 EST
yes, if what is needed is something similar to the Ant task generation of the 
export wizard, then it is doable.
Comment 13 Gunnar Wagenknecht CLA 2005-05-25 08:56:19 EDT
I don't think that this should be in the domain of PDE UI. Automated builds are
already possible with PDE Build.

Wouldn't it be better if PDE UI would create some tools for creating the Ant
scripts necessary for an automated build using PDE build? I tried to replicate
the product export feature using PDE Build but this is not possible because of
the hidden magic, which is done in ProductExportJob to collect all product
features and the launchers.
Comment 14 Wassim Melhem CLA 2005-11-12 19:22:25 EST
*** Bug 111656 has been marked as a duplicate of this bug. ***
Comment 15 Wassim Melhem CLA 2005-11-28 20:53:32 EST
*** Bug 96350 has been marked as a duplicate of this bug. ***
Comment 16 Erik Bengtson CLA 2006-01-26 19:57:52 EST
Created attachment 33681 [details]
patch that automates the product export

Hi,

I want to propose one solution. I've created an eclipse product that allows the build automation. It's an application (PlatformRunnable) that takes some command line arguments and invoke the ProductExport.

To test the patch I tried the 4 products I have.

The patch has two applications: 

1) does the import of projects to workspace
2) does the product export

The first one is a support application, so one can fetch projects from CVS, SVN, etc and put into a workspace folder. Later it needs to be imported into eclipse workspace.

The import application does not copy the files neither fetch from CVS, so the files must be placed in the workspace folder by another ant task.

The second application just takes the workspace and build.

Some examples
1)---------PROJECT IMPORT INTO WORKSPACE
C:\eclipse>java -jar startup.jar -product org.eclipse.automation.importProject
-data "C:\Documents and Settings\ebengtso\My Documents\workspace" JunitForPDE
=============================================================================
Automation of project import. Imports a project into workspace.
=============================================================================

Importing project JunitForPDE ...
Project JunitForPDE imported.

2) --------PRODUCT EXPORT
C:\eclipse>java -jar startup.jar -product org.eclipse.automation.productExport
-data "C:\Documents and Settings\ebengtso\My Documents\workspace" com.wu.agentsv
c.agentserver /agentserver.product c:\test\ false
=============================================================================
Automation of product export. Exports a product to a directory.
=============================================================================

Workspace location:C:/Documents and Settings/ebengtso/My Documents/workspace
Job started . 0 out of 10
.
.
Job done in 109861 ms.
Product exported.


-----------
TO USE
-----------

1. make a new install of eclipse sdk
1. place the plugin under eclipse/plugins
2. fetch the projects from CVS and place under like eclipse/workspace
3. run the importProject application to import the projects (one run per project)
4. run the productExport application

IMPORT PROJECT
--------------
-product org.eclipse.automation.importProject
-data <workspaceAbsolutePath>
<projectPathRelativeToWorkspace>

PRODUCT EXPORT
--------------
-product org.eclipse.automation.productExport
-data <workspaceAbsolutePath>
<productProjectPathRelativeToWorkspace>
<productFilePathRelativeToProject>
<exportFolderAbsolutePath>
<export sources (true|false)>
Comment 17 Wassim Melhem CLA 2006-01-26 21:17:22 EST
thanks Erik, but the proposed solution is built on top of pde/ui which is not what people here want.
Comment 18 Erik Bengtson CLA 2006-01-27 05:25:57 EST
(In reply to comment #17)
> thanks Erik, but the proposed solution is built on top of pde/ui which is not
> what people here want.
> 

The goal here is to automate the build to end users, and that's reachable with this solution. You just need to create ant scripts to invoke the Main.class passing a couple of arguments, and you are done. There is no visible UI.

You may want to have it designed differently, but that's another story.
Comment 19 Frank Gerhardt CLA 2006-01-27 13:42:24 EST
I like the idea and did something similar. I wrote Jobs to do the checkout and the build and the export. This build was running at one of my clients for several weeks until they decided to go for the full PDE build.

Even though your approach is not what the PDE guys want, this solution is really sufficient for most other users. Please don't stop. Maybe you can create a small sourceforge project for it.
Comment 20 Ben Konrath CLA 2006-01-28 13:51:35 EST
The proposed solution seems to be very similar to something that I'm working on - an easy way to build and package Eclipse plugins. Details can be found in this post to the fedora-java mailing list:

https://www.redhat.com/archives/fedora-devel-java-list/2006-January/msg00060.html

The important thing to note with what I've done so far is that it is a proof-of-concept and there are definitely some problems with the implementation. My initial plan was to talk to other Linux distributions before I approached the Eclipse community for help solving the implementation problems but I just ran across this bug.

It would be nice to see if we can come up with a solution that addresses both the needs of the Linux Eclipse communities and the requirements expressed here - if that is possible. Any comments on this would be appreciated.
Comment 21 Wassim Melhem CLA 2006-03-01 23:12:57 EST
PDE/Build now supports a headless releng-style product export given a .product file.

The UI is staying out of this business.

Moving to PDE/Build to close.
Comment 22 Pascal Rapicault CLA 2006-03-02 10:36:36 EST
As Wassim said PDE build is now able to completly export a product from a product file. It will generate the config.ini and the eclipse.ini (the eclipse.ini is not released yet, see bug #127576).
There is no doc yet but you can take a look at the productBuild folder under pde.build/scripts.

*** This bug has been marked as a duplicate of 107272 ***
Comment 23 Erik Bengtson CLA 2007-06-08 23:10:01 EDT
I have released the proposed solution as open source project at:
http://eclipseassembly.sourceforge.net
Updated to support Eclipse 3.3