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 three options must be specified.

nexacrodeploy.exe -P [ARG] -O [ARG] -B [ARG]
start.bat -P [ARG] -O [ARG] -B [ARG]
start.sh  -P [ARG] -O [ARG] -B [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.

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.

CSS Rule Option

After installing Nexacro Studio version 21.0.0.1500 or higher, if you set a library version lower than the version 21.0.0.1500 in the -B option, the CSS Rule option must be set.

Option

Description

-CSSRULE

Specify the path where the CSS Rule file is located.

If the option is not set, Nexacro Deploy's CSS Rule (1.3) is applied.

When installing the SDK, the default CSS Rule path is as follows.

C:\Program Files (x86)\tobesoft\Nexacro N\SDK\21.0.0\generate


The CSS Rule with a version lower than the cssruleversion value of the library set in the -B option can be set.

If a version of CSS Rule higher than the cssruleversion value of the library is set, the generation fails and an error message is displayed.For example, if you set a library version lower than 21.0.0.1500 with the -B option and do not set the -CSSRULE option, the generation of the style-related file fails and an error message is displayed.

-CSSRULE version does not match the base library version (1.3).

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

Does not archive a bootstrap file

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

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.

nexacrodeploy.exe -P -O -B -BROWSER "NRE,Internet Explorer 11"
start.bat -P -O -B -BROWSER "NRE,Internet Explorer 11"
start.sh -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.

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"

Generate only certain file

nexacrodeploy.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate"  -B "C:\TestGenerate\nexacrolib" -FILE "C:\TestGenerate\aa.xfdl" 
nexacrodeploy.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate"  -B "C:\TestGenerate\nexacrolib" -FILE "theme::default"
nexacrodeploy.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate"  -B "C:\TestGenerate\nexacrolib" -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" -SERVICE "Base" 
nexacrodeploy.exe -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate"  -B "C:\TestGenerate\nexacrolib" -SERVICE "Base,FrameBase" 

Generate only module files

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

Generate only bootstrap files

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

Generate bootstrap files but not archive them. (iOS)

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

Deploy

Deploy entire Application

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

Module merge option

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

Compress option

nexacrodeploy.exe  -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacrolib" -D "E:\ResultDeploy" -COMPRESS
nexacrodeploy.exe  -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacrolib" -D "E:\ResultDeploy" -COMPRESS -SHRINK
nexacrodeploy.exe  -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacrolib" -D "E:\ResultDeploy" -COMPRESS -SHRINK -IGNOREEVAL
nexacrodeploy.exe  -P "C:\TestGenerate\TestGenerate.xprj" -O "E:\ResultGenerate" -B "C:\TestGenerate\nexacrolib" -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" -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" -L "C:\log.txt"