swi_main.pl 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/usr/bin/perl
  2. #
  3. # Software Index, Copyright 2010, Software Index Project Team
  4. # Link: http://swi.sourceforge.net
  5. #
  6. # This file is part of Software Index Tool.
  7. #
  8. # Software Index is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation, version 3 of the License.
  11. #
  12. # Software Index is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with Software Index. If not, see <http://www.gnu.org/licenses/>.
  19. #
  20. =head1 NAME
  21. Software Index - the tool measures, reports and validates software statistic,
  22. searches for duplications, scans for errors, 'coding style' violations
  23. and other configurable patterns.
  24. =head1 SYNOPSIS
  25. perl swi_main.pl -h
  26. perl swi_main.pl -help
  27. perl swi_main.pl --help
  28. perl swi_main.pl </path/to/configuration/file.xml>
  29. =head1 OPTIONS
  30. =over 4
  31. =item -h, -help, --help
  32. Prints this help page.
  33. =item </path/to/configuration/file.xml>
  34. Full or relative path to the configuration file for the tool. Configuration file
  35. should include the predefined set of XML sections and tags. Use swi_config_sample.xml file
  36. (from the distributable package) as a 'configration file description'
  37. and create new configs using this file as a baseline. The sample explains every
  38. section in details and gives several usage examples.
  39. =back
  40. =head1 ENVIRONMENT
  41. The tool requires Perl Runtime Environment. Required Perl version is 5.6.x or later.
  42. =head1 INSTALLATION
  43. In order to install the distributive, unpack the distributable package to some folder.
  44. Software Index has internal tool (dupindex) which should be compiled for the target platform.
  45. By default, the distributable archive includes the compiled binary for PC Windows platform.
  46. Recompile it if you need (only one file dupindex.cpp), using g++ or some other C++ compiler.
  47. There is a project configuration file for users of Microsoft Visual Studio 2008.
  48. =head1 COPYRIGHT
  49. Software Index, Copyright 2009, 2010, Software Index Project Team,
  50. Link: http://swi.sourceforge.net
  51. =head1 LICENSE
  52. Software Index is free software: you can redistribute it and/or modify
  53. it under the terms of the GNU General Public License as published by
  54. the Free Software Foundation, version 3 of the License.
  55. Software Index is distributed in the hope that it will be useful,
  56. but WITHOUT ANY WARRANTY; without even the implied warranty of
  57. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  58. GNU General Public License for more details.
  59. You should have received a copy of the GNU General Public License
  60. along with Software Index. If not, see <http://www.gnu.org/licenses/>.
  61. =cut
  62. use strict;
  63. use Cwd qw(abs_path);
  64. use Pod::Usage;
  65. $0 =~ m/(.*)swi_main.pl$/;
  66. my $globalRootDirectory = abs_path($1);
  67. push(@INC, "$globalRootDirectory/lib");
  68. require SWI::Launcher;
  69. if (!defined($ARGV[0]) || $ARGV[0] eq "-help" || $ARGV[0] eq "--help" || $ARGV[0] eq "-h")
  70. {
  71. pod2usage(-exitstatus => 0, -verbose => 2);
  72. }
  73. exit swiLaunch($globalRootDirectory, @ARGV);