1 2 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 *
52 *
53 * @a(Example)
54 * @p(code)
55 * xs xdc.tools.product.plugingen
56 * -p exampleprod_1_0_0_00
57 * -m xdc.tools.product.plugingen.examples.ExampleProduct
58
59 *
60 */
61 metaonly module Main inherits xdc.tools.ICmd
62 {
63 override config String usage[] = [
64 '[-p product_root_directory]',
65 ' -m module',
66 '[-o outdir]',
67 '[-f pluginFragment]',
68 '[--suppress_product_type_info]',
69 '[--disable_repo_search]'
70 ];
71
72 instance:
73
74 /*!
75 * ======== productDir ========
76 * Product root directory
77 *
78 * This option names the product root directory that is used by the
79 * tool to generate the plugin. If the '-o' option is not
80 * specified the tool generates the plugin in a sub-directory
81 * called `eclipse` in the product root directory.
82 *
83 */
84 @CommandOption("p")
85 config String productDir = "./";
86
87 /*!
88 * ======== schemaFile ========
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
117 * a plugin fragment. This allows users to contribute
118 * extensions to the UI plugins generated by the tool.
119 * The tool does not perform syntax checking of the contributed
120 * fragment. Users need to ensure the correctness of the
121 * contributed fragment. Note that syntactically incorrect
122 * fragments can disable the plugin completely in the eclipse platform.
123 *
124 */
125 @CommandOption("f")
126 config String pluginFragment = null;
127
128 /*!
129 * ======== suppress_product_type_info ========
130 * Suppress generation of product type information in the
131 * generated plugin
132 *
133 * This option generates eclipse plugin without the product
134 * type information. Should be invoked to generate plugins whose
135 * product type is declared elsewhere
136 *
137 */
138 @CommandOption("suppress_product_type_info")
139 config Bool suppressProductTypeInfo = false;
140
141
142 /*!
143 * ======== disable_repo_search ========
144 * Suppress search of product repositories
145 *
146 * If this option is specified the tool does not
147 * search the product repositories for RTSC platforms.
148 */
149 @CommandOption("disable_repo_search")
150 config Bool suppressSearch = false;
151
152
153 /*!
154 * ======== run ========
155 */
156 override Any run(xdc.tools.Cmdr.Instance cmdr, String args[]);
157 }
158 159 160
161