Bug 5644 - Make it possible to run plugin without PAR during development
: Make it possible to run plugin without PAR during development
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Plugins
: 7.0
: PC Other
: P2 enhancement with 1 vote (vote)
: Future
Assigned To: Unassigned bug - please assign me!
http://forums.slimdevices.com/showthr...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-01 20:42 UTC by Erland Isaksson
Modified: 2009-08-31 05:57 UTC (History)
0 users

See Also:
Category: ---


Attachments
Patch that add lib to @INC if Plugins directory exist (470 bytes, patch)
2007-10-01 20:43 UTC, Erland Isaksson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erland Isaksson 2007-10-01 20:42:37 UTC
It would be a good idea to make it possible to run a plugin without building the PAR file during development. There seems to be some code regarding this, unfortunately is seems to require you to move files around before building the PAR.

The current implementation allows you to run with PAR with a structure like:
===================================
DynamicPlayList
    HTML
    Plugin.pm
===================================

Or a structure like:
===================================
DynamicPlayList
    HTML
    lib
        Dummy.pm
        Plugins
            DynamicPlayList
                Plugin.pm
===================================
In the second case the Dummy.pm is required to get Slim::Utils::PluginManager to add the lib to the @INC

The PluginBuilder tool in tools/PluginBuilder requires you to have a structure like this when building the PAR:
=====================================
DynamicPlayList
    HTML
    lib
        Plugins
            DynamicPlayList
                Plugin.pm
====================================
(Note, no Dummy.pm file is of course required here).

The major thing to fix is to make it possible to run without a PAR during development and building the PAR from the same directory structure without moving the Plugin.pm file around. One way to do this would be to also add the 'lib' to the @INC if a Plugins directory was found in the lib directory.

However, I really think that the best solution would be to get rid of all the special cases and just support one placement and position of the Plugin.pm file. There is no reason to have all these alternative, since all plugins will need to change to 7.0 anyway and we don't need to think about backward compatibility. So, just decide on a SINGLE structure that works for both development and building of PAR file for production.
Comment 1 Erland Isaksson 2007-10-01 20:43:43 UTC
Created attachment 2204 [details]
Patch that add lib to @INC if Plugins directory exist
Comment 2 Blackketter Dean 2007-12-27 13:32:19 UTC
Will look at this post-7.0.
Comment 3 Erland Isaksson 2008-09-04 09:49:28 UTC
Can't we close this or is it still open because some clean-up remains ?

Someone has made a correction related to this since this bug report was written, because it now works perfectly to develop without a PAR file with a structure like this:
===================================
DynamicPlayList
    HTML
    lib
        Plugins
            DynamicPlayList
                Plugin.pm
===================================

When a PAR is built it will be used instead of the .pm files.