User Tools

Site Tools


building_transsecs_projects_with_a_command_line

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
building_transsecs_projects_with_a_command_line [2020/10/20 16:07] – created wikiadminbuilding_transsecs_projects_with_a_command_line [2020/11/11 14:09] (current) – wikiadmin
Line 27: Line 27:
 When you double-click the executable, the application will start, compile the last project you had open, and then exit.  You can test this by deleting the deployment folder in the project (everything except the .tsx and .xpj) and use the headless feature to rebuild it.  You should see all the same files, including deployment, documentation, etc. as you would if you had build from within the TransSECS editor. When you double-click the executable, the application will start, compile the last project you had open, and then exit.  You can test this by deleting the deployment folder in the project (everything except the .tsx and .xpj) and use the headless feature to rebuild it.  You should see all the same files, including deployment, documentation, etc. as you would if you had build from within the TransSECS editor.
  
-If you are running TransSECS from a script or a batch file, you will need to add the system property //"-Dtranssecs.headless=true"// to the start of the java command line:+If you are running TransSECS from a script or a batch file, you will need to add the system property "-Dtranssecs.headless=true" to the start of the java command line:
  
 <file> <file>
Line 33: Line 33:
 </file> </file>
  
-The property name //"transsecs.headless"// is case sensitive, it must be all lower case.+The property name "transsecs.headless" is case sensitive, it must be all lower case.
  
 ===Choosing which Project to build=== ===Choosing which Project to build===
  
-When running TransSECS normally, the project loaded is described in the //"application.properties"// file in the TransSECS folder.  This may look something like this:+When running TransSECS normally, the project loaded is described in the "application.properties" file in the TransSECS Builder folder.  This may look something like this:
  
 <file> <file>
Line 48: Line 48:
 </file> </file>
  
-The same file applies when running a headless TransSECS build, the project listed in the //"project.dir"// line will be the project built.+The same file applies when running a headless TransSECS build, the project listed in the "project.dir" line will be the project built.
  
-When running TransSECS, the configuration property file to read is provided as an argument to the application.  You will see this in the .conf file as the line //wrapper.app.parameter.2=application.properties//+When running TransSECS, the configuration property file to read is provided as an argument to the application.  You will see this in the .conf file as the line "wrapper.app.parameter.2=application.properties"
  
 <file> <file>
Line 58: Line 58:
 </file> </file>
  
-For this argument, you can provide the full path the a customized application.properties file.  TransSECS will read that file at startup and compile the project described in the file.  For example, if you create a file in the folder //C:\\Users\\MyProjects\\// called //headlessbuild.properties// with this content:+For this argument, you can provide a path (either relative to the TransSECS Builder directory or an absolute path) to the customized application.properties file.  TransSECS will read that file at startup and compile the project described in the file.  For example, if you create a subdirectory "buildprops" under the TransSECS Builder directory and place a "headlessbuild.propertie"s file in this subdirectory with this content:
  
 <file> <file>
Line 72: Line 72:
  
 <file> <file>
-wrapper.app.parameter.2=C:\\Users\\MyProjects\\headlessbuild.properties+wrapper.app.parameter.2=buildprops\\headlessbuild.properties 
 +</file> 
 + 
 +or as a full path for the headlessbuild.properties: 
 + 
 +<file> 
 +wrapper.app.parameter.2=C:\\Users\\Public\\ErgoTech\\TransSECSDevicesTrial\\buildprops\\headlessbuild.properties
 </file> </file>
  
 When you start the headless build, the project in C:\\Users\\MyProjects\\GEMTool will be built. When you start the headless build, the project in C:\\Users\\MyProjects\\GEMTool will be built.
  
-This property can, again, be added as an argument in a script of batch file.  This time at the end of the command line:+This property can, again, be added as an argument in a script or batch file at the end of the command line:
  
 <file> <file>
-java -Dtranssecs.headless=true .... C:/Users/MyProjects/headlessbuild.properties+java -Dtranssecs.headless=true [... the rest of the command line ...] buildprops/headlessbuild.properties
 </file> </file>
 +
 +or, with a full path to the headlessbuild.properties
 +
 +<file>
 +java -Dtranssecs.headless=true [... the rest of the command line ...] /home/username/TransSECSPlusReporting/MIStudioSuite/TransSECS/Builder/buildprops/headlessbuild.properties
 +</file>
 +
 +where "the rest of the command line" contains the classpath -cp parameter (if classpath is not already defined), other java and jdk parameters and various TransSECS parameters as listed in the TransSECS.conf file in your script or batch file. 
 +
 +An example bash script for Linux to run TransSECS Builder headless (check the current command line parameters in your installation's TransSECS.conf to verify). 
 +
 +<file>
 +CLASSPATH="./:./addons/*:../documentation/*:../../MIStudio/lib/*:../../MIStudio/lib/:../../MIStudio/jars/*:../../MIStudio/core/*:../../MIStudio/core/:../../MIStudio/core/lib/*:../../MIStudio/core/ant/lib/*:${JAVA_HOME}/lib/tools.jar:"
 +
 +/usr/lib/jvm/java-8-openjdk-amd64/bin/java -cp ${CLASSPATH} -Dsun.java2d.d3d=false -Dtranssecs.headless=true -Dsun.java2d.noddraw=true -Dtranssecs.applicationtype=0 -Dsun.lang.ClassLoader.allowArraySyntax=true -DLoggerClass=Log4JLogger   com.ergotech.transsecs.secs.TransSecs /home/ergotech/TransSECSPlusReporting/MIStudioSuite/TransSECS/Builder/buildprops/headlessbuild.properties
 +
 +</file>
 +
  
  
-===Building only a Selected Tools===+===Building Only Selected Tools===
  
-Some TransSECS projects contain multiple tools.  In this case, it is usual to build all the tools and the headless build will do this.  There may be occasions where only a sub-set of the tools should be built.  This is supported by adding additional tools to the command line.  The name of the configuration properties file must be first - the //wrapper.app.parameter.2// as described above.  The tools must then be added as //wrapper.app.parameter.3//, //wrapper.app.parameter.4// and so on.  The property is just the name of the tool as defined in the TransSECS project.  The tool must already exist in the project.+Some TransSECS projects contain multiple tools.  In this case, it is usual to build all the tools and the headless build will do this.  There may be occasions where only a sub-set of the tools should be built.  This is supported by adding additional tools to the command line.  The name of the configuration properties file must be first - the "wrapper.app.parameter.2" as described above.  The tools must then be added as "wrapper.app.parameter.3", "wrapper.app.parameter.4" and so on.  The property is just the name of the tool as defined in the TransSECS project.  The tool must already exist in the project.
  
 <file> <file>
-wrapper.app.parameter.2=C:\\Users\\MyProjects\\headlessbuild.properties+wrapper.app.parameter.2=buildprops\\headlessbuild.properties
 wrapper.app.parameter.3=GEMTool wrapper.app.parameter.3=GEMTool
 wrapper.app.parameter.4=RFIDReaderTool1 wrapper.app.parameter.4=RFIDReaderTool1
 </file> </file>
  
building_transsecs_projects_with_a_command_line.1603224429.txt.gz · Last modified: by wikiadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki