gmStudio makes extensive use of XML scripts to direct the translation process.
A Translation Script is a text file in XML format that contains a collection of migration commands.
Every migration task in your migration project can be assigned a different translation script template to direct its unique process, typically, all of the tasks in a migration project use the same template script.
One of the standard templates (Interoped-Externals Template for VB6 Migrations) is annotated below:
Before gmStudio runs the translation, it edits a number of parameter place holders in the script. The use of parameters generalizes the scripts for use with multiple migration units. These parameters are described in the table below:
|%GenExternFolder%||Computed location of prototype assemblies|
|%MigName%||Migration Project Name|
|%JobId%||Unique Task Identifier|
|%Dialect%||Target .NET language ( csh | vbn )|
|%JobName%||Simple Task Identifier|
|%SrcFileStem%||Migration Unit File Name without extension|
|%SrcPath%||Migration Unit File Path|
|%SrcFolder%||Migration Unit File Folder|
|%BndPath%||Migration Unit Bundle File Path|
|%NetProjFolder%||Migration Unit Deployment Folder|
|%DeployFolder%||Root Deployment Folder|
|%ProjFolder%||Migration Workspace Root Folder|
|%UserFolder%||User Configuration Files Folder|
|%IdfFromCodeFolder%||IDF From Code Folder|
|%IdfFromIdlFolder% ,||IDF From IDL Folder|
|%InteropFolder%||Interop File Folder|
|%DevEnv% ,||Target .NET IDE ( e.g. VS2010 | VS2012 )|
|%AppRoot%||Application Configuration Root Directory|
|%ResxFolder%||Resx Files Folder|
|%TranDate%||Time Stamp of the form MMDD-HHmm|
|%ReferenceList%||List of references statements for COM dependencies|
gmStudio ships with four default Translation Script templates:
The standard templates are small XML files located in the [INSTALLDIR]\support\settings folder.
You may modify the standard templates or create your own.
The names of the default scripts are specified in the application config file.
' Default translation VB6 template
' Default translation ASP template
When you create a migration project, gmStudio creates a copy of the appropriate script template and places it in the workspace\usr folder. This copy will be associated with the migration tasks and used going forward.
You can change the script associated with a migration task by editing the TScript field on the task record.
As a brief introduction to Translation Scripting, let us compare these standard scripts.
Comparing the following files:
shows differences in three sections
1) Two Translation Options added to the prototype script.
BuildFile="on" tells the translator to generate stub classes for all external COM components.
ImportsGlobal="on" tells the translator to accumulate external dependencies across all migration units so the consolidated set of external members will be available in a single set of prototype assemblies.
2) The Library setting is different.
The Library setting tells gmBasic how to author HintPath settings in the target projects.
3) Two registry commands are added to the prototype script.
Stdole and VBRUN are special cases of COM libraries that are rarely needed even though they explicitly show up as references in VBPs files. These two commands tell gmBasic to suppress generating and referencing the prototype assemblies.