Day 054 - Multiple configurations, build automation and customized codegen
It's amazing where the time goes when you're busy with projects. I thought I'd miss a day or two due to some deadlines, but it's now a dozen days since the last instalment.
But there isn't all that much left to the tutorial - I'm on page 443, and the last page with actual tutorial info is 485, so the end is in sight!Â
The aforementioned page 443 begins a discussion of multiple configurations, where you target different platforms (Windows, Linux, web etc) with the same code base.Â
Of course there are some limitations to targeting multiple platforms, and not all of them are imposed by WinDev. If it were truly easy to write one application and have it available on everything from Windows to Linux to handhelds to browsers then everyone would be doing it. Different operating systems have different capabilities; think of the historical difference between Windows' minimum of two mouse buttons vs the Mac's one mouse button (not as much of an issue these days). Different operating systems also have different user interface widgets, standards, etc.
Things get more complicated when you move to the web. Web servers are architecturally much different from desktop applications, and the connection between the web browser and the web server is much more tenuous than the connection between the desktop application and any data store or other local services it may use. As well, web apps tend to be page - rather than window-oriented.Â
And what about handheld devices? Unless you already have a very simple and small UI, it's unlikely you're going to be able to make a straight port of your application to a phone-size screen. If you're writing for a tablet or some other touch-sensitive device, you also need to accommodate the different ways users interact with a touch screen.Â
But assuming you have some components that can be used across platforms, and further assuming you've written them using the appropriate W language code (it is possible to use native code within a WinDev project, and some W language statements are not available on all platforms), you can pretty easily deploy those components to various platforms.
The WinDev approach
With your project open, go the Project explorer and select the configuration. Right-click and choose New Configuration:
This brings up the new configuration wizard:
There are a lot of different configuration options to explore:
A few of these options caught my eye because I didn't know what they meant. Library appears to refer to a WinDev library, rather than a platform-specific library. But what are RAD patterns and Action plans?Â
When I selected RAD pattern the wizard gave me the option of including any or all of the project elements. When I selected Action plans I was only asked if I wanted to include the one external component.Â
RAD patterns
WinDev comes with basic capabilities for code generation; RAD patterns let you define some aspects of code generation so you can get a generated code that is closer to what you want.Â
I haven't tried this at all, but it looks quite intriguing.
Action plans
I did a little digging and got the general idea that action plans are used in build automation, or in WinDev terms the software factory. You can find the online docs here. Again, I haven't tried any of this, but it's nice to see that WinDev comes with some form of build automation support.Â
Â