1    /* 
     2     *Copyright (c) 2008 Texas Instruments and others.
     3     *  All rights reserved. This program and the accompanying materials
     4     *  are made available under the terms of the Eclipse Public License v1.0
     5     *  which accompanies this distribution, and is available at
     6     *  http://www.eclipse.org/legal/epl-v10.html
     7     * 
     8     *  Contributors:
     9     *      Texas Instruments - initial implementation
    10     *
    11     * */
    12    /*!
    13     *  ======== Main.xdc ========
    14     *  Check compatibility of specified packages
    15     *
    16     *  This tools scans the specified repositories looking for package
    17     *  incompatibilities.
    18     *
    19     *  By default, if a package appears in more than one repository, only the
    20     *  package in the first repository is added to the set of packages to check.
    21     *  This allows one to check the consistency of all packages that can be found
    22     *  along a specified package path by simply listing the package path
    23     *  repositories on the command line.
    24     *
    25     *  This tool performs the following checks:
    26     *  @p(blist)
    27     *      - the latest version of each target used by any package is compatible
    28     *        with all other versions used; and
    29     *      - the "built-with" versions of all packages are compatible with the
    30     *        versions of the packages contained in the specified repositories
    31     *  @p
    32     *
    33     *  If no repositories are specified, the repositories named in the current
    34     *  package path are checked.
    35     */
    36    metaonly module Main inherits xdc.tools.ICmd {
    37    
    38        /*!
    39         *  ======== usage ========
    40         *  Usage message
    41         */
    42        override config String usage[] = [
    43            '[-[ax]] [-v] [-t target] [-e exclude_pattern] [-H header] [repository ...]',
    44        ];
    45    
    46        /*!
    47         *  ======== Results ========
    48         *  XML output format
    49         *
    50         *  This structure defines the "schema" for the XML output.
    51         */
    52        @XmlDtd
    53        struct Results {
    54            String header;      /*! user specified header */
    55            String errors[];    /*! array of all errors detected */
    56            String warnings[];  /*! array of all warnings detected */
    57            Target targets[];
    58        }
    59        struct Target {
    60            String name;            /*! target name */
    61            struct {
    62                String key;         /*! target compatibility key used */
    63                String packages[];  /*! all packages using target with this key */
    64            } keys[];
    65        }
    66    
    67    instance:
    68    
    69        /*!
    70         *  ======== arrFlag ========
    71         *  Return an array of strings
    72         */
    73        @CommandOption('a')
    74        config Bool arrFlag = false;
    75    
    76        /*!
    77         *  ======== verboseFlag ========
    78         *  Print informative messages during execution
    79         */
    80        @CommandOption('v')
    81        config Bool verboseFlag = false;
    82    
    83        /*!
    84         *  ======== xmlFlag ========
    85         *  Return a Results struct as XML
    86         */
    87        @CommandOption('x')
    88        config Bool xmlFlag = false;
    89    
    90        /*!
    91         *  ======== header ========
    92         *  Prepend Header label to output
    93         */
    94        @CommandOption('H')
    95        config String header = null;
    96    
    97        /*!
    98         *  ======== exclude ========
    99         *  Exclude packages or targets from checks
   100         *
   101         *  Do not check compatibility of packages or targets whose names match
   102         *  the regular expression `exclude`.
   103         */
   104        @CommandOption('e')
   105        config String exclude = null;
   106    
   107        /*!
   108         *  ======== multipleFlag ========
   109         *  Allow checking multiple versions of the same package
   110         *
   111         *  By default, when a package appears in more than repository named on
   112         *  the command line, this tool only checks the first occurance
   113         *  of the package.  Setting this option forces all versions of all
   114         *  packages in the specified repositories to be included in the checks.
   115         */
   116        @CommandOption('m')
   117        config Bool multipleFlag = false;
   118    
   119        /*!
   120         *  ======== target ========
   121         *  Target to check
   122         *
   123         *  During the compatibility checks this tool ensures that for all
   124         *  targets used by all packages are compatible with the latest target
   125         *  referenced by any package.  If this option is set, the check tool
   126         *  will only validate compatibility for the specified target.  In
   127         *  addition, if the target string contains a target compatibility key,
   128         *  all packages that reference the target will be checked for
   129         *  compatibility with the specified key.
   130         *
   131         *  The format of this string is either
   132         *  @p(code)
   133         *      <target_name>:<target_key>
   134         *  @p
   135         *  or 
   136         *  @p(code)
   137         *      <target_name>
   138         *  @p
   139         *  where `<target_name>` is the full name of a target and `<target_key>`
   140         *  is an optional target-specific compatibility key.  The optional
   141         *  target compatibility key can be used to validate the set of packages
   142         *  against a specific compiler tool chain.
   143         */
   144        @CommandOption('t')
   145        config String target = null;
   146    }
   147    /*
   148     *  @(#) xdc.tools.check; 1, 0, 0,192; 8-17-2010 16:37:35; /db/ztree/library/trees/xdctools/xdctools-d43x/src/
   149     */
   150