1    /*
     2     *  Copyright 2011 by Texas Instruments Incorporated.
     3     *
     4     */
     5    
     6    /*!
     7     *  ======== Main ========
     8     *  Command-line tool for generating eclipse plugins for RTSC content
     9     *
    10     *  The `plugingen` tool allows RTSC content producers to
    11     *  create eclipse plugins that allows their content to be 
    12     *  integrated in the CCS4 environment. As input, the tool requires 
    13     *  @p(blist)
    14     *      - a RTSC module implementing {@link xdc.tools.product.IProduct}
    15     *  @p
    16     *  Refer to {@link ./doc-files/ExampleProduct.xdc ExampleProduct}
    17     *  for an implementation of {@link xdc.tools.product.IProduct IProduct}.
    18     *
    19     *  The tool may also be used to generate starter examples that will showup 
    20     *  in the new project wizard. This is accomplished by implementing
    21     *  {@link xdc.tools.product.IProductTemplate IProductTemplate} and setting
    22     *  the {@link xdc.tools.product.IProduct#templateModule templateModule} 
    23     *  configuration parameter of the {@link xdc.tools.product.IProduct IProduct} 
    24     *  implementation to the name of the implementation module. 
    25     *  Refer to {@link ./doc-files/Examples.xdc Examples}
    26     *  for a sample implementation of {@link
    27     *  xdc.tools.product.IProductTemplate IProductTemplate}.
    28     *  
    29     *  The XGCONF product view maybe developed by implementing
    30     *  {@link xdc.tools.product.IProductView IProductView} and setting
    31     *  the {@link xdc.tools.product.IProduct#productViewModule productViewModule} 
    32     *  configuration parameter of the {@link xdc.tools.product.IProduct IProduct} 
    33     *  implementation to the name of the implementation module.
    34     *  Refer to {@link ./doc-files/ProductView.xdc ProductView.xdc} and 
    35     *  {@link ./doc-files/ProductView.xs ProductView.xs}
    36     *  for a sample implementation of {@link
    37     *  xdc.tools.product.IProductView IProductView}.
    38     *
    39     *  The tool operates on a product that is either specified by the `-p`
    40     *  option or is present in the folder from which the tool is executed.
    41     *  The tool will create the plugin in a sub-folder named `eclipse`
    42     *  in the output directory specified with `-o` option. If the `-o`
    43     *  option is not specified the plugin is created in the product root
    44     *  directory. 
    45     *  The tool will search the repositories specified in the module
    46     *  implementing {@link xdc.tools.product.IProduct} for RTSC platforms.
    47     *  This search can be disabled by specifying the`--disable_repo_search` 
    48     *  option. The user needs to ensure that the repositories are installed 
    49     *  in the product root directory before using the tool.
    50     *
    51     *  @a(Example)
    52     *  @p(code)
    53     *      xs xdc.tools.product.plugingen 
    54     *                      -p exampleprod_1_0_0_00
    55     *                      -m xdc.tools.product.plugingen.examples.ExampleProduct
    56     *  @p
    57     */
    58    metaonly module Main inherits xdc.tools.ICmd
    59    {
    60        override config String usage[] = [
    61            '[-p product_root_directory]',
    62            ' -m module',
    63            '[-o outdir]',
    64            '[-f pluginFragment]',
    65            '[--suppress_product_type_info]',
    66            '[--disable_repo_search]'
    67        ];
    68    
    69    instance:
    70    
    71        /*!
    72         *  ======== productDir ========
    73         *  Product root directory
    74         *
    75         *  This option names the product root directory that is used by the 
    76         *  tool to generate the plugin. If the '-o' option is not
    77         *  specified the tool generates the plugin in a sub-directory
    78         *  called `eclipse` in the product root directory.
    79         *
    80         *  If this option is not specified, the product root directory is
    81         *  assumed to be `./`.
    82         *
    83         */
    84        @CommandOption("p")
    85        config String productDir = "./";
    86    
    87        /*!
    88         *  ======== productModule ========
    89         *  Input description of the plug-in to be specified
    90         *
    91         *  This required option names a module that implements
    92         *  `{@link xdc.tools.product.IProduct}`.
    93         *
    94         */
    95        @CommandOption("m")
    96        config String productModule;
    97    
    98        /*!
    99         *  ======== outputDir ========
   100         *  Output directory in which the plugin will be generated.
   101         *
   102         *  This option names the directory in which the plugin 
   103         *  will be generated in a sub-directory named `eclipse`.
   104         *  If this option is not specified the tool will generate
   105         *  the plugin in the product root directory specified with
   106         *  the '-p' option.
   107         *
   108         */
   109        @CommandOption("o")
   110        config String outputDir = null;
   111    
   112        /*!
   113         *  ======== pluginFragment ========
   114         *  Text file containing plugin fragment
   115         *
   116         *  This option names the text file containing a plugin fragment.
   117         *  This allows users to contribute extensions to the UI plugins
   118         *  generated by the tool.
   119         *
   120         *  The tool does not perform syntax checking of the contributed
   121         *  fragment. Users need to ensure the correctness of the 
   122         *  contributed fragment. Note that syntactically incorrect 
   123         *  fragments can disable the plugin completely in the eclipse 
   124         *  platform.
   125         */
   126        @CommandOption("f")
   127        config String pluginFragment = null;
   128    
   129        /*!
   130         *  ======== generationFormat ========
   131         *  Plugin generation format
   132         */
   133        @CommandOption("generation_format")
   134        config String generationFormat = null;
   135    
   136        /*!
   137         *  ======== suppress_product_type_info ========
   138         *  Suppress generation of product type information in the 
   139         *  generated plugin
   140         *
   141         *  This option generates eclipse plugin without the product
   142         *  type information. Should be invoked to generate plugins 
   143         *  whose product type is declared elsewhere 
   144         */
   145        @CommandOption("suppress_product_type_info")
   146        config Bool suppressProductTypeInfo = false;
   147    
   148        /*!
   149         *  ======== disable_repo_search ========
   150         *  Suppress search of product repositories
   151         *
   152         *  If this option is specified the tool does not
   153         *  search the product repositories for RTSC platforms.
   154         */
   155        @CommandOption("disable_repo_search")
   156        config Bool suppressSearch = false;
   157            
   158        /*!
   159         *  ======== run ========
   160         */
   161        override Any run(xdc.tools.Cmdr.Instance cmdr, String args[]);
   162    }
   163    /*
   164     *  @(#) xdc.tools.product.plugingen; 1, 0, 0,59; 8-23-2011 09:12:51; /db/ztree/library/trees/xdctools/xdctools-f02x/src/
   165     */
   166