Build your Compiled Structure or Component with Build4D

With the introduction of the project mode, it’s pretty easy to manipulate the components of your projects.

In the last few feature releases, we have added several functionalities that allow you to create your own build chain adapted to your team, your working methods, and your needs.

For example:

 

To help you create your own build chain or integrate 4D into a continuous integration tool, we have developed a component named Build4D, available on GitHub with the sources.

For this first step, Build4D allows you to create a compiled structure and a component. We will continue to enrich it to enable you to manage a single-user application, client application, or server application.

Build4D component

What’s Continuous Integration (CI)

Continuous integration is a practice that automates a development team’s integration of code changes. The code sources are on a source control server. Each time a developer pushes his code on the repository, a syntax check, a compilation, and unit tests are automatically launched.

New component: Build4D

You can get this new component from GitHub. It is composed of three classes:

  • CompiledProject
  • Component
  • _core

 

The _core class is the base class. It contains all the necessary elementary operations, like compiling, creating the project structure, and creating a 4dz, …

Then the two classes CompiledProject and Component, are based on the _core class. They allow respectively to create of a compiled project and a component.

Compiled structure class

Here is an example of creating a compiled structure with integrated resources and documentation folders:


var
$build : cs.Build4D.CompiledProject
var $settings : Object
var $success : Boolean

$settings:=New object()
$settings.destinationFolder:="Test/"
$settings.buildName:="myProject"

$settings.includePaths:=New collection
$settings.includePaths.push(New object("source"; "Resources/"))

$build:=cs.Build4D.CompiledProject.new($settings)
$success:=$build.build()

And the result:

Finder dialog to show the structure file

Component class

Here is an example of creating a component with the integration of the documentation and the suppression of a folder “Resources/Dev” only for the development:

var $build : cs.Build4D.Component
var $settings : Object
var $success : Boolean

$settings:=New object()
$settings.destinationFolder:="Test/"
$settings.buildName:="myComponent"

$settings.includePaths:=New collection
$settings.includePaths.push(New object("source"; "Documentation/"))

$settings.deletePaths:=New collection
$settings.deletePaths.push("Resources/Dev/")

$build:=cs.Build4D.Component.new($settings)
$success:=$build.build()

Voilà!

blank

Next…

On Github, don’t forget to bookmark this component by clicking on the “star” or to follow the evolutions of this component by clicking on “watch.” You can find in this blog an overview of the exciting features of Github to see and follow the repository of 4D.

Vanessa Talbot
• Product Owner •Vanessa Talbot joined 4D Program team in June, 2014. As a Product Owner, she is in charge of writing the user stories then translating it to functional specifications. Her role is also to make sure that the feature implementation delivered is meeting the customer need.Since her arrival, she has worked to define key features in 4D. She has worked on most of preemptive multi-threading new features and also on a very complex subject: the new architecture for engined application. Vanessa has a degree from Telecom Saint-Etienne. She began her career at the Criminal Research Institute as a developer for the audiovisual department. She has also worked in media and medical fields as expert in technical support, production as well as documenting new features.