Generating Code
If you develop apps based on Nexacro Platform, all those programs will be converted into either JavaScript files or CSS files. This conversion process is called generation. Generated apps can be run on web browsers powered by operating systems. Otherwise, they are available in the Nexacro runtime environment (NRE).
To deploy a project that you develop through Nexacro Studio, you need to convert the codes of the project so that they are ready to be deployed. This conversion process is called "generation". You can generate codes through the menu [Generate] or [Deploy] in Nexacro Studio. However, it is better to use nexacrodeploy17.exe when a project's scale is large or when you use an automatic build system. nexacrodeploy17.exe is a tool for automatic generation and deployment.
Required Options
The below three options must be specified.
nexacrodeploy17.exe -P -O -B [args...]
Option | Description |
---|---|
-P [ARG] | Specifies the path to the XPRJ file that contains a project to process. |
-O [ARG] | Specifies the output path where generate files are stored. Output path will be created automatically if nothing is specified. |
-B [ARG] | Specifies the path to the library files needed for generating files. |
Options for Specifying Target Files
If you do not set the below options, the deployment tool will work on all the files in a project.
Option | Description |
---|---|
-FILE [ARG...] | Specifies a list of paths to files to generate. Specifies IDs of themes to generate. Separated by a comma or semicolon when multiple inputs exist. The entire list of files must be enclosed in double quotation marks while each individual file is in single quotation marks. |
-SERVICE [ARG...] | Specifies the service prefix ID list to Generate. Separates multiple inputs with ','(Comma) or ';'(Semicolon). |
-BOOTSTRAP [ARG...] | Specifies the OS to which the created bootstrap files will apply. Separated by a comma or semicolon when multiple inputs exist. |
-MODULE | Used to generate only module files. |
If you do not specify the -FILE, -SERVICE, -BOOTSTRAP or -MODULE option, the deployment tool will deal with all the cases related to the project.
If there is a file that affects the bootstrap file such as the XADL file or environment.xml among the files specified with the -FILE option, then the bootstrap file may be recreated.
If multiple files are specified in the -FILE or -BOOTSTRAP option, there must be no white space between them.
(X) -FILE "'C:\a.xfdl', 'C:\b.xfdl'
(O) -FILE "'C:\a.xfdl','C:\b.xfdl'
Generate Options
Option | Description |
---|---|
-REGENERATE | Generates all files regardless of changes in files. If you do not specify this option, unchanged files will not be generated. |
-BROWSER [ARG...] | Specifies certain web browsers for which XCSS and Xtheme files will be generated. Separated by a comma or semicolon when multiple inputs exist. Note: you cannot specify a browser that is not supported by Nexacro Platform. |
-UNARCHIVE | Does not archive a bootstrap file |
You can specify below browsers as arguments of the -BROWSER option.
NRE
Nexacro Browser (deprecated)
Internet Explorer 11
Internet Explorer 10
Internet Explorer 9
Internet Explorer 8
Chrome
Firefox
Opera
Safari
If you want to specify the NRE and IE11, write code as below.
nexacrodeploy17.exe -P -O -B -BROWSER "NRE,Internet Explorer 11"
It will generate files for all the browsers if you do not specify the -BROWSER option.
Currently, this command is applicable only to iOS, whose bootstrap file is Run.zip. The Run.html file will be created instead of Run.zip.
If multiple browsers are specified in the -BROWSER option, there must be no white space between them.
(X) -BROWSER "NRE, Internet Explorer 11"
(O) -BROWSER "NRE,Internet Explorer 11"
Deploy Options
Option | Description |
---|---|
-D [ARG] | Specifies the output path where deployed files are stored. Output path will be created automatically if a specified path is non-existent. Deployment will be conducted if this option is used. You cannot use the path specified by the '-O' option. |
-MERGE | Creates a single JS file by merging the JS files defined in a JSON file. |
-COMPRESS | Compresses JS files when deploying. |
-SHRINK | Obfuscates variable names. A function will not be obfuscated if it contains an eval statement. |
-IGNORECOMPRESS [ARG] | Specifies path for the .ignorecompress file, which stores a list of files that are not subject to compression. Note: this option is available only when the '-COMPRESS' option is applied. |
-IGNOREEVAL | Conducts obfuscation regardless of eval functions. (not recommended) Note: this option is available only when the '-SHRINK' option is applied. |
-COMPILE | Compiles files that will be used in the NRE. Note: only the NRE supports the files produced as a result of applying this option. |
-PRJURL [ARG] | Specifies the Project URl to load the App. Note: Option for iOS only. |
Module Project Deploy Options
Option | Description |
---|---|
-PACKAGE | You should specify this option at the beginning of a command line for a module deployment |
-NAME | Defines the name of the module |
-VERSION | Defines the version of a JSON file |
-DESC | Provides the description of the JSON file |
Other options
Option | Description |
---|---|
-L [ARG] | Specifies the path to a log file to save the process. Output path will be created automatically if nothing is specified. Creating a log file may increase the processing time. |
-H | -? | -HELP | Provides the help for nexacrodeploy17.exe. |
Examples
Generate
Generate entire Application
You can generate an Application based on C:\TestGenerate\TestGenerate.xprj file and produce the result to the E:\ResultGenerate folder.
You also can generate the files necessary to run the app (the console does not generate bootstrap files except for the ones related to the execution of the NRE or web browsers.)
The generation is conducted by referring to the path of base libraries, specified as the -B option.
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib"
Generate only certain file
You can generate the C:\TestGenerate\aa.xfdl file specified as the -FILE option and produce the result to the E:\ResultGenerate folder.
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib" -FILE "C:\TestGenerate\aa.xfdl"
You also can generate a theme file by specifying the ID of the target theme file.
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib" -FILE "theme::default"
You can generate n number of files and produce the result to the E:\ResultGenerate folder.
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib" -FILE "'C:\TestGenerate\aa.xfdl','C:\TestGenerate\bb.xfdl','C:\TestGenerate\cc.xfdl'"
When generating only specific services
Generate only the files corresponding to the Base service specified with the -SERVICE option and then create them under the "E:\ResultGenerate" folder.
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib" -SERVICE "Base"
Generate n number of services and then create them under the "E:\ResultGenerate" folder.
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib" -SERVICE "Base,FrameBase"
Generate only module files
You can generate only the module files in use located at C:\TestGenerate\nexacro17lib and produce the result to the E:\ResultGenerate folder.
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib" -MODULE
Generate only bootstrap files
You can generate bootstrap files of all OS types needed to run your app and produce the result to the E:\ResultGenerate folder.
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib" -BOOTSTRAP
Generate bootstrap files but not archive them. (iOS)
You can generate bootstrap files of all OS types needed to run your app and produce the result to the E:\ResultGenerate folder. However, the result will be the Run.html file rather than Run.zip.
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib" -BOOTSTRAP -UNARCHIVE
Deploy
Deploy entire Application
The application deployer generates files and produces the result to the path specified as the -O option. Then, it creates the files for deployment in the directory specified as the -D option.
In this case, all the options are applied to the generation process, which produces the result to the path specified as the -O option. (-R, -BROWSER, etc.)
The files in the directory of the -D option are produced based on the files in the directory of the -O option.
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib" -D "E:\ResultDeploy"
Module merge option
You can create one JavaScript file by combining the JavaScript files in the nexacro17lib folder. When you do so, the JavaScript files in nexacro17lib will change their names in tandem with each relevant JSON file.
You can create the Framework.json file by merging all the JavaScript files in the framework folder.
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib" -D "E:\ResultDeploy" -MERGE
Compress option
You can compress JavaScript files by removing their comments and whitespaces and thus making each file one-line code.
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib" -D "E:\ResultDeploy" -COMPRESS
While compressing JavaScript files to make each file one-line code with their comments and whitespaces removed, you can also obfuscate the variables of those JS files at the same time. However, a function will not be obfuscated if it contains an eval statement.
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib" -D "E:\ResultDeploy" -COMPRESS -SHRINK
While compressing JavaScript files to make each file one-line code with their comments and whitespaces removed, you can also obfuscate the variables of those files at the same time. Moreover, you can insist on obfuscation by ignoring eval statements included in functions.
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib" -D "E:\ResultDeploy" -COMPRESS -SHRINK -IGNOREEVAL
You can compress JavaScript files by removing their comments and whitespaces and thus making each file one-line code. However, the deployment tool does not compress the JavaScript files designated by the .ignorecompress file.
You should specify the relative paths of output files as the items of the Ignore Compress list. The relative paths are specified based on the directory of the relevant project. (You can designate only JavaScript files.)
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib" -D "E:\ResultDeploy" -COMPRESS -IGNORECOMPRESS "C:\TestGenerate\.ignorecompress"
Compile option
You can compress deployment files by encoding them with the format applicable only to the NRE. The resulting encoded files cannot be read through other editor programs.
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib" -D "E:\ResultDeploy" -COMPILE
Others
Save generation result as log file
You can generate an Application based on C:\TestGenerate\TestGenerate.xprj file and produce the result to the E:\ResultGenerate folder. Then, you can save the details of the generation in the form of the C:\Log.txt file.
nexacrodeploy17.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacro17lib" -L "C:\log.txt"