Nexacro Deploy

Generating Code

If you develop apps based on Nexacro, 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 Nexacro Deploy when a project's scale is large or when you use an automatic build system. Nexacro Deploy is a tool for automatic generation and deployment.

Types of Nexacro Deploy

You can select and use the appropriate Nexacro Deploy according to your purpose.


nexacrodeploy.exe

Nexacro Deploy JAVA

distribution method

Install with Nexacro Studio

Distributed separately as a jar file

system requirements

Same as Nexacro Studio

Install JDK 1.8.0_131 or higher

Need to set JAVA_HOME environment variable

executable file name

Tools\nexacrodeploy.exe

bin\start.bat

bin\start.sh

Options

Required Options

The below four options must be specified.

nexacrodeploy.exe -P [ARG] -O [ARG] -B [ARG] –GENERATERULE [ARG]
start.bat -P [ARG] -O [ARG] -B [ARG] –GENERATERULE [ARG]
start.sh  -P [ARG] -O [ARG] -B [ARG] –GENERATERULE [ARG]

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.

–GENERATERULE [ARG]

Specify the path where the Generate Rule file is located.

The generated (deployed) file in the path specified with the -O(-D) option is not deleted even if you change the option specifying the work target or execute Generate(deploy) after deleting the file from the project. If necessary, the operator must manually delete the file.

If a file is deleted or renamed directly in the Nexacro Studio Project Explorer, the file created in the Ouputs path is also deleted or the file name is changed. This function is not a Nexacro Deploy function, but a function supported by Nexacro Studio.

The -CSSRULE option in the previous versions, which specified the path for the CSS Rule files, are no longer supported.

Rule files required for Generate, including CSS Rule files, have been added. The –GENERATERULE option has been changed to be required.


Delete the -CSSRULE option from the existing script and add the –GENERATERULE option.

The Generate Rule file is located under the [SDK > {24.X.X.X} > generate] folder and the path can be directed to another location by the user.

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.

-UNARCHIVE [ARG...]

The operating system Bootstrap file that has been set will not be archived.

(A Run.html file is created instead of a Run.zip file).

Android,iOS

Android

iOS

-JSVERSION

Set script validation rules to be applied when generating.

If no option value is specified, the default is "ECMAScript 2015".

You can choose "ECMAScript 5" or "ECMAScript 2015".

When using the -JSVERSION option, Regenerate is performed on related items regardless of whether the file has been modified or not.

-DEFER

When creating the Bootstrap file, set the defer attribute within the Script tag.

-SPLASH

Sets whether or not to include a script to display Splash Loader when bootstrap file is created.

-RTL

When theme and xcss file are generated, a results file where RTL has been applied will be included.

You can specify below browsers as arguments of the -BROWSER option.

NRE

Nexacro Browser (deprecated)

Internet Explorer 11

Internet Explorer 10

Chrome

Firefox

Opera

Safari


Internet Explorer 10 and 11 are not supported if the library set in the -B option is Version 24.0.0.100 and up. Files will not be generated even if it is specified as an option.

If you want to specify the NRE and Chrome, write code as below.

nexacrodeploy.exe -P -O -B –GENERATERULE -BROWSER "NRE,Chrome"
start.bat -P -O -B –GENERATERULE -BROWSER "NRE,Chrome"
start.sh -P -O -B –GENERATERULE -BROWSER "NRE,Chrome"

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, Chrome"

(O) -BROWSER "NRE,Chrome"

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.

-MERGEXCSS

Multiple xcss files added to the application will be combined into a single 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.

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 Nexacro Deploy.

Examples

The usage example was written based on nexacrodeploy.exe.

Generate

Generate entire Application

nexacrodeploy.exe  -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate"

Generate only certain file

nexacrodeploy.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate"  -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate" -FILE "C:\TestGenerate\aa.xfdl" 
nexacrodeploy.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate"  -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate" -FILE "theme::default"
nexacrodeploy.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate"  -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate" -FILE "'C:\TestGenerate\aa.xfdl','C:\TestGenerate\bb.xfdl','C:\TestGenerate\cc.xfdl'" 

When generating only specific services

nexacrodeploy.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate"  -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate" -SERVICE "Base" 
nexacrodeploy.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate"  -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate" -SERVICE "Base,FrameBase" 

Generate only module files

nexacrodeploy.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate"  -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate" -MODULE

Generate only bootstrap files

nexacrodeploy.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate"  -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate" -BOOTSTRAP

Generate bootstrap files but not archive them

nexacrodeploy.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate"  -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate" -BOOTSTRAP -UNARCHIVE "Android,iOS"

Deploy

Deploy entire Application

nexacrodeploy.exe  -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate" -D "E:\ResultDeploy"

Module merge option

nexacrodeploy.exe  -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate" -D "E:\ResultDeploy" -MERGE

Compress option

nexacrodeploy.exe  -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate" -D "E:\ResultDeploy" -COMPRESS
nexacrodeploy.exe  -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate" -D "E:\ResultDeploy" -COMPRESS -SHRINK
nexacrodeploy.exe  -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate" -D "E:\ResultDeploy" -COMPRESS -SHRINK -IGNOREEVAL
nexacrodeploy.exe  -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate" -D "E:\ResultDeploy" -COMPRESS -IGNORECOMPRESS "C:\TestGenerate\.ignorecompress"
<?xml version="1.0" encoding="utf-8"?>
<CompressConfigue version="1.0">
  <IgnoreCompress>
    <File path=".\Service0\test01.js"/>
    <File path=".\Service0\test02.js"/>
  </IgnoreCompress>
</CompressConfigue>

Compile option

nexacrodeploy.exe  -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate" -D "E:\ResultDeploy" -COMPILE

Others

Save generation result as log file

nexacrodeploy.exe  -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacrolib" –GENERATERULE "C:\TestGenerate\generate" -L "C:\log.txt"