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 metaonlymodule Main inherits xdc.tools.ICmd
59 {
60 overrideconfig 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. For example, it's declared repositories
77 * are added to the package path and are searched for contributed
78 * platforms.
79 *
80 * If the '-o' option is not specified, the tool generates the plugin
81 * in a sub-directory named `eclipse` in the product root directory.
82 *
83 * If this option is not specified, the product root directory is
84 * assumed to be `./`.
85 *
86 */
87 @CommandOption("p")
88 config String productDir = "./";
89
90 /*!
91 * ======== productModule ========
92 * Input description of the plug-in to be specified
93 *
94 * This required option names a module that implements
95 * `{@link xdc.tools.product.IProduct}`.
96 */
97 @CommandOption("m")
98 config String productModule;
99
100 /*!
101 * ======== outputDir ========
102 * Output directory in which the plugin will be generated.
103 *
104 * This option names the directory in which the plugin
105 * will be generated in a sub-directory named `eclipse`.
106 * If this option is not specified the tool will generate
107 * the plugin in the product root directory specified with
108 * the '-p' option.
109 */
110 @CommandOption("o")
111 config String outputDir = null;
112
113 /*!
114 * ======== pluginFragment ========
115 * Text file containing plugin fragment
116 *
117 * This option names the text file containing a plugin fragment.
118 * This allows users to contribute extensions to the UI plugins
119 * generated by the tool.
120 *
121 * The tool does not perform syntax checking of the contributed
122 * fragment. Users need to ensure the correctness of the
123 * contributed fragment. Note that syntactically incorrect
124 * fragments can disable the plugin completely in the eclipse
125 * platform.
126 */
127 @CommandOption("f")
128 config String pluginFragment = null;
129
130 /*!
131 * ======== generationFormat ========
132 * Plugin generation format
133 */
134 @CommandOption("generation_format")
135 config String generationFormat = null;
136
137 /*!
138 * ======== suppress_product_type_info ========
139 * Suppress generation of product type information in the
140 * generated plugin
141 *
142 * This option generates eclipse plugin without the product
143 * type information. Should be invoked to generate plugins
144 * whose product type is declared elsewhere
145 */
146 @CommandOption("suppress_product_type_info")
147 config Bool suppressProductTypeInfo = false;
148
149 /*!
150 * ======== disable_repo_search ========
151 * Suppress search of product repositories
152 *
153 * If this option is specified the tool does not
154 * search the product repositories for RTSC platforms.
155 */
156 @CommandOption("disable_repo_search")
157 config Bool suppressSearch = false;
158
159 /*!
160 * ======== run ========
161 */
162 override Any run(xdc.tools.Cmdr.Instance cmdr, String args[]);
163 }
164 /*
165 * @(#) xdc.tools.product.plugingen; 1, 0, 0,64; 11-4-2011 09:12:45; /db/ztree/library/trees/xdctools/xdctools-f07x/src/
166 */
167