Automated building, deploying and/or verifying of libraries
logi.CAD 3 provides a tool for the automated building (=generation) and deployment of a library. This tool can also be used to verify the state of the library.
The tool is intended for usage by an experienced user of logi.CAD 3.
A condition for the successful usage of the tool is the knowledge of the action to be executed as it would be executed in the graphical user interface of logi.CAD 3.
The output of the tool is in English only.
Preparation
Make sure that logi.CAD 3 is installed. Have the following information prepared:
The path to the logi.CAD 3 installation directory
The path to a directory that will be used as the workspace
In case the directory does not exist, the tool creates it. If the optional parameter -checkEmptyWorkspace is used (see the description of this parameter below), the directory must be empty.The information for the libraries that should be built, deployed and/or verified
The path to the log configuration file (see below for more information)
A sample configuration file is included in the installation of logi.CAD 3.
Open a command line: e.g. cmd.exe under Windows and navigate to the logi.CAD 3 installation directory.
Invocation
Parameters that are placed within [] are optional. That means, if you skip the parameter, the default behavior is applied (see below under "Description of parameters"). When you want to use the parameter, do not enter the character [ and ] (see the below examples).
Invocation for automated building
logiCAD3c --launcher.ini logiCAD3.ini -application com.logicals.library.lc3lib.application [-noSplash] -libBuild [<LIBRARY-NAME__VERSION>] -projectPath <PROJECTPATH> -libraryDefinitionName <LIBCONFIGURATION-NAME> -data <WORKSPACE> [-checkEmptyWorkspace] -vmargs -Dlog4j.configuration=file:<LOG-CONFIGURATION>
Invocation for automated deploying
logiCAD3c --launcher.ini logiCAD3.ini -application com.logicals.library.lc3lib.application [-noSplash] -libDeploy [<LIBRARY-NAME__VERSION>] [-libDeployTo <TARGET_FOLDER>] -projectPath <PROJECTPATH> -libraryDefinitionName <LIBCONFIGURATION-NAME> -data <WORKSPACE> [-checkEmptyWorkspace] -vmargs -Dlog4j.configuration=file:<LOG-CONFIGURATION>
Invocation for automated verification
This verification checks whether the contents of the library have changed since it was created by redetermining the contents of the library files index.idx and index.md5 and comparing them with the rest of the library contents.
logiCAD3c --launcher.ini logiCAD3.ini -application com.logicals.library.lc3lib.application [-noSplash] -libCheck -fullLibraryName <FULL-LIBRARY-NAME> [-checkEmptyWorkspace] -vmargs -Dlog4j.configuration=file:<LOG-CONFIGURATION>
Combined invocation
It is possible to order the parameters as you like them. The best practice is to use the following order.
logiCAD3c --launcher.ini logiCAD3.ini -application com.logicals.library.lc3lib.application [-noSplash] -libBuild [<LIBRARY-NAME__VERSION>] -libDeploy [<LIBRARY-NAME__VERSION>] [-libDeployTo <TARGET_FOLDER>] -projectPath <PROJECTPATH> -libraryDefinitionName <LIBCONFIGURATION-NAME> -data <WORKSPACE> -libCheck -fullLibraryName <FULL-LIBRARY-NAME> [-checkEmptyWorkspace] -vmargs -Dlog4j.configuration=file:<LOG-CONFIGURATION>
Invoking the tool under Linux is not officially supported. However, if you want to try invoking the tool under Linux nevertheless, replace the part logiCAD3c --launcher.ini logiCAD3.ini -application of the above-mentioned invocation by logiCAD3 -application. The remaining part of the invocation is identical to the above-mentioned invocation.
Description of parameters:
Parameter |
Description |
Example |
||||||
[<LIBRARY-NAME__VERSION>] |
library to be build or deployed, as it is declared within the library configuration (specified by the parameter libraryDefinitionName <LIBCONFIGURATION-NAME>) It is only possible to deploy a library, if this library has already been built (= generated). In case of a combined invocation, the building is automatically done before the deploying. |
MyLibrary__1.1.0 |
||||||
<TARGET_FOLDER> |
absolute path to a folder to which the library should be deployed
|
C:\LC3Projects\MyProject\target |
||||||
<FULL-LIBRARY-NAME> |
name (incl. path and extension) of the library to be verified This parameter might be the default path within a logi.CAD 3 project where the library has already been generated. But it is also possible to specify a different path – in this case the path must contain the library. |
C:\LC3Projects\MyProject\target\MyLibrary__1.1.0.zip |
||||||
<PROJECTPATH> |
absolute path to the project |
C:\LC3Projects\MyProject |
||||||
<LIBCONFIGURATION-NAME> |
the library configuration which declares the libraries to be build or deployed Mind the following (see the example to the right):
|
MyLibraries.lc3lib |
||||||
<WORKSPACE> |
absolute path to a workspace to which the project should be imported
|
C:\temp\LC3Workspace |
||||||
<LOG-CONFIGURATION> |
path to the log configuration file |
C:\LC3LogConfig\log4j.xml |
The parameter -noSplash is optional. If it is not specified, the splashscreen of logi.CAD 3 is displayed after the invocation.
The parameter -checkEmptyWorkspace is also optional. Specify this parameter to check whether the specified workspace is empty. The logi.CAD 3 project will only be imported, if the workspace is empty.
The default invocation (when this parameter is not specified) is that the logi.CAD 3 project is always imported into the workspace – regardless whether the workspace is empty or not. If the logi.CAD 3 project already exists within the workspace, the logi.CAD 3 project is imported anew.The parameter -Dlog4j.configuration is also optional . However, logi.cals recommends to specify this parameter so that log events are output .
logiCAD3c --launcher.ini logiCAD3.ini -application com.logicals.library.lc3lib.application -noSplash -libBuild -libDeploy -projectPath C:\LC3Projects\MyProject -libraryDefinitionName MyLibraries.lc3lib -data C:\temp\LC3Workspace -vmargs -Dlog4j.configuration=file:C:\LC3LogConfig\log4j.xml
logiCAD3c --launcher.ini logiCAD3.ini -application com.logicals.library.lc3lib.application -noSplash -libBuild MyLibrary__1.
1.0
-libDeploy MyLibrary__1.
1.0
-libDeployTo C:\LC3Projects\MyProject\target -projectPath C:\LC3Projects\MyProject -libraryDefinitionName MyLibraries.lc3lib -data C:\temp\LC3Workspace -libCheck -fullLibraryName C:\LC3Projects\MyProject\target\MyLibrary__1.
1.0
.zip -vmargs -Dlog4j.configuration=file:C:\LC3LogConfig\log4j.xml
Log configuration file
This file is needed to configure the log4j logging mechanism. The file specifies how log events are output.
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<
log4j
:configuration
debug
=
"false"
xmlns:log4j
=
'http://jakarta.apache.org/log4j/'
>
<!-- This configuration logs to console. -->
<
appender
name
=
"console"
class
=
"org.apache.log4j.ConsoleAppender"
>
<
param
name
=
"target"
value
=
"System.out"
/>
<
param
name
=
"immediateFlush"
value
=
"true"
/>
<
param
name
=
"encoding"
value
=
"UTF-8"
/>
<
param
name
=
"threshold"
value
=
"info"
/>
<
layout
class
=
"org.apache.log4j.PatternLayout"
>
<
param
name
=
"ConversionPattern"
value
=
"%d{yyyy-MM-dd HH:mm:ss} %-5p: %m%n"
/>
</
layout
>
</
appender
>
<!-- This configuration logs to a file, with more information than for the console. -->
<
appender
name
=
"file"
class
=
"org.apache.log4j.DailyRollingFileAppender"
>
<
param
name
=
"file"
value
=
"C:\\temp\\logfile.log"
/>
<
layout
class
=
"org.apache.log4j.PatternLayout"
>
<
param
name
=
"ConversionPattern"
value
=
"%d{HH:mm:ss} %-5p [THREAD ID=%t] [Method:%M] %c{1}:%L - %m%n"
/>
</
layout
>
</
appender
>
<
root
>
<
level
value
=
"INFO"
/>
<
appender
-ref
ref
=
"console"
/>
<
appender
-ref
ref
=
"file"
/>
</
root
>
</
log4j
:configuration>
Troubleshooting
The file that is specified in the log configuration file contains information about the building, deploying and verification. If the building, deploying or verification has not been successful, fix the problem according to the following table.
Return code |
Message |
Cause |
Solution |
0 |
Library checksum validation successful (0) |
|
|
13 |
<no message> |
wrong value specified for -application |
Invoke the tool as specified above. |
-1 |
Library manager failed (Parameter Error, -1): Name |
An argument or parameter is missing. |
Invoke the tool as specified above. |
-2 |
Library manager failed (-2): Project not found |
The specified project does not exist. |
Specify an existing project. Or invoke the tool with the absolute path for the project. |
-6 |
Library manager failed (-6): Workspace not empty |
The workspace already contains data (e.g. one or more logi.CAD 3 projects). |
Use an empty workspace or remove all existing data from the current one. |
-64 |
Library checksum validation failed (-64) |
The library to be verified is corrupted. |
Invoke the tool for a library that has been correctly built and deployed. |
-65 |
Library build failed (-65) |
The library could not be built. |
Check, if there are additional messages detailing the error cause. Depending on these details:
|
-66 |
Library deploy failed (-66) |
The library could not be deployed. |
Check the previous messages for error causes. Depending on these details:
|
-127 |
Library manager (Details: exception message) |
An unexpected error has occurred. |
Contact logi.cals. |
The following messages might detail the error cause why the library could not be built:
Could not find a library with name and version: name
Could not find the library definition file: name
Model rule checking failed You might want to use the tool for automated rule checking before building the library in order to make sure that the library objects are not violating any rules.