How to Implement Continuous Integration with 4D: A Step-by-Step Guide
In the world of software development, a new concept has appeared in recent years called “Continuous Integration.” The definition we see or hear everywhere is :
“CI is a process that automates the compilation, testing, and delivery of an application on a regular and frequent basis.”
Having understood this definition, which expresses an interesting and promising process, what do I need to do to implement it in 4D? If you search the Internet, you’ll find that there are many CI tools and frameworks available.
However, there are several prerequisites before using these CI tools.
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!
Build an Application with 4D Commands
Since several versions of 4D, different features have been added to create your own build chain. For example,
- the creation of a “.zip” folder,
- the addition of information such as the copyright on an executable or a “dll”,
- the creation of an “info.plist” file,
- and the new build4D component.
With 4D v20, two new features allow finalizing the creation of a standalone or client/server application in 4D code:
- the addition of an icon to an executable
- the generation of the deployment license file for a server (OEM license only) or a standalone application.
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.
Reduce your 4D apps’ size with these new features
In our ongoing effort to improve the building of 4D applications, we’ve added a few functionalities to 4D v19R5 that you’ll certainly find useful.
The first one is the ability to remove some of the biggest 4D modules from your applications: CEF, Mecab, PHP, Spell Checker, and 4D Updater. If you don’t need some of these modules, you’ll be able to significantly reduce the size of your applications.
We also changed the final directory when you build a compiled structure, in order to accommodate those using multiple compiled versions of the same structure.
As for our Japanese customers, we have merged the Japanese version of 4D and the international one on MacOS.
Let’s delve into the details.
Simplified cross-platform client/server application building on Windows
The release of Silicon Macs had a great impact on the way 4D compiles applications. Before v19, 4D was compiling only for Intel architecture, using the same code on Mac and Windows. But Silicon Macs use a new architecture, and as such 4D needs to compile specifically for Silicon. It affects cross-platform client/server application building.
As long as you build your server on Mac, it’s not much of an issue, as you can compile for both Intel and Silicon platforms. But on Windows, it’s not possible to compile for Silicon Macs. Our current recommendation is to compile the project on Mac for both architectures, and then copy it on a Windows machine before building the server. Unfortunately, for big projects with a lot of data, the copy can take some time.
Secure your app’s resources with a new algorithm
When generating .4dz files, 4D uses a standard zip format by default. If you are a software publisher, you’ll be happy to know that 4D v19 R2 added a feature that allows preventing users of your application from seeing the content of the 4DZ, and therefore from being able to modify it.
4D v19: Evolution of Client/Server Application Building
On Mac, application signature has become a standard, and since Big Sur, you can’t even run unsigned applications. In the past, we published a workaround to build client-server applications running on a Windows server and accepting connections from Mac clients. With the release of 4D v19, we have updated the application building in 4D to handle this case. Here is how you can build a single platform or a cross-platform application in v19.
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.
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