Here is the list of GeneXus MSBuild Tasks related to Team Development.
When these MSBuild Tasks are used, the GeneXus.Server.Tasks.targets file has to be imported in the basic script file, adding the following line:
<Import Project="C:\Program Files\Artech\GeneXus\GeneXusX\Genexus.Server.Tasks.targets" />
Creates a Knowledge Base locally from a Knowledge Base hosted in a GeneXus Server in the specified directory based on a Knowledge Base template.
<CreateKnowledgeBaseFromServer
Directory="kbDirectory"
XmlOutputFile="xmlfile"
CreateDbInKbFolder="true|false"
DBName="dbName"
IntegratedSecurity="true|false"
UserId="userId"
Password="password"
Language="language"
Overwrite="true|false"
ServerInstance="instance"
ServerUri="http://ServerName/GeneXusServer"
ServerKBAlias="MyKnowledgeBase"
ServerVersionName="VersionName"
ServerUserName="user"
ServerPassword="password"
ServerToken="token"
WriteElapsedTime="true|false"
FullKB="true|false"
UseExistentDB="true|false"
/>
Directory: Check the Directory property of the CreateKnowledgeBase task.
XmlOutputFile: Output file from the Tasks execution in XML format.
CreateDbInKbFolder: Check the CreateDbInKbFolder property of the CreateKnowledgeBase task.
DBName: Check the DBName property of the CreateKnowledgeBase task.
IntegratedSecurity: Check the IntegratedSecurity property of the CreateKnowledgeBase task.
UserId: Check the UserId property of the CreateKnowledgeBase task.
Password: Check the Password property of the CreateKnowledgeBase task.
Language: Check the Language property of the CreateKnowledgeBase task.
Overwrite: Check the Overwrite property of the CreateKnowledgeBase task.
ServerUri: URL where the GeneXus Server instance is running. REQUIRED
ServerInstance: Check the ServerInstance property of the CreateKnowledgeBase task.
ServerKBAlias: Alias of the Knowledge Base as displayed in the GeneXus Server's default page. REQUIRED
ServerVersionName: Knowledge Base version name. If not specified, the trunk version is assumed.
ServerUserName: Username used to log in to a secure GeneXus Server. The syntax for this property value is <AuthenticationType>\<UserName>, i.e. "gxtechnical\user12" or "local\admin".
ServerPassword: Password used to log in to a secure GeneXus Server.
ServerToken: Session token used to authenticate and authorize requests in a secure GeneXus Server. An alternative method to UserName:Password authentication.
WriteElapsedTime: Logs the time spent in the task execution.
FullKB: Download all the available Knowledge Base versions or the selected one.
UseExistentDB: Creates a new SQLServer database or uses an already existing one (default value: false).
Suppose you have the following target in a test.build file located under C:\temp\MSBuild:
<Target Name="CreateKnowledgeBaseFromServer">
<CreateKnowledgeBaseFromServer
Directory="$(KBPath)"
XmlOutputFile="$(XmlOutputFile)"
DBName="$(DBName)"
ServerInstance="$(ServerInstance)"
IntegratedSecurity="$(IntegratedSecurity)"
UserId="$(UserId)" Password="$(Password)"
CreateDbInKbFolder="$(CreateDbInKbFolder)"
Language="$(Language)"
ServerUri="$(ServerUri)"
ServerKBAlias="$(ServerKBAlias)"
ServerVersionName="$(ServerVersionName)"
/>
</Target>
To create a Knowledge Base from a GeneXus Server you should run something like this:
msbuild.exe /t:CreateKnowledgeBaseFromServer /p: KBPath=c:\Models\myKnowledgeBase; ServerUri=http://MachineName/GeneXusServer/; ServerKBAlias=KnowledgeBaseNameInServer; ServerVersionName=VersionName; /nologo "c:\temp\MSBuild\test.msbuild"
Updates a connected Knowledge Base from its GeneXus Server's hosted Knowledge Base.
This task depends on the OpenKnowledgeBase MSBuild Task.
<UpdateFromServer
OutputFile="$(OutputFile)"
Preview="true|false"
UpdateKbProperties="true|false"
ServerUserName="user"
ServerPassword="password"
ServerToken="token"
VersionName="$(VersionName)"
IncludeItems="$(ObjectList)"
ExcludeItems="$(ObjectList)"
/>
OutputFile: Output file with the operation detail.
Preview: Preview Update or Update operation, default value: false.
UpdateKbProperties: Boolean attribute to enable the update of Knowledge Base properties (default value: false).
ServerUserName: Username used to log in to a secure GeneXus Server (local GeneXus Server user or GeneXus Account user).
ServerPassword: Password used to log in.
ServerToken: Session token used to authenticate and authorize requests.
VersionName: Knowledge Base Version name; by default the trunk is selected.
IncludeItems: Specific objects to be updated (if no object is specified, the default is all).
ExcludeItems: Specific objects not to be updated.
Suppose you have the following target in a test.build file located under C:\temp\MSBuild:
<Target Name="Update" DependsOnTargets="OpenKnowledgeBase">
<UpdateFromServer />
</Target>
Once you have a Knowledge Base created from a GeneXus Server, to update it you could run the following command:
msbuild.exe /t:Update /p:KBPath=c:\Models\myKnowledgeBase "c:\temp\MSBuild\test.msbuild"
Sends the local changes (pending commits) to the GeneXus Server's hosted Knowledge Base.
This task depends on the OpenKnowledgeBase Task.
<Commit
Comments="Comments here"
Objects="$(ObjectList)"
ServerUserName="user"
ServerPassword="password"
ServerToken="token"
CommitEnvironmentProperties="true|false"
CommitKbProperties="true|false"
CommitVersionProperties="true|false"
/>
Comments: A comment detailing the modifications done in this commit operation. REQUIRED
Objects: $(ObjectList) is the list of objects to specify (see the section about Object lists in MSBuild tasks). Unless you use this parameter, all pending objects will be committed.
ServerUserName: Username used to log in. REQUIRED (no token needed)
ServerPassword: Password used to log in. REQUIRED (no token needed)
ServerToken: Session token used to authenticate and authorize requests. REQUIRED (no username or password needed)
CommitKbProperties | CommitVersionProperties | CommitEnvironmentProperties: Boolean attributes to force a commit on Knowledge Base | Version or Environment properties (default value: false).
Sample commit 1:
Suppose you have the following target in a test.build file located under C:\temp\MSBuild:
<Target Name="Commit" DependsOnTargets="OpenKnowledgeBase">
<Commit Comments="$(Comments)" />
</Target>
Once you have a Knowledge Base created from a GeneXus Server, to commit it you could run the following command:
msbuild.exe /t:Commit /p:KBPath=c:\Models\myKnowledgeBase;Comments="Feature X completed" "c:\temp\MSBuild\test.msbuild"
Sample commit 2:
To Commit some objects use the 'Objects' parameter:
<Target Name="Commit" DependsOnTargets="OpenKnowledgeBase">
<Commit
Comments="$(Comments)"
Objects="DataStoreCategory:MyDataStore,Transaction:Customer,Procedure:SalesReport"
/>
</Target>
Publishes a local Knowledge Base to a GeneXus Server instance.
This task depends on the OpenKnowledgeBase Task.
<SendKnowledgeBaseToServer
ServerUri="http://ServerName/GeneXusServer"
ServerKBAlias="MyServerKB"
ServerUserName="user"
ServerPassword="password"
ServerToken="token"
WriteElapsedTime="true|false"
FullKB="true|false"
WWLocks="true|false"
/>
ServerUri: Server URL where GeneXus Server is installed. REQUIRED
ServerKBAlias: Alias of that Knowledge Base in GeneXus Server; must be unique in the server. REQUIRED
ServerUserName: Username used to log in.
ServerPassword: Password used to log in.
ServerToken: Session token used to authenticate and authorize requests.
WriteElapsedTime: Logs the time spent in the task execution.
FullKB: Sends the complete Knowledge Base to GeneXus Server or the selected version (default value: false).
WWLocks: Selects the versioning model; false is associated with Merge mode (default value) and true is related to Lock mode. This property is specific for Xev2 or higher.
Suppose you have the following target in a test.build file located under C:\temp\MSBuild:
<Target Name="SendKBToServer" DependsOnTargets="OpenKnowledgeBase">
<SendKnowledgeBaseToServer ServerUri="$(ServerUri)" ServerKBAlias="$(ServerKBAlias)"/>
</Target>
To send a local Knowledge Base to a GeneXus Server, use the send KB to server MSBuild task running the following command:
msbuild.exe /t:SendKnowledgeBaseToServer /p:KBPath=c:\Models\myKnowledgeBase;
ServerUri=http://ServerName/GeneXusServer/;ServerKBAlias=myKBinTheServer
/nologo "c:\fullgx\MSBuild\test.msbuild"
Locks a list of objects.
This task depends on the OpenKnowledgeBase MSBuild Task.
<LockObjects
Objects="ObjectList"
/>
ObjectList: The object list to be locked. The syntax for specifying the objects is detailed here.
Suppose you have the following target in a test.build file located under C:\temp\MSBuild:
<Target Name="LockObjects" DependsOnTargets="OpenKnowledgeBase">
<LockObjects ServerUserName="$(ServerUserName)" ServerPassword="$(ServerPassword)" Objects="$(Objects)" />
</Target>
To lock an object, execute the following command:
msbuild.exe /t:OpenKnowledgeBase;LockObjects /p:KBPath=c:\Models\myKnowledgeBase;Objects="MyProcedureName" "c:\fullgx\MSBuild\test.msbuild""
Unlocks a list of objects.
This task depends on the OpenKnowledgeBase MSBuild Task.
<UnlockObjects
Objects="ObjectList"
/>
ObjectList: Object list to be unlocked; the syntax to specify the objects is detailed here.
Suppose you have the following target in a test.build file located under C:\temp\MSBuild:
<Target Name="UnlockObjects" DependsOnTargets="OpenKnowledgeBase">
<UnlockObjects ServerUserName="$(ServerUserName)" ServerPassword="$(ServerPassword)" Objects="$(Objects)" />
</Target>
To unlock an object, execute the following command:
msbuild.exe /t:OpenKnowledgeBase;UnlockObjects /p:KBPath=c:\Models\myKnowledgeBase;Objects="MyProcedureName" "c:\fullgx\MSBuild\test.msbuild"
Steals the lock of a selected list of objects.
This task depends on the OpenKnowledgeBase Task.
<StealLocks
Objects="ObjectList"
/>
ObjectList: Object list to steal the lock; the syntax to specify the objects is detailed here.
Suppose you have the following target in a test.build file located under C:\temp\MSBuild:
<Target Name="StealLocks" DependsOnTargets="OpenKnowledgeBase">
<StealLocks ServerUserName="$(ServerUserName)" ServerPassword="$(ServerPassword)" Objects="$(Objects)" />
</Target>
To steal the lock of an object, execute the following command:
msbuild.exe /t:OpenKnowledgeBase;StealLocks /p:KBPath=c:\Models\myKnowledgeBase;Objects="MyProcedureName" "c:\fullgx\MSBuild\test.msbuild"
Creates a new Development Version or Frozen Version to the GeneXus Server's hosted Knowledge Base.
This task depends on the OpenKnowledgeBase MSBuild Task.
<CreateGXserverVersion
ServerUri="$(ServerUri)"
ServerKBAlias="$(KBAlias)"
FromServerVersionName="$(FromVersionName)"
VersionName="$(NewVersionName)"
VersionDescription="$(NewVersionDescription)"
ServerUserName="user"
ServerPassword="password"
ServerToken="token"
IsProtectedVersion="true/false"
/>
ServerUri: URL where GeneXus Server is installed. REQUIRED
ServerKBAlias: Alias of that Knowledge Base in GeneXus Server; must be unique in the server. REQUIRED
FromServerVersionName: The Version from which the new Version will be created. If this Version is a Development Version, a Frozen Version will be created but if this Version is a Frozen Version, a Development Version will be created.
VersionName: The name of the new version to be created.
VersionDescription: A description for the new Version.
ServerUserName: Username used to log in.
ServerPassword: Password used to log in.
ServerToken: Session token used to authenticate and authorize requests.
IsProtectedVersion: Indicates if the new version will be protected.
Suppose you have the following target in a test.build file located under C:\temp\MSBuild:
<<Target Name="CreateNewGXserverVersion" DependsOnTargets="OpenKnowledgeBase">
<CreateGXserverVersion
ServerUri="$(ServerUri)"
ServerKBAlias="$(KBAlias)"
FromServerVersionName="$(FromVersionName)"
VersionName="$(NewVersionName)"
VersionDescription="$(NewVersionDescription)"
ServerUserName="local\admin"
ServerPassword="admin123"
IsProtectedVersion="true"
</Target>
Once you have a Knowledge Base created from a GeneXus Server, to create a new version you could execute the following command:
msbuild.exe /t:CreateNewGXserverVersion /p:KBPath=C:\Models\myKnowledgeBase /p:KBAlias=myKnowledgeBase /p:FromVersionName=myKnowledgeBase /p:NewVersionName=Version1 "c:\temp\MSBuild\test.msbuild"
Gets the last Commit number of a Version on a hosted KB.
This task depends on the OpenKnowledgeBase Task.
<GetLastCommitNumber
VersionName="$(VersionName)"
ServerUserName="user"
ServerPassword="password"
ServerToken="token"
/>
VersionName: The name of the version.
ServerUserName: Username used to log in.
ServerPassword: Password used to log in.
ServerToken: Session token used to authenticate and authorize requests.
Suppose you have the following target in a test.build file located under C:\temp\MSBuild:
<Target Name="GetCommitNumber" DependsOnTargets="OpenKnowledgeBase">
<GetLastCommitNumber
VersionName = "$(KBVersion)"
ServerUserName="local\admin"
ServerPassword = "admin123">
<Output TaskParameter="CommitNumber" PropertyName="CommitNumber"/>
</GetLastCommitNumber>
<Message Text="Last commit number is $(CommitNumber)"/>
</Target>
- The msbuild.exe file is located in the Microsoft .net 4.0 folder, generally c:\Windows\Microsoft.NET\Framework\v4.0.30319.
- All tasks depending on the Target "OpenKnowledgeBase" assume you have something like this in your .msbuild file:
<Target Name="OpenKnowledgeBase">
<OpenKnowledgeBase Directory="$(KBPath)" />
</Target>