Bug 351526 - [patch] Ant task for provisioning a target definition
Summary: [patch] Ant task for provisioning a target definition
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.8 M3   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on: 351525
Blocks: 358274
  Show dependency tree
 
Reported: 2011-07-08 04:50 EDT by Gunnar Wagenknecht CLA
Modified: 2012-11-05 16:54 EST (History)
5 users (show)

See Also:


Attachments
patch which moves TargetExportJob into pde.core (34.98 KB, patch)
2011-07-08 04:50 EDT, Gunnar Wagenknecht CLA
no flags Details | Diff
patch which adds the ant tasks to pde.core (7.71 KB, patch)
2011-07-08 04:51 EDT, Gunnar Wagenknecht CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gunnar Wagenknecht CLA 2011-07-08 04:50:42 EDT
Created attachment 199316 [details]
patch which moves TargetExportJob into pde.core

The attached patches introduce a new Ant task in pde.core which allows to provision (resolve+export) a target definition into a destination location.
Comment 1 Gunnar Wagenknecht CLA 2011-07-08 04:51:09 EDT
Created attachment 199317 [details]
patch which adds the ant tasks to pde.core
Comment 2 Gunnar Wagenknecht CLA 2011-07-08 04:53:17 EDT
Note, the changes can also be pulled from git://github.com/eclipseguru/pde-ui.git (branch target_platform_anttasks)
Comment 3 Gunnar Wagenknecht CLA 2011-07-08 04:57:48 EDT
Example Ant Task:

 <target name="setup" description="initializes target platform">
   <pde.provisionTargetDefinition 
           cleardestination="yes" 
           destinationdirectory="${repoBaseLocation}/target" 
           targetfile="my-target.target"/>
 </target>
Comment 4 Curtis Windatt CLA 2011-07-11 16:19:07 EDT
Is this intended as a workaround for bug 266311?  Or is it a first step towards supporting targets in pde build?  I'm not opposed to adding this task, but there needs to be some concrete reason to do so.  It is not difficult for an extending product to create the same task.
Comment 5 Gunnar Wagenknecht CLA 2011-07-12 02:03:27 EDT
(In reply to comment #4)
> Is this intended as a workaround for bug 266311?  Or is it a first step towards
> supporting targets in pde build? 

I think it's both. Short term, it's a workable solution for bug 266311 if PDE Core is also installed in the base builder. It does not support all aspects of target definitions, though. For example, path resolution using workspace variables wont work because there is no project/resource in a workspace.

Long term (IMHO), a reduced set of target definition functionality could move to PDE Build. The interesting piece (again, IMHO) is the IU container stuff. But I think it needs more flexibility regarding the actual update site location. For example, on build.eclipse.org I might want to "override" it at runtime by pointing directly to the downloads file system using file:// URLs.
Comment 6 Gunnar Wagenknecht CLA 2011-07-12 02:06:24 EDT
BTW, the TargetExportJob move to PDE Core also simplifies life for (headless) extenders. Currently it lives in PDE UI which requires lots of UI plug-ins.
Comment 7 Curtis Windatt CLA 2011-09-19 15:24:31 EDT
I don't think that bug 266311 will be looked at for 3.8. I think moving the job to PDE core still makes sense.  However, is there actually a use case where the new ant task is required?  I don't want to add a new task unless someone definitely needs it.
Comment 8 Gunnar Wagenknecht CLA 2011-09-19 15:46:44 EDT
(In reply to comment #7)
> However, is there actually a use case where the
> new ant task is required?

Currently, people are massing around with XSLT. That's error prone and requires quite a bit of duplication. Additionally, all other build technologies are capable of "downloading" target platforms during headless builds. IMHO PDE - as the creator of target platforms - should be able to support it in headless builds too.
Comment 9 Curtis Windatt CLA 2011-09-19 16:41:16 EDT
Both patches have been applied to the master branch with minor changes.
Comment 10 Eric Rizzo CLA 2012-11-05 15:33:50 EST
(In reply to comment #5)
> I think it's both. Short term, it's a workable solution for bug 266311 if
> PDE Core is also installed in the base builder. It does not support all
> aspects of target definitions, though. For example, path resolution using
> workspace variables wont work because there is no project/resource in a
> workspace.

Gunnar,
Can you elaborate about what capabilities of a target definition are and are not supported? I have a complex .target file that currently uses workspace variables, but I could easily change that to absolute file pats if this new tast supports Directory locations.
Comment 11 Gunnar Wagenknecht CLA 2012-11-05 15:43:56 EST
Sorry, I only know that Software Sites work (also with absolute file urls). I haven't tested others. However, basically everything that relys on a variable is broken because variables aren't resolved. Everything else should/may work.
Comment 12 Curtis Windatt CLA 2012-11-05 16:54:55 EST
(In reply to comment #10)
> (In reply to comment #5)
> > I think it's both. Short term, it's a workable solution for bug 266311 if
> > PDE Core is also installed in the base builder. It does not support all
> > aspects of target definitions, though. For example, path resolution using
> > workspace variables wont work because there is no project/resource in a
> > workspace.
> 
> Gunnar,
> Can you elaborate about what capabilities of a target definition are and are
> not supported? I have a complex .target file that currently uses workspace
> variables, but I could easily change that to absolute file pats if this new
> tast supports Directory locations.

PDE Core should be fully capable of resolving a target definition without a workspace.  Variables that require a workspace will not resolve, but the rest will.