AMAPstudio

User Tools


Differences

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

Link to this comparison view

Next revision
Previous revision
Last revision Both sides next revision
documentation:duplicatemodule [2018/04/23 09:20]
beudez created
documentation:duplicatemodule [2018/04/24 13:05]
beudez
Line 1: Line 1:
-aaaa+====== How to duplicate a module ====== 
 + 
 +It is possible using the **duplicate-module** target of the Ant's //​build.xml//​ file to duplicate an existing module located in the //​capsis4/​src//​ directory in order to create a new module having a new package name, a new module name and a new prefix. The user chooses the new package name and the new prefix, and the new module name is created automatically from the new package name. 
 + 
 +In order to duplicate a module, you have to type the following command from the //capsis4// directory:​ 
 + 
 +On Linux/​MacOS:​ 
 +<​code>​sh ant duplicate-module -Dpackage.name=packagename -Dnew.package.name=newpackagename -Dnew.prefix=Newprefix</​code>​ 
 + 
 +On Windows: 
 +<​code>​ant duplicate-module -Dpackage.name=packagename -Dnew.package.name=newpackagename -Dnew.prefix=Newprefix</​code>​ 
 + 
 +where:\\ 
 +- //​packagename//​ is the package name of the initial module (module to duplicate stored in //​capsis4/​src//​ directory);​\\ 
 +- //​newpackagename//​ and //​Newprefix//​ are respectively the package name and the prefix of the new module (module to create in //​capsis4/​src//​ directory). 
 + 
 +For example, the following command (on Linux/​MacOS):​ 
 +<​code>​sh ant duplicate-module -Dpackage.name=training -Dnew.package.name=training2 -Dnew.prefix=Tra2</​code>​ 
 + 
 +will create from the //​training//​ package (module name: //​Training//​) a new module having the following characteristics:​\\ 
 +- package name: //​training2//;​\\ 
 +- module name: //​Training2//​ (default value generated from package name);\\ 
 +- prefix: //Tra2//. 
 + 
 +Notes:\\ 
 +- The creation of the new module requires to give new names to files (//.java// source files and //​.properties//​ translation files mainly) and classes contained in source files from the initial module.\\ 
 +- Local variables of the initial module whose name begins with the prefix (with a lowercase first letter) are also renamed. Therefore, with the previous example, if the //​TraModel//​ class (stored in //​TraModel.java//​) contains the following instruction:​\\ 
 +//TraScene traScene = (TraScene) step.getScene().getEvolutionBase();//​\\ 
 +then, the //​Tra2Model//​ class (stored in //​Tra2Model.java//​) will contain the following instruction:​\\ 
 +//Tra2Scene tra2Scene = (Tra2Scene) step.getScene().getEvolutionBase();//​\\
documentation/duplicatemodule.txt · Last modified: 2018/04/24 13:07 by beudez