Create a Client/Server Application with Build4D tool
Introducing the latest iteration of the Build4D component, now accessible on GitHub. In previous blog posts, we discussed the possibilities with a compiled project, a component, and a standalone application.
Now you can create a script for your Client/Server application from A to Z. And easily integrate it with continuous integration tools.
Let’s see how.
Create a standalone application with the Build4D component
A new build4D component has been available on GitHub for a few months. It empowers you to effortlessly create a compiled project or a component. Things are getting even better; this new component version will enable you to generate a single-user application, expanding the possibilities for your development workflow.
So with tool4D available since v20, integrating the application generation process into your CI (Continuous Integration) tools has become remarkably convenient.
Let’s delve into the details!
A Tool for 4D Code Execution in CLI
In the development industry, CI/CD has become a standard practice. With each code modification, automated actions such as testing, compilation, building, delivery, and sometimes deployment are generated to ensure the code is high quality and easily integrated into the existing system.
These actions require a tool to execute the necessary code. As 4D developers, we decided to provide a free tool that allows developers to execute elementary actions. This tool is called tool4d, and it streamlines the process of executing necessary actions within the 4D environment.
In this article, we will explore the functionalities of tool4d and how it can be used to enhance your development process.
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:
- Launch a compilation by programming,
- Zip/unzip files and folders with these commands,
- Easily Manage your Application’s Information,
- Headless 4D applications to integrate it into a build tool.
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.
How to take advantage of GitHub actions with 4D
Your project is now on a source control system. This means that managing several versions of your software, monitoring changes, and integrating corrections or new features is much simpler now.
Why not also take advantage of continuous integration?
Starting with 4D v19, you can launch the compilation of your project with a command. As a result, you now have all the building blocks needed to automate your integration chain.
This blog post will give you an example of automation with the GitHub manager and GitHub Actions.
How to automate the compilation
Since 4D v19, you can start the compilation of a project with a simple command. You might be wondering what you can use this for!
Your team may consist of several developers, so why not automate the compilation at each code push on your source control server? It is always easier to identify an error when it is quickly detected.
Another case is when your project consists of several components. You can write a method that compiles, builds, and then copies the component to the host database.
This blog will discuss the different technical points that are very useful to create your own automation tools, along with an example application.
Launch a compilation by programming
In continuous integration systems, every time code is submitted, or on an hourly basis, a compilation of the source code is automatically launched. This approach allows you to check merges on the code management server.
Starting from 4D v19, a new command allows you to launch code compilation, so you can set up this type of system.
Easily Manage your Application’s Information
To build your application, you use the BUILD APPLICATION command with a set of XML keys that allow you to configure the built application. For most of you, this option is enough for application building. However, we want to make sure we meet your specific needs too, so we’ll simplify the BUILD APPLICATION command by splitting it. This will allow for more flexibility while creating applications.
Improving databases tests
As a developer, you’re aware that improving the quality of your developments is often based on unit tests. In order to launch these tests, developers and QA teams need tools to launch 4D databases in different modes (single user / client-server) and distinct environments (Macintosh / Windows).
4D products can already be launched using command line parameters to allow automatic testing or deployment. What if you want to create your own update mechanism or you need to handle a server farm with hundreds of 4D Servers running? Maybe you want to specify which database file to use – or pass parameters on launch …
Contact us
Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!
* Your privacy is very important to us. Please click here to view our Policy