releasing/cbrtools/perl/BldDocs
author Zheng Shen <zheng.shen@nokia.com>
Tue, 20 Jul 2010 15:02:28 +0800
changeset 617 3a747a240983
parent 602 3145852acc89
permissions -rw-r--r--
ROM Tools 12.2.0.4 Postlinker 2.2.5 Revert package_definition.xml to changeset 360bd6b35136
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
602
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     1
#!perl
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     2
# Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     3
# All rights reserved.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     4
# This component and the accompanying materials are made available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     6
# which accompanies this distribution, and is available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     8
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     9
# Initial Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    11
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    12
# Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    13
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    14
# Description:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    15
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    16
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    17
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    18
use strict;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    19
use CGI qw(:standard);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    20
use FindBin;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    21
use lib "$FindBin::Bin";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    22
use Utils;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    23
use Cwd;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    24
use File::Basename;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    25
use Pod::Html;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    26
use Getopt::Long;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    27
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    28
$|++;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    29
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    30
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    31
# Constants.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    32
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    33
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    34
my $KDocDir = "..\\doc";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    35
my @intro = ({fileName => "HistoricPerspective",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    36
	      caption => "Historic Perspective",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    37
	      comment => ""},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    38
#	     {fileName => "Environment",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    39
#	      caption => "Licensee Product Environment",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    40
#	      comment => ""},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    41
	     {fileName => "QuickStart",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    42
	      caption => "Quick Start",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    43
	      comment => ""},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    44
	     {fileName => "MakingReleases",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    45
	      caption => "Making Releases",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    46
	      comment => ""},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    47
	     {fileName => "Installation",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    48
	      caption => "Installation Guide",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    49
	      comment => ""},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    50
	     {fileName => "ExportingReleases",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    51
	      caption => "Exporting and Importing Releases",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    52
	      comment => ""},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    53
	     {fileName => "FurtherInformation",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    54
	      caption => "Further Information",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    55
	      comment => ""},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    56
	     {fileName => "Optimisation",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    57
	      caption => "Optimisation",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    58
	      comment => ""},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    59
	     {fileName => "FAQ",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    60
	      caption => "Frequently Asked Questions",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    61
	      comment => ""});
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    62
my @commands = ({fileName => "BinInfo"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    63
		{fileName => "BuildRel"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    64
		{fileName => "CleanEnv"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    65
		{fileName => "CleanLocalArch"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    66
		{fileName => "CleanRemote"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    67
		{fileName => "CopyRel"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    68
		{fileName => "DeltaEnv"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    69
		{fileName => "DiffEnv"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    70
		{fileName => "DiffRel"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    71
		{fileName => "EnvInfo"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    72
		{fileName => "ExportEnv"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    73
		{fileName => "ExportRel"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    74
		{fileName => "EnvMembership"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    75
		{fileName => "EnvSize"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    76
		{fileName => "GetEnv"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    77
		{fileName => "GetRel"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    78
		{fileName => "GetSource"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    79
		{fileName => "ImportEnv"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    80
		{fileName => "ImportRel"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    81
		{fileName => "InstallSnapShot"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    82
		{fileName => "LatestVer"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    83
		{fileName => "ListComponents"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    84
		{fileName => "MakeEnv"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    85
		{fileName => "MakeRel"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    86
		{fileName => "MakeSnapShot"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    87
		{fileName => "ModNotes"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    88
		{fileName => "MrpComplexity"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    89
		{fileName => "RemoveRel"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    90
		{fileName => "RemoveSource"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    91
		{fileName => "SourceInfo"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    92
		{fileName => "PrepEnv"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    93
		{fileName => "PrepRel"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    94
		{fileName => "PullEnv"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    95
		{fileName => "PushEnv"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    96
		{fileName => "PullRel"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    97
		{fileName => "PushRel"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    98
		{fileName => "ValidateEnv"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    99
		{fileName => "ValidateRel"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   100
		{fileName => "ViewNotes"});
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   101
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   102
my @utils =({fileName => "BldDocs"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   103
	    {fileName => "CheckBc"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   104
	    {fileName => "CheckRls"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   105
	    {fileName => "InstCol2"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   106
	    {fileName => "MBld"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   107
	    {fileName => "MergeEnvironments"});
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   108
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   109
my @modules =({fileName => "CatData.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   110
	      {fileName => "CheckBc.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   111
	      {fileName => "CleanEnv.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   112
	      {fileName => "Cleaner.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   113
	      {fileName => "CommandController.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   114
	      {fileName => "CopyRel.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   115
	      {fileName => "Crypt.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   116
	      {fileName => "Crypt/GPG.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   117
	      {fileName => "Crypt/PGP.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   118
	      {fileName => "EnvDb.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   119
	      {fileName => "EnvDifferencer.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   120
	      {fileName => "ExportData.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   121
	      {fileName => "GetEnv.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   122
	      {fileName => "IniData.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   123
	      {fileName => "MakeRel.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   124
	      {fileName => "MrpData.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   125
	      {fileName => "NotesCompiler.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   126
	      {fileName => "PathData.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   127
	      {fileName => "PathData/ComponentBased.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   128
	      {fileName => "PathData/ProjectBased.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   129
	      {fileName => "PrepRel.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   130
	      {fileName => "RelData.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   131
	      {fileName => "RelTransfer.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   132
	      {fileName => "RelTransfer/Export.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   133
	      {fileName => "RelTransfer/Import.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   134
	      {fileName => "RemoteSite.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   135
	      {fileName => "RemoteSite/FTP.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   136
	      {fileName => "RemoteSite/FTP/Proxy.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   137
	      {fileName => "RemoteSite/NetDrive.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   138
	      {fileName => "RemoteSite/NetDrive/MultiVolumeExport.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   139
	      {fileName => "RemoteSite/NetDrive/MultiVolumeImport.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   140
	      {fileName => "Symbian/CBR/ApplyDelta.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   141
	      {fileName => "Symbian/CBR/CreateDelta.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   142
	      {fileName => "TableFormatter.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   143
	      {fileName => "TableFormatter/Text.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   144
	      {fileName => "TableFormatter/Excel.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   145
	      {fileName => "TableFormatter/Csv.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   146
	      {fileName => "TableFormatter/Html.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   147
	      {fileName => "TableFormatter/Auto.pm"},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   148
	      {fileName => "Utils.pm"}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   149
	     );
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   150
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   151
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   152
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   153
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   154
# Globals.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   155
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   156
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   157
my $docDir;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   158
my $devDocs = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   159
my $verbose = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   160
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   161
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   162
# Main.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   163
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   164
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   165
ProcessCommandLine();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   166
my $cwd = cwd;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   167
my $toolsdir = $FindBin::Bin;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   168
chdir $toolsdir or die "Error: Couldn't chdir to \"$toolsdir\": $!\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   169
ReadCaptions(\@commands);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   170
ReadCaptions(\@utils);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   171
ReadCaptions(\@modules);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   172
chdir $cwd or die "Error: Couldn't chdir to \"cwd\": $!\n";;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   173
Utils::MakeDir($docDir);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   174
chdir $docDir or die "Error: Couldn't chdir to \"$docDir\": $!\n";;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   175
BldIndex();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   176
BldDocs();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   177
chdir $cwd or die "Error: Couldn't chdir to \"cwd\": $!\n";;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   178
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   179
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   180
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   181
# Subs.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   182
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   183
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   184
sub ProcessCommandLine {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   185
  Getopt::Long::Configure ("bundling");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   186
  my $help;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   187
  GetOptions('h' => \$help, 'd' => \$devDocs, 'v+' => \$verbose);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   188
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   189
  $docDir = shift @ARGV || $KDocDir;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   190
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   191
  unless (scalar(@ARGV) == 0) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   192
    print "Error: Invalid arguments\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   193
    Usage(1);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   194
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   195
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   196
  if ($help) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   197
    Usage(0);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   198
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   199
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   200
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   201
sub Usage {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   202
  my $exitCode = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   203
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   204
  Utils::PrintDeathMessage($exitCode, "\nUsage: blddocs [<documentation_directory>]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   205
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   206
options:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   207
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   208
-h  help
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   209
-d  generate additional documentation relevent to development of the tools
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   210
-v  verbose output (-vv very verbose)\n");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   211
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   212
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   213
sub BldIndex {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   214
  print "Generating index.html...\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   215
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   216
  open INDEX, ">index.html" or die "Couldn't open index.html for writing: $!\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   217
  $CGI::NO_DEBUG = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   218
  $CGI::NO_DEBUG = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   219
  my $cgi = new CGI;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   220
  print INDEX $cgi->start_html("LPD Release Tools Documentation");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   221
  print INDEX $cgi->h1("LPD Release Tools Documentation");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   222
  my $version = Utils::ToolsVersion();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   223
  print INDEX $cgi->h3("Version $version\n");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   224
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   225
  AddSection("Introduction", \@intro, *INDEX, $cgi);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   226
  AddSection("Command reference", \@commands, *INDEX, $cgi);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   227
  AddSection("Utilities", \@utils, *INDEX, $cgi);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   228
  AddSection("Implementation notes", \@modules, *INDEX, $cgi) if ($devDocs);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   229
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   230
  print INDEX $cgi->hr;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   231
  print INDEX $cgi->end_html();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   232
  close INDEX;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   233
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   234
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   235
sub ReadCaptions {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   236
  my $list = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   237
  foreach my $module (@$list) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   238
    open (FILE, $module->{fileName}) or die "Error: Couldn't open $module->{fileName} for reading: $!\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   239
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   240
    # Search through file for name section.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   241
    while (<FILE>) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   242
      if (/^=head1 NAME/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   243
	last;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   244
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   245
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   246
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   247
    # Read name section.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   248
    while (<FILE>) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   249
      unless (/^\s*$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   250
	(my $caption, my $comment) = split (/ - /, $_, 2);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   251
	die unless defined $caption and defined $comment;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   252
	$module->{caption} = $caption;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   253
	$module->{comment} = " - $comment";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   254
	last;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   255
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   256
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   257
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   258
    unless (exists $module->{caption}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   259
      $module->{caption} = "";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   260
      $module->{comment} = "";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   261
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   262
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   263
    close (FILE);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   264
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   265
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   266
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   267
sub AddSection {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   268
  my $heading = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   269
  my $list = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   270
  local *INDEX = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   271
  my $cgi = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   272
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   273
  print INDEX $cgi->hr;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   274
  print INDEX $cgi->h2($heading);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   275
  foreach my $module (@$list) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   276
    print INDEX $cgi->a({ -href => "$module->{fileName}.html" }, $module->{caption}), $module->{comment};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   277
    print INDEX $cgi->p("");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   278
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   279
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   280
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   281
sub BldDocs {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   282
  BldList(\@intro);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   283
  BldList(\@commands);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   284
  BldList(\@utils);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   285
  BldList(\@modules) if ($devDocs);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   286
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   287
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   288
sub BldList {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   289
  my $listRef = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   290
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   291
  foreach my $item (@$listRef) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   292
    my $itemMTime = Utils::FileModifiedTime("$toolsdir\\$item->{fileName}");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   293
    if ($itemMTime == 0 or not -e "$item->{fileName}.html" or $itemMTime > Utils::FileModifiedTime("$item->{fileName}.html")) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   294
      my $dirName = dirname($item->{fileName});
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   295
      unless (-e $dirName) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   296
        eval {Utils::MakeDir($dirName)};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   297
        if ($@) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   298
          die "Error: Couldn't make directory $docDir/$dirName : $@\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   299
        }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   300
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   301
      print "Generating $item->{fileName}.html...\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   302
      pod2html("--infile=$toolsdir\\$item->{fileName}", "--outfile=$item->{fileName}.html", "--title=$item->{fileName}");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   303
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   304
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   305
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   306
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   307
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   308
=head1 NAME
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   309
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   310
BldDocs - Builds this HTML documentation set from the POD in the Perl sources.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   311
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   312
=head1 SYNOPSIS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   313
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   314
  blddocs [<documentation_directory>]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   315
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   316
options:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   317
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   318
  -h  help
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   319
  -d  generate additional documentation relevent to development of the tools
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   320
  -v  verbose output (-vv very verbose)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   321
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   322
=head1 DESCRIPTION
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   323
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   324
Invokes C<pod2html> on each source file, and puts all the generated documentation files into a F<doc> directory. On subsequent calls only generates new html for source files that have been modified. Also generates the file F<doc\index.html> which contains a set of links to the other documentation files.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   325
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   326
=head1 KNOWN BUGS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   327
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   328
None.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   329
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   330
=head1 COPYRIGHT
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   331
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   332
 Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   333
 All rights reserved.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   334
 This component and the accompanying materials are made available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   335
 under the terms of the License "Eclipse Public License v1.0"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   336
 which accompanies this distribution, and is available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   337
 at the URL "http://www.eclipse.org/legal/epl-v10.html".
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   338
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   339
 Initial Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   340
 Nokia Corporation - initial contribution.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   341
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   342
 Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   343
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   344
 Description:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   345
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   346
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   347
=cut