User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

PowerBuilder can create an entire application from the object source files stored in a source code control system without relying on existing PBLs. This has been public knowledge for years, but since I cannot find the article anymore where I read about this for the first time, and since I still see people saying the opposite, I decided to put together this short how-to guide hoping that this information will become searchable.

If someone knows the link to the original article, I will be happy to include it here or even replace this article with the link.

Used tools

If I remember correctly, I used to use this method with the MKS source code control system and PB version 9 or 10. Later, we switched to Subversion, and I have been using it with PBSCC Proxy and PB versions 10, 12.5, 2017, and 2019.

I do not remember what source code control system was used in the original article. Most likely, it was either Subversion or Git, but the proxy was different, probably PushOK. I will use PB 2019 with Subversion and PBSCC Proxy in this guide, but I do not think this method works only with these tools.

Used application

To demo the method, I will be using the PowerBuilder Examples application that is a part of the standard PowerBuilder installation. To make a few points clearer, I slightly changed the folder structure of the target by creating separate folders for each PBL. Also, I copied the target file and other binaries such as pictures to the folder that contains the application. As a result, this is what it looks like in Subversion:

Note, that PBLs are not added to source control: only the object source code (export) files are.

Prerequisites

To create PBL files, PowerBuilder needs to know which objects belong to which library and the names of the PBLs. As you may know, this information is stored in the PBG files named after the PBL files. It is imperative to have correctly formed PBG files along with the object source files under source control.

Starting point (Step 0)

All PowerBuilder needs to know to retrieve and recreate a target from source control is the name of the application object, the name of the PBL file with its relative path where the application is stored, and the name of the target file with its relative path.

To find the name of the application you need to look for a file with the SRA extension, and the name of the corresponding PBG file gives you the name of the PBL. So, in our example, the application name is "examples", the PBL is "pbexamfe\pbexamfe.pbl", and the name of the target is "pbexamfe\pb examples.pbt":

I probably do not need to mention this, because if you are working with Subversion and any SCC proxy you know this, but you will need to create a working copy of your project folder that is under source control. To do that, you need to check out the folder using TortoiseSVN or the SVN command line tool. Other source code control systems may not require this.

Step 1: Create workspace

In PB IDE, click "File", "New", and select "Workspace" in the Workspace tab page. Select a folder where you want to store your project. I created a folder as shown below:

Step 2: Create target

Click "File", "New", and select "Application" in the Target tab page. In the opened window, enter the three bits of information you found out about your application earlier. For our example, it looks as follows (I explicitly created a folder "pbexamfe" under "pbe_article"):

After clicking Finish, I have the following:

Step 3: Connect to Source Control

Right-click the workspace item in the System Tree and select "Properties". Switch to the Source Control tab page. Select your Source Control System and the project folder. In my case, it looks as follows (I selected as "Project" the working copy folder where I checked out the "trunk" folder to):

Click OK and confirm connecting to Source Control.

Step 4: Get target from Source Control

After connecting to Source Control, PB shows that your target and application object are out of sync: