Team Development MSBuild Tasks

Official Content

Here is the list of GeneXus MSBuild Tasks related to Team Development.

When this MSBuild Tasks are used, the GeneXus.Server.Tasks.targets file have to be imported in the basic script file, adding the following line

<Import Project="C:\Program Files\Artech\GeneXus\GeneXusX\Genexus.Server.Tasks.targets" />

CreateKnowledgeBaseFromServer

Creates a Knowledge Base locally from a Knowledge Base hosted in a GeneXus Server in the specified directory based on a Knowledge Base template.

Syntax:

<CreateKnowledgeBaseFromServer
Directory="kbDirectory" 
  XmlOutputFile="xmlfile"
  CreateDbInKbFolder="true|false"
  DBName="dbName"
  IntegratedSecurity="true|false"
  UserId="userId"
  Password="password"
  Language="language"
  Overwrite="true|false"
  ServerInstance="instance"
  ServerKBAlias="MyKnowledgeBase"
  ServerVersionName="VersionName"
  ServerUserName="user"
  ServerPassword="password"
  WriteElapsedTime="true|false"
  FullKB="true|false"
  UseExistentDB="true|false"
/>

Where:

  • 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: the URL where the GeneXus Server instance is running. REQUIRED
  • ServerInstance: check the ServerInstance property of the CreateKnowledgeBase task.
  • ServerKBAlias: the alias of the Knowledge Base as displayed in the GeneXus  Server's default page. REQUIRED
  • ServerVersionName: the Knowledge Base version name. If not specified the trunk version is assumed.
  • ServerUserName: username used to login in a secure GeneXus Server. The syntax for this property value is <AuthenticationType>\<UserName>, i.e. "gxtechnical\user12" or "local\admin"
  • ServerPassword: password used to login in a secure GeneXus Server.
  • 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).

Samples:

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" 

UpdateFromServer

Updates a connected Knowledge Base from it's GeneXus Server's hosted Knowledge Base.

 

<UpdateFromServer 
  OutputFile="$(OutputFile)"
  Preview="true|false"
  UpdateKbProperties="true|false"
  ServerUserName="user"
  ServerPassword="password"
  VersionName="$(VersionName)"
  IncludeItems="$(ObjectList)"
  ExcludeItems="$(ObjectList)"
/>

Where:

  • 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 login in a secure GeneXus Server (local GeneXus Server user or GeneXus Account user )
  • ServerPassword: password used to log in.
  • VersionName: Knowledge Base Version name, by default the trunk is selected.
  • IncludeItems: Specific the objects to be updated (if no object specified, the default is all).
  • ExcludeItems: Specific the object not to be updated.

This task depends on the OpenKnowledgeBase Task.

Samples:

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:UpdateFromServer /p:KBPath=c:\Models\myKnowledgeBase  "c:\temp\MSBuild\test.msbuild"

Commit

Send the local changes (pending commits) to the GeneXus Server's hosted Knowledge Base.

Syntax :

<Commit 
   Comments="Comments here" 
   Objects="$(ObjectList)"
   ServerUserName="user"
   ServerPassword="password"
   CommitEnvironmentProperties="true|false"
   CommitKbProperties="true|false"
   CommitVersionProperties="true|false"
/>

Where:

  • 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.
  • ServerPassword: password used to log in.
  • CommitKbProperties | CommitVersionProperties | CommitEnvironmentProperties: boolean attributes to force a commit on Knowledge Base | Version or Environment properties (default value: false)

This task depends on the OpenKnowledgeBase Task.

Samples :

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>

SendKnowledgeBaseToServer

Publishes a local Knowledge Base to a GeneXus Server instance.

Syntax:

<SendKnowledgeBaseToServer 
   ServerUri="http://ServerName/GeneXusServer" 
   ServerKBAlias="MyServerKB"
   ServerUserName="user"
   ServerPassword="password"
   WriteElapsedTime="true|false"
   FullKB="true|false"
   WWLocks="true|false"
/>

Where:

  • ServerUri: server URL where the GeneXus Server is installed. REQUIRED
  • ServerKBAlias: the alias of that Knowledge Base in the GeneXus Server; must be unique in the server. REQUIRED
  • ServerUserName: username used to log in.
  • ServerPassword: password used to log in.
  • 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.

This task depends on the OpenKnowledgeBase Task.

Samples :

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"

LockObjects

Locks a list of objects.

Syntax :

<LockObjects
   Objects="ObjectList"
/>

Where :

  • ObjectList: object list to be locked, the syntax to specify the objects is detailed here.

This task depends on the OpenKnowledgeBase Task.

Sample:

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""

UnlockObjects

Unlocks a list of objects.

Syntax :

<UnlockObjects
   Objects="ObjectList"
/>

Where :

  • ObjectList: object list to be unlocked, the syntax to specify the objects is detailed here.

This task depends on the OpenKnowledgeBase Task.

Sample:

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"

StealLocks

Steals the lock of a selected list of objects.

Syntax:

<StealLocks
   Objects="ObjectList"
/>

Where :

  • ObjectList: object list to steal the lock; the syntax to specify the objects is detailed here.

This task depends on the OpenKnowledgeBase Task.

Sample:
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"

CreateGXserverVersion

Creates a new Development Version or Frozen Version to the GeneXus Server's hosted Knowledge Base.

Syntax :

<CreateGXserverVersion
      ServerUri="$(ServerUri)"
      ServerKBAlias="$(KBAlias)"  
      FromServerVersionName="$(FromVersionName)" 
      VersionName="$(NewVersionName)"
      VersionDescription="$(NewVersionDescription)"
      ServerUserName="user"
      ServerPassword="password"
      IsProtectedVersion="true/false"
/>

Where:

  • ServerUri: servURLurl where the GeneXus Server is installed. REQUIRED
  • ServerKBAlias: the alias of that Knowledge Base in the 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: user name used to log in.
  • ServerPassword: password used to log in.
  • IsProtectedVersion: indicates if the new version will be protected.

This task depends on the OpenKnowledgeBase Task.

Samples :

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"

GetLastCommitNumber

Gets the last Commit number of a Version on a hosted KB.

Syntax :

<GetLastCommitNumber
      VersionName = "$(VersionName)"
      ServerUserName="user"
      ServerPassword = "password"
/>

Where :

  • VersionName: the name of the version.
  • ServerUserName: user name used to log in.
  • ServerPassword: password used to log in.


This task depends on the OpenKnowledgeBase Task.

Samples :

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>

Comments

  • The msbuild.exe file is located in the Microsoft .net 2.0 folder, generally C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\.
  • All tasks depending on the Target "OpenKnowledgeBase" assumes you have something like this in your .msbuild file:
<Target Name="OpenKnowledgeBase">
    <OpenKnowledgeBase Directory="$(KBPath)" />
</Target>


Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.