Changeset 3460 for SMC


Ignore:
Timestamp:
08/22/13 15:26:57 (11 years ago)
Author:
vronk
Message:

reworked the build, removed absolute paths, introduced a props-file;
renamed all *cmd-dep-graph* to *smc-graph*

Location:
SMC/trunk/SMC
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • SMC/trunk/SMC/build.xml

    r2237 r3460  
    55     Date:     2011-10     
    66     Project:  SMC
    7      (based on Bruce Phillips: Coding_Actions_Struts2_Ant)
    87     ====================================================================== -->
    98
     
    1817        <property file="build.properties"/>
    1918   
    20 
     19  <import file="build_init.xml" />   
    2120       
    2221        <!-- ==================== Clean Target ==================================== -->
  • SMC/trunk/SMC/build_init.xml

    r2481 r3460  
    44<!-- ======================================================================
    55     Date:     2011-10     
    6      Project:  SMC
    7      (based on Bruce Phillips: Coding_Actions_Struts2_Ant)
     6     Project:  SMC     
    87     ====================================================================== -->
    9 
    10 
    118       
    129<project name="SMC init" default="init" basedir=".">
    1310       
    1411    <description>
    15            targets for initializing the SMC-module - i.e. fetching the source data
     12           targets for
     13           a) initializing the SMC-module, i.e. fetching the source data (init-data)
     14           b) generating the output data (graph and statistics) (gen-out)
     15           c) and for generating documentation for the code (gen-docs)
    1616    </description>
    17        
    18  
    19        
    20         <property name="cache.dir" value="data2" />
    21         <property name="out.dir" value="output" />
     17
     18        <property file="build_init.props"></property>
     19       
     20        <property name="scripts.dir" value="." />
     21        <property name="cache.dir" value="data" />
     22        <property name="out.dir" value="output" />     
     23        <property name="docs.dir" value="docs" />
    2224        <property name="smc.config" value="src/smc_config.xml" />
    2325        <property name="xsl.dir" value="src/xsl/" />
    24        
    25        
    26         <property name="scripts.dir" location="C:\Users\m\3\7utils"/>
     26        <property name="dataset.xsl.dir" value="src/xsl/dataset" />
    2727 
    28  <import file="${scripts.dir}\build.xml" />   
    29 
    30 <target name="gen-build-info" >
    31         <ant antfile="${scripts.dir}\build.xml" target="gen-build-info">
    32                 <property name="in.dir" location="" />
    33                 <property name="other.build" value="build_init"/>
    34                 <property name="out.dir" location="docs"/>
    35         </ant>
    36 </target>
    37 
    38 
    39         <target name="gen-docs" >
    40                 <ant antfile="${scripts.dir}\build_docs.xml" target="gen-jsdoc">
    41                         <!-- src/web/scripts/js/cmd-dep-graph.js   -->
    42                         <property name="src.dir" location="src/web/scripts/js/cmd-dep-graph.js" />
    43                         <property name="docs.dir" location="docs/jsdocs/"/>
    44                 </ant>         
    45         </target>
    46                
    47                
    48         <target name="gen-userdocs" >
    49                 <ant antfile="${scripts.dir}\build_docs.xml" target="rst2html">
    50                         <!-- src/web/scripts/js/cmd-dep-graph.js   -->
    51                         <property name="src.file" location="docs/userdocs.rst" />
    52                         <property name="out.file" location="docs/userdocs.html/"/>
    53                         <property name="stylesheet" value="scripts/css/cmds-ui.css"/>
    54                 </ant>         
    55         </target>
    56                
     28 
     29        <import file="${scripts.dir}\build_defs.xml" />
     30
     31
     32        <target name="check" description="just for debugging, to check the acutal values of properties">
     33                <echoproperties regex=".*\.dir"></echoproperties>
     34<!--            <echoproperties srcfile="${scripts.dir}\build_defs.props" /> -->
     35                <echo message="${saxon-libs.dir}" />
     36        </target>       
    5737
    5838        <target name="init-data" description="run sequentially the initialization steps">
    5939                <mkdir dir="${cache.dir}" />
    6040               
    61                 <property name="init-sequence" value="cmd-profiles-raw,cmd-terms,cmd-terms-nested,dcr-terms,isocat-languages,termsets,dcr-cmd-map,rr-relations,rr-terms" ></property>
     41                <property name="init-sequence" value="cmd-profiles-raw,load-profiles,cmd-terms,cmd-terms-nested,dcr-terms,isocat-languages,termsets,dcr-cmd-map,rr-relations,rr-terms" ></property>
    6242<!--            <property name="init-sequence" value="cmd-profiles-raw,cmd-terms" ></property>-->
    6343                <foreach list="${init-sequence}" target="init-step" param="dataset.key" />
     
    7757        -->
    7858        <target name="init-step" description="one initialization steps - parametrized with dataset.key">
    79                                
     59<!--     not used                       
     60                <property name="cache.dir.resolved" location="${cache.dir}" ></property>
     61                <propertyregex property="cache.uri" input="${cache.dir.resolved}" regexp="\\"                   
     62                        replace="/"                     defaultvalue="${cache.dir}"  override="true"/>
     63-->             
    8064                <echo message="generating: ${dataset.key}" />
    81                 <saxon-xslt style="${xsl.dir}smc_init.xsl" in="${smc.config}"
     65                <xslt style="${xsl.dir}smc_init.xsl" in="${smc.config}"
    8266                        out="${cache.dir}/${dataset.key}.xml" >
    8367                        <param name="data_key" expression="${dataset.key}"/>                   
    8468                        <param name="cache" expression="use"/>                 
    85                         <param name="cache_dir" expression="../../${cache.dir}"/>
     69                        <!-- cache.dir is used relative to the main-input document (which is src/smc_config.xml) -->
     70                        <param name="cache_dir" expression="../${cache.dir}"/>
    8671                        <!-- <sysproperty key="ANT_OPTS"
    8772                 value="-Xmx512m"
    8873     />-->
    89                 </saxon-xslt>                                           
     74                        <factory name="net.sf.saxon.TransformerFactoryImpl"/>
     75                        <classpath refid="saxon-lib" />
     76                </xslt>                                         
    9077               
    9178        </target>
     
    9481
    9582        <target name="gen-out" description="generate various views on the data"
    96                 depends="init-out,smc-stats,smc-stats2,gen-cmd-dep-graph" >
     83                depends="init-out,smc-stats,gen-smc-graph,render-profiles" >
    9784               
    9885        </target>
     
    10491                        <fileset dir="src/web" />
    10592                        <fileset file="docs/userdocs.html" />
     93                        <fileset file="docs/examples.html" />
    10694                        <fileset file="docs/graph_legend.svg" />
    10795                </copy>
    108         </target>
    109                
    110         <target name="smc-stats" description="generate statistics - old - obsoleting by smc-stats2">
    111                
    112                 <saxon-xslt style="${xsl.dir}smc_stats.xsl" in="${cache.dir}/dcr-cmd-map.xml"
    113                         out="${out.dir}/smc_stats.html" force="true">                                           
    114                         <param name="cache" expression="use"/>                 
     96                <copy todir="${out.dir}/examples">
     97                        <fileset dir="docs/examples" />
     98                </copy>
     99        </target>
     100       
     101        <target name="render-profiles" description="generate html-views for profiles, expects loaded profiles"
     102                        >
     103               
     104                <!--<saxon-xslt style="${xsl.dir}comp2view.xsl" basedir="${cache.dir}/profiles"
     105                        destdir="${out.dir}/profiles" force="true">
    115106                        <param name="format" expression="htmlpage"/>
    116                         <param name="cache_dir" expression="../../${cache.dir}"/>
    117                 </saxon-xslt>                                           
    118                
    119         </target>
    120        
    121         <target name="smc-stats2" description="generate statistics (via dataset-xml)">
     107                </saxon-xslt>-->       
     108               
     109                <xslt
     110                        style="${xsl.dir}comp2view.xsl" basedir="${cache.dir}/profiles" includes="*.xml"
     111                        destdir="${out.dir}/profiles" extension=".html"
     112                        processor="trax" force="true">
     113                        <!-- with force="true"  and no includes an error comes:
     114                             [xslt] : Fatal Error! Cannot write more than one result document to the sam
     115e URI, or write to a URI that has been read: file:/C:/Users/m/3/clarin/_repo/SMC
     116/output_20130126/profiles/clarin_eucr1p_1271859438161.html
     117     [xslt] Failed to process null
     118                        -->
     119                        <factory name="net.sf.saxon.TransformerFactoryImpl"/>
     120                        <classpath refid="saxon-lib" />
     121                       
     122                        <param name="scripts_url" expression="../scripts"/>
     123                        <param name="format" expression="htmlpage"/>
     124                </xslt> 
     125               
     126        </target>
     127       
     128        <target name="smc-stats" description="generate statistics (via dataset-xml)">
    122129               
    123130                <saxon-xslt style="${xsl.dir}smc2stats_datasets.xsl" in="${cache.dir}/dcr-cmd-map.xml"
    124131                        out="${out.dir}/smc_stats_dataset.xml" force="true">                                           
    125132                        <param name="cache" expression="use"/>                 
    126                         <param name="cache_dir" expression="../../${cache.dir}"/>
     133                        <param name="cache_dir" expression="../${cache.dir}"/>
    127134                </saxon-xslt>                                           
    128135               
    129                 <property name="amc.xsl.dir" value="C:/Users/m/3/corpus_shell/_repo/corpus_shell/xsl/amc" />
    130                 <saxon-xslt style="${amc.xsl.dir}/dataset2html.xsl" in="${out.dir}/smc_stats_dataset.xml"
     136                <saxon-xslt style="${dataset.xsl.dir}/dataset2html.xsl" in="${out.dir}/smc_stats_dataset.xml"
    131137                        out="${out.dir}/smc_stats_detail.html" force="true">                                           
    132138                        <param name="format" expression="html"/>
     
    135141               
    136142               
    137                 <saxon-xslt style="${amc.xsl.dir}/dataset2html.xsl" in="${out.dir}/smc_stats_dataset.xml"
     143                <saxon-xslt style="${dataset.xsl.dir}/dataset2html.xsl" in="${out.dir}/smc_stats_dataset.xml"
    138144                        out="${out.dir}/smc_stats.html" force="true">                                           
    139145                        <param name="format" expression="htmlpage"/>
     146                        <param name="scripts_url" expression="scripts"/>
    140147                        <param name="mode" expression=""/>
    141148                </saxon-xslt>                                           
     
    143150        </target>
    144151       
    145         <target name="gen-cmd-dep-graph" description="generate graph of component dependencies (dot/svg/json)"         
    146                 depends="gen-cmd-dep-graph-dot,gen-cmd-dep-graph-json"
     152        <target name="gen-smc-graph" description="generate graph of component dependencies and concept links (dot/svg/json)"           
     153                depends="gen-smc-graph-dot,gen-smc-graph-json"
    147154                />             
    148155               
    149                 <target name="gen-cmd-dep-graph-xml" description="generate graph of component dependencies (internal xml-format)"               >               
    150                         <saxon-xslt style="${xsl.dir}cmd2graph.xsl" in="${cache.dir}/cmd-terms-nested.xml"
    151                                 out="${out.dir}/cmd-dep-graph.xml" >
     156                <target name="gen-smc-graph-xml" description="generate graph of component dependencies (internal xml-format)"           >               
     157                        <saxon-xslt style="${xsl.dir}terms2graph.xsl" in="${cache.dir}/cmd-terms-nested.xml"
     158                                out="${out.dir}/smc-graph.xml" >
    152159                        </saxon-xslt>                                           
    153160                </target>
    154                
    155                 <target name="gen-cmd-dep-graph-dot" description="generate dot-graph of component dependencies (dot/svg)"
    156                         depends="gen-cmd-dep-graph-xml"         >               
     161
     162                <target name="gen-mdrepo-graph-xml" description="generate graph of mdrepo-stats (internal xml-format)"          >               
     163                        <saxon-xslt style="${xsl.dir}terms2graph.xsl" in="${cache.dir}/mdrepo-stats.xml"
     164                                out="${out.dir}/mdrepo-graph.xml" force="true" >
     165                        </saxon-xslt>                                           
     166                </target>
     167               
     168                <target name="gen-smc-graph-dot" description="generate dot-graph of component dependencies (dot/svg)"
     169                        depends="gen-smc-graph-xml"             >               
    157170                               
    158                                         <saxon-xslt style="${xsl.dir}graph2dot.xsl" in="${out.dir}/cmd-dep-graph.xml"
    159                                                 out="${out.dir}/cmd-dep-graph.dot" >
     171                                        <saxon-xslt style="${xsl.dir}graph2dot.xsl" in="${out.dir}/smc-graph.xml"
     172                                                out="${out.dir}/smc-graph.dot" >
    160173                                        </saxon-xslt>                                           
    161174                               
    162175                                <exec executable="dot">                                                 
    163                                         <arg value="${out.dir}/cmd-dep-graph.dot" />
    164                                         <arg value="-o${out.dir}/cmd-dep-graph.svg"/>
     176                                        <arg value="${out.dir}/smc-graph.dot" />
     177                                        <arg value="-o${out.dir}/smc-graph.svg"/>
    165178                                        <arg value="-Tsvg"/>
    166179                                </exec>                 
    167180                </target>
    168181               
    169         <target name="gen-cmd-dep-graph-json" description="generate dot-graph of component dependencies (json-d3)"
    170                         depends="gen-cmd-dep-graph-xml"         >               
    171                
    172                         <saxon-xslt style="${xsl.dir}graph2json-d3.xsl" in="${out.dir}/cmd-dep-graph.xml"
    173                                 out="${out.dir}/cmd-dep-graph.d3.js" force="true">
     182        <target name="gen-smc-graph-json" description="generate dot-graph of component dependencies (json-d3)"
     183                        depends="gen-smc-graph-xml"             >               
     184               
     185                        <saxon-xslt style="${xsl.dir}graph2json-d3.xsl" in="${out.dir}/smc-graph.xml"
     186                                out="${out.dir}/smc-graph.d3.js" force="true">
    174187                        </saxon-xslt>                                           
    175188                       
     
    177190       
    178191       
    179         <!--
    180         OBSOLETED by: gen-cmd-dep-graph-json <- gen-cmd-dep-graph-xml
    181        
    182         <target name="gen-cmd-dep-graph-json-d3" description="generate graph of component dependencies (json/d3)"               
    183                 >               
    184                 <saxon-xslt style="${xsl.dir}cmd2graph-json-d3.xsl" in="${cache.dir}/cmd-terms-nested.xml"
    185                         out="${out.dir}/scripts/cmd-dep-graph-d3.json" force="true" >
    186                         <param name="profiles" expression="teiHeader" />
    187                 </saxon-xslt>                                           
    188        
    189         </target>                       
    190 -->
     192       
     193        <target name="gen-docs" depends="gen-build-info,gen-jsdocs,gen-xsldocs"
     194         description="generates automatic documentation for the build, js- and xsl-files">
     195        </target>
     196       
     197        <target name="gen-jsdocs" >
     198                <ant antfile="${scripts.dir}\build_docs.xml" target="gen-jsdoc">
     199                        <!-- src/web/scripts/js/smc-graph.js   -->
     200                        <property name="src.dir" location="src/web/scripts/js/smc-graph.js" />
     201                        <property name="docs.dir" location="${docs.dir}/jsdocs/"/>
     202                </ant>         
     203        </target>
     204       
     205        <target name="gen-xsldocs" >
     206                <property name="out.fn" value="smc-xsl"></property>
     207                <ant antfile="${scripts.dir}\build_docs.xml" target="ay-xsl">
     208                        <property name="in.dir" location="${xsl.dir}" />
     209                        <property name="file.prefix" value="../../src" />
     210                        <property name="title" value="smc-xsl" />
     211                        <property name="parts" value="imports, params, templates, functions" />
     212                        <property name="out.dir" location="${docs.dir}/xsltdocs"/>
     213                        <property name="out.fn" value="${out.fn}"/>
     214                       
     215                </ant>
     216                <ant antfile="${scripts.dir}\build_docs.xml" target="gen-dep-graph">
     217                        <property name="work.dir" location="${docs.dir}/xsltdocs" />
     218                        <!-- <property name="in.file" value="${out.fn}.xml"/> -->
     219                        <property name="in.file" value="${docs.dir}/xsltdocs/${out.fn}.xml"/>
     220                        <property name="title" value="smc-xsl-imports" />
     221                        <property name="parts" value="imports" />
     222                        <property name="out.fn" value="smc-xsl-imports"/>
     223                </ant>         
     224               
     225               
     226                <ant antfile="${scripts.dir}\build_docs.xml" target="gen-dep-graph-each">
     227                        <property name="in.dir" location="${xsl.dir}" />
     228                        <property name="parts" value="imports, params, templates, functions" />
     229                        <property name="work.dir" location="${docs.dir}/xsltdocs/xslts"/>                       
     230                </ant>
     231        </target>       
     232       
     233        <target name="gen-build-info" >
     234                <ant antfile="${scripts.dir}\build.xml" target="gen-build-info">
     235                        <property name="in.dir" location="" />
     236                        <property name="other.build" value="build_init"/>
     237                        <property name="out.dir" location="docs"/>
     238                </ant>
     239        </target>
     240       
     241       
     242        <target name="gen-userdocs" >
     243                <ant antfile="${scripts.dir}\build_docs.xml" target="rst2html">
     244                        <!-- src/web/scripts/js/smc-graph.js   -->
     245                        <property name="src.file" location="docs/userdocs.rst" />
     246                        <property name="out.file" location="docs/userdocs.html/"/>
     247                        <property name="stylesheet" value="scripts/style/cmds-ui.css"/>
     248                </ant>         
     249                <ant antfile="${scripts.dir}\build_docs.xml" target="rst2html">
     250                        <!-- src/web/scripts/js/smc-graph.js   -->
     251                        <property name="src.file" location="docs/examples.rst" />
     252                        <property name="out.file" location="docs/examples.html/"/>
     253                        <property name="stylesheet" value="scripts/style/cmds-ui.css"/>
     254                </ant>
     255                <ant antfile="${scripts.dir}\build_docs.xml" target="rst2html">                 
     256                        <property name="src.file" location="docs/examples2.rst" />
     257                        <property name="out.file" location="docs/examples2.html/"/>
     258                        <property name="stylesheet" value="scripts/style/cmds-ui.css"/>
     259                </ant>         
     260        </target>
     261       
    191262</project>
    192263
Note: See TracChangeset for help on using the changeset viewer.