SWF-NeedsRecompile

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

        Examine a list of .swf and/or .fla files and return the file names
        of the ones that need to be recompiled.

        Performance note: Information is cached across files, so it's faster
        to call this function once with a bunch of files than a bunch of
        times with one file each invocation.

    $pkg->as_classpath()
        Returns a list of Classpath directories specified globally in Flash.

    $pkg->flash_prefs_path()
        Returns the file name of the Flash preferences XML file.

    $pkg->flash_config_path()
        Returns the path where Flash stores all of its class prototypes.

    $pkg->set_verbose($boolean)
    $pkg->set_verbosity($number)
        Changes the verbosity of the whole module. Defaults to false. Set to
        a number higher than 1 to get very verbose output.

lib/SWF/NeedsRecompile.pm  view on Meta::CPAN

use Regexp::Common qw(comment);
use File::HomeDir;
use List::MoreUtils qw(any);

our $VERSION = '1.06';

use base qw(Exporter);
our @EXPORT_OK = qw(
   check_files
   as_classpath
   flash_prefs_path
   flash_config_path
);

my $cached_as_classpath;

my $verbosity = 0;
__PACKAGE__->set_verbosity($ENV{SWFCOMPILE_VERBOSITY});

my %os_paths = (
   darwin => {

lib/SWF/NeedsRecompile.pm  view on Meta::CPAN

=item $pkg->as_classpath()

Returns a list of Classpath directories specified globally in Flash.

=cut

sub as_classpath
{
   if (!$cached_as_classpath)
   {
      my $prefs_file = flash_prefs_path();
      if (!$prefs_file || ! -f $prefs_file)
      {
         #_log(2, 'Failed to locate the Flash prefs file');
         return q{.};
      }

      my $conf_dir = flash_config_path();
      for (File::Slurp::read_file($prefs_file))
      {
         if (m/<Package_Paths>(.*?)<\/Package_Paths>/xms)
         {
            my $cp = $1;
            my @dirs = split /;/xms, $cp;
            for (@dirs)
            {
               if (!$conf_dir)
               {
                  _log(2, "Failed to identify the UserConfig dir for '$_'");

lib/SWF/NeedsRecompile.pm  view on Meta::CPAN

            }
            $cached_as_classpath = \@dirs;
            _log(2, "Classpath: @{$cached_as_classpath}");
            last;
         }
      }
   }
   return @{$cached_as_classpath};
}

=item $pkg->flash_prefs_path()

Returns the file name of the Flash preferences XML file.

=cut

sub flash_prefs_path
{
   return _get_path('pref');
}

=item $pkg->flash_config_path()

Returns the path where Flash stores all of its class prototypes.

=cut



( run in 0.861 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )