Smart Mobile Studio
  • News
  • Forums
  • Download
  • Store
  • Showcases
    • Featured demos
    • The Smart Contest 2013, Round 1 – Graphics
  • Documentation
    • Get the book
    • System requirements
    • Prerequisites
    • Getting started
      • Introduction
      • Application architecture
      • The application object
      • Forms and navigation
      • Message dialogs
      • Themes and styles
    • Project types
      • Visual project
      • Game project
      • Console project
    • Layout manager
    • Networking
      • TW3HttpRequest
      • TW3JSONP
      • Loading files
  • About

New build system

Posted on 25.11.2013 by Smart Mobile Studio Team Posted in Developers log, News

At the moment we’re already in the last stage of testing before the next version 2.0 will be released as beta. We hoped to make this happen in November and it still might, but probably at the very end of this month as there are still about 30+ issues that need to be resolved before a beta release. Most of them are tiny things, but there are still some heavy one, that needs more work than others. As you are developers as well, you probably know what we’re talking about…

In the meantime, this post is meant to give you some ideas of what will be possible with the next version. The main topic is about the new build system. With this it is possible to inject custom code at several stage during compilation.

Build Stages

BuildStagesThe different stages available are: Pre-Build, Pre-Link & Post Build. The first stage is executed before any compilation takes place. It can be used to build/copy/pre-process some code that is used by the compiler. This can be useful to update externally generated interfaces to external JS code automatically on each compilation.

The next step is pre-link and takes place  after the JavaScript has been compiled, but before it is embedded or “linked” to an HTML file (or any other context). It can be useful to perform some manual linking of the JavaScript code into any custom format and opens Smart Mobile Studio for a wider use.

The final post-build stage is executed after the build process is (nearly) done. Within this stage the output can be post-processed or uploaded. It might be the most useful stage, as there might be plenty of things you’d like to do with your application. Typical use cases of the post-build would be to upload the entire application to a certain location, typically done via FTP.

graphic_build_botYou may also want to trigger a PhoneGap / Cordova build, resulting in an APK file suited directly for native testing on an Android device. This can then be transmitted to services such as Testdroid to test your app on real devices. Or maybe you only want to backup your code on each compilation…

Build Scripting

Since Smart Mobile Studio uses DelphiWebScript (DWS) for the JavaScript code generation, a powerful script engine to power the IDE comes already for free. The build system not only make use of DWS, but also extends it for the needs in the context of build scripts. Special care has been taken to make the available code compatible to what you know from other Pascal environments such as Delphi / Lazarus.

The least the build script offers is to call system functions. So in case you have already written some batch files, you can just trigger these from the build script. For these needs a close wrapping of the Win API function ShellExecute is available. Similar to Delphi, this is called asynchronously. Which means Smart Mobile Studio immediately returns, so that you can continue working on the code, while the batch file is executed in the background. However, in some cases a synchronous call is required, which at the same time blocks the IDE from continuation. For this case a special command is available called ‘Call’:

procedure Call(FileName: String; Parameters: String = ''; Path: String = '')

IndyFurthermore several classes are available that directly wrap Indy code. At the moment clases for FTP and SMTP are available. These let you upload your project to an FTP server with all the options that Indy offers. Or you can use it to download the latest external JavaScript library from a certain location. Or just check if a newer version is available.

With SMTP you can email the project or only a notification to any address. Or only trigger an automatic notification, that the project has been built. All with the flexibility you are used to from Delphi. While you have high level access to the related classes you can also use custom-tailored functions for typical access such as:

procedure Upload(FileName: String; Host: String; UserName: String = 'anonymous';
  Password: String = 'anonymous'; Path: String = '');

or

procedure SendEmail(Host: String; Recipient: String; Subject: String = '';
  Body: String = ''; Attachment: String = '');

which, due to it’s default parameter can be shortened as well to even simpler function.Build Script

Beside basic internet access, you also have in depth access to some of the TurboPower Abbrevia classes used for zipping. Furthermore it is possible to query information from the project.
At the moment the options for this are limited, but more and more options will be added in the future.

iconDespite being under development as well, some basic access to Cordova is also available. Though it’s recommended to use batch files instead. With Cordova it’s possible to transform any HTML5 app into a native application. While this still uses HTML5 rendered through a browser view for the UI, it extends the possibilities to access the hardware natively.

Future plans

With the next minor updates we plan to refine the build system even further. For example it shall be possible to get basic access to the code to extract symbols, expressions and more. With this (and some yet unpublished code) it is also possible to build a documentation along with the project.

With the next major version we also plan to add support for our own cloud solution, to transfer the app directly to the Smart Mobile Studio ecosystem. But that’s content of another post, some day in the future…

So let’s focus on the upcoming release right now, as it is mandatory to give you all this nice stuff described above!

Build system Deployment script
« Micro-controller programming
Smart Mobile Studio v2.0 (beta) »

Pages

  • About
  • Feature Matrix
  • Forums
  • News
  • Release History
  • Download
  • Showcases
    • The Smart Contest 2013, Round 1 – Graphics
  • Store
  • Documentation
    • Creating your own controls
    • Debugging, exceptions and error handling
    • Differences between Delphi and Smart
    • Get the book
    • Getting started
      • Introduction
      • Local storage, session storage and global storage
      • Application architecture
      • The application object
      • Forms and navigation
      • Message dialogs
      • pmSmart Box Model
      • Themes and styles
    • Layout manager
    • Networking
      • Loading files
      • TW3HttpRequest
      • TW3JSONP
    • Prerequisites
    • Real data, talking to sqLite
    • System requirements
    • Project types
      • Visual project
      • Game project
      • Console project

Archives

  • December 2019
  • December 2018
  • November 2018
  • July 2018
  • June 2018
  • February 2018
  • September 2017
  • April 2017
  • November 2016
  • October 2016
  • September 2016
  • April 2016
  • March 2016
  • January 2016
  • October 2015
  • September 2015
  • July 2015
  • April 2015
  • January 2015
  • December 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • November 2011
  • October 2011
  • September 2011

Categories

  • Announcements (25)
  • Developers log (119)
  • Documentation (26)
  • News (104)
  • News and articles (16)

WordPress

  • Register
  • Log in
  • WordPress

Subscribe

  • Entries (RSS)
  • Comments (RSS)
© Optimale Systemer AS