Show
Ignore:
Timestamp:
11.03.2013 19:03:04 (7 years ago)
Author:
ak19
Message:

1. Bringing Windows script generate-html.bat up to speed with changes to Linux script generate-html.sh that were made in revision 25767. 2. Tested on Windows: important changes to both scripts as well as Dictionary.java to get the tutorials generated when using a GS3 installation (when a gs3-setup file is sourced).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • documentation/trunk/tutorials/generate-html.bat

    r25472 r27035  
    99goto exit 
    1010 
     11:generate: 
    1112setlocal 
    12  
    1313set top_dir=%CD% 
    1414set source_dir=%CD%\xml-source 
    1515set processing_dir=%CD%\processing 
    1616set output_dir=%CD%\html 
    17 :generate: 
    18 if not exist "%output_dir" mkdir %output_dir% 
     17set tmp_dir=%CD%\tmp 
     18if not exist "%output_dir%" mkdir %output_dir% 
     19if not exist "%tmp_dir%" mkdir %tmp_dir% 
    1920cd .. 
    2021cd shared 
     
    2324 
    2425 
    25 set CLASSPATH=%shared_dir%;%GSDLHOME%\gli;%GSDLHOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar 
     26set GSDL_OR_GSDL3SRC_HOME=%GSDLHOME% 
     27:: this environment variable varies for GS3, where GLI is located in GSDL3SRCHOME (GS3) and not in GSDLHOME (gs2build) 
     28if not "%GSDL3SRCHOME%" == "" if exist "%GSDL3SRCHOME%" (    
     29    set GSDL_OR_GSDL3SRC_HOME=%GSDL3SRCHOME% 
     30) 
    2631 
     32set CLASSPATH=%shared_dir%;%GSDLHOME%\gli;%GSDL_OR_GSDL3SRC_HOME%\gli\classes;%GSDLHOME%\perllib;%shared_dir%\xalan.jar 
     33 
     34:: preprocess-tut-xml.xsl removes all the non-matching MajorVersion tags first 
     35:: This needs to be done in a separate pass, to ensure NumberedItems nested in   
     36:: MajorVersion tags preserve their numbering.  
    2737echo "processing top level index" 
    28  
    29 java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT "en" "%processing_dir%\xml-to-top-index.xsl"  "%source_dir%\tutorial_en.xml" %* > "%output_dir%\index.html" 
     38java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT "en" "%processing_dir%\preprocess-tut-xml.xsl"  "%source_dir%\tutorial_en.xml" %* > "%tmp_dir%\tutorial_en.xml" 
     39java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT "en" "%processing_dir%\xml-to-top-index.xsl"  "%tmp_dir%\tutorial_en.xml" %* > "%output_dir%\index.html" 
    3040 
    3141echo "generating wiki index page" 
    32 java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT "en" "%processing_dir%\xml-to-wiki-index.xsl" "%source_dir%\tutorial_en.xml" %* > "%output_dir%\wiki-index.txt" 
     42java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT "en" "%processing_dir%\xml-to-wiki-index.xsl" "%tmp_dir%\tutorial_en.xml" %* > "%output_dir%\wiki-index.txt" 
    3343 
    3444 
    3545for %%G IN (en,fr,ru,es) do ( 
    36 if not exist "html\%%G" mkdir html\%%G 
     46if not exist "%output_dir%\%%G" mkdir "%output_dir%\%%G" 
    3747 
    38 echo "procesing %%G version" 
     48echo "processing %%G version" 
    3949cd %output_dir%\%%G 
    40 java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-index.xsl" "%source_dir%\tutorial_%%G.xml" %* > "index.html" 
    41 java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-one-html.xsl" "%source_dir%\tutorial_%%G.xml" %* > "all_tutorials.html" 
    42 java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-many-html.xsl" "%source_dir%\tutorial_%%G.xml" %* | perl -S "%GSDLHOME%\gli\help\splithelpdocument.pl" 
     50 
     51if not "%%G" == "en" java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT %%G "%processing_dir%\preprocess-tut-xml.xsl" "%source_dir%\tutorial_%%G.xml" %* > "%tmp_dir%\tutorial_%%G.xml" 
     52 
     53java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-index.xsl" "%tmp_dir%\tutorial_%%G.xml" %* > "index.html" 
     54java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-one-html.xsl" "%tmp_dir%\tutorial_%%G.xml" %* > "all_tutorials.html" 
     55java -cp "%CLASSPATH%" -DGSDLHOME="%GSDLHOME%" -DGSDL3SRCHOME="%GSDL3SRCHOME%" ApplyXSLT %%G "%processing_dir%\xml-to-many-html.xsl" "%tmp_dir%\tutorial_%%G.xml" %* | perl -S "%GSDL_OR_GSDL3SRC_HOME%\gli\help\splithelpdocument.pl" 
    4356cd .. 
    4457)