Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#8222 closed enhancement (fixed)

[Patch] Update plugin build system

Reported by: simon04 Owned by: team
Priority: normal Milestone:
Component: Plugin Version:
Keywords: Cc: stoecker

Description

To get slimmer plugin ant build files, I suggest to move the dist target to build-common.xml. The build.xml would then only contain some (more) properties/variables.

Attachments (4)

plugin_build.patch (6.0 KB) - added by simon04 6 years ago.
plugin_build_v2.patch (8.0 KB) - added by simon04 6 years ago.
plugin_build_v3.patch (8.5 KB) - added by simon04 6 years ago.
plugin_build_v4.patch (8.6 KB) - added by simon04 6 years ago.

Download all attachments as: .zip

Change History (20)

Changed 6 years ago by simon04

Attachment: plugin_build.patch added

comment:1 Changed 6 years ago by bastiK

I like it.

comment:2 Changed 6 years ago by stoecker

This only works when all values are filled, especially if there is an icon. Otherwise you get a wrong manifest. People already produced wrong manifests by adding "..." or whatever as icons. Your suggestions will probably increase that error.

Even in ant it should be possible to make manifest entries conditional.

comment:3 Changed 6 years ago by Don-vip

Plugin-Stage and Plugin-Requires properties should be handled as well.

comment:4 Changed 6 years ago by simon04

I didn't find an easy way to handle those optional properties correctly. Neither <manifest> nor <attribute> allows some conditional decisions.

comment:5 Changed 6 years ago by stoecker

Making multiple manifest entries with different combinations and choosing the right one depending on the variable values?

Changed 6 years ago by simon04

Attachment: plugin_build_v2.patch added

comment:6 Changed 6 years ago by simon04

v2 handles unset properties and adds support for Plugin-Stage, Plugin-Requires, Plugin-Early.

comment:7 Changed 6 years ago by stoecker

Looks fine.

Three things remaining:

  • Does this work when one of the directories is missing? (ressources, data, ...)?
  • I would uncomment "<!-- -->" the optional arguments (link, icon), so people don't "..." them.
  • i18n script needs to be adapted to recognize also the new place of description text

Changed 6 years ago by simon04

Attachment: plugin_build_v3.patch added

comment:8 in reply to:  7 ; Changed 6 years ago by simon04

Replying to stoecker:

  • Does this work when one of the directories is missing? (ressources, data, ...)?

lib must exist, but there was no change affecting ressources or data

  • I would uncomment "<!-- -->" the optional arguments (link, icon), so people don't "..." them.

Done for the rarely used arguments. However, values "" and "..." are filtered in the build-common.xml

  • i18n script needs to be adapted to recognize also the new place of description text

Done.

comment:9 in reply to:  8 Changed 6 years ago by stoecker

Replying to simon04:

Replying to stoecker:

  • Does this work when one of the directories is missing? (ressources, data, ...)?

lib must exist, but there was no change affecting ressources or data

Not all plugins have these directories. The copy part is thus different for them. And when the dirs are empty they also should not be in the jar. Same for lib. It should work without the dir. Can these parts be skipped when dirs don't exists? Likewise for classpath lib?

Changed 6 years ago by simon04

Attachment: plugin_build_v4.patch added

comment:10 Changed 6 years ago by simon04

Adding a few failonerror, includeemptydirs, erroronmissingdir should do the trick (see v4).

comment:11 Changed 6 years ago by stoecker

Reading the diff looks fine. Now only the SVN can show if all works :-)

Last edited 6 years ago by stoecker (previous) (diff)

comment:12 Changed 6 years ago by simon04

Resolution: fixed
Status: newclosed

comment:13 Changed 6 years ago by stoecker

I added an "help" target in [o29004].

I also made another fix for geotools ([o28995]) and some others. A new target setup-dist can now be used to override or append to dist file generating: [o29005].

comment:14 Changed 6 years ago by Don-vip

It doesn't work for geotools. The custom dist target was here to exclude some file from the lib jars to be included in the final plugin jar. Because of the zipfileset task in the default build.xml, these files are now embedded. It's even worse: the other files are included twice, resulting in a jar that doubled in size. I'm working on a proper solution.

comment:15 Changed 6 years ago by Don-vip

Done in [o29007].

comment:16 Changed 6 years ago by stoecker

Strange, I thought I checked the contents of the resulting file before I did the checkin. Probably compared two times the same file :-)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.