Automation for GeneratorApp – Building

I’m continuing my previous post about Automation for Java Developers with some comments, basic procedure and some ideas that I have used or I will use in the future. Sense my GeneratorApp tool contains generation functionality not only for Java Frameworks it will need a lot more tools and environments and platforms. I will just need to setup wire things up once I will have the building blocks and very described path of what is needed for it. With this article I will force myself to increase the number of automated actions sense, I am no machine – I too make mistakes – and with these scripts, steps, pseudo-codes in place, I will prevent myself from publishing broken functionality in the future. Also it will bring more documentation about all the features in the GeneratorApp currently has.

The automation of my tool needs in most cases the following steps:

  • Bootstrap Project Zip – Empty project with appropriate structure, configuration, settings and maybe very basic wiring code.
  • Get some Data Model from somewhere – I’ve created several Models with very different cases that are already used in GeneratorApp Android for non-developers, that I’ll probably use to test every upcoming stuff.
  • Update Project files (because of environment settings, or because of the Data Model specifics)
  • Generate Source from the Data Model
  • Compile -> Build -> Package
  • Clean up – source, compilation files, leave only the packaged result, if the last step is included in the Jenkins Job
  • Distribute (optional step)

Here is the full list of Platforms I have planned in the beginning to support in the GeneratorApp. Some of them are very tested and bug-fixed, some are in a phase that is OK – Is working with the initial, internal dummy data model, but didn’t have the time to improve it, especially because, every platform evolves on its own and some stuff gets out of date, and some of the environments are not even started. I’ll write down the progress on each of them and steps for what is required, to get them building (in my internal case – automatically).

SQL – Generates SQL file with create tables, indexes, keys etc.
0) Requirements – Installation of the Database – RDBS or library that the script targets
1) Get Data Model from somewhere (hard-coded/from App site)
2) Create temporary db or file for verification use
3) Execute the SQL and verify there are no errors
4) Drop or remove the test data

PHP_MODELS – Generates php classes (POPO-Plain Old Php Object) that map the database tables
0) Requirements – Apache/PHP/SomeDB(sqlite,mysql) Stack
0.1) Working directory should be exposed by the stack
1) Get Data Model
2) Generate stuff
3) Curl the result files – should not output anything – for syntax error check purpose.
4) clean up

PHP_DATA_ACCESS – Generates Data Access layer/classes using the Php Models – with insert/update/delete/select operations
0, 1, 2, 3, 4) Requirements – Same Requirements+Curl from PHP_MODELS + the first already executed

PHP, PHP_JSON – Generate a layer that exposes the Php Models using the Php Data Access layer to the Web – with a Rest(JSON) interface and a Web Page interface
0) Requirements – Same Requirements from PHP_DATA_ACCESS
1, 2, 3, 4) Curl – for Read/Add/Edit/Delete End Points (with functional checks/tests)

Android_with_Room_Kotlin – Generates All – models, data access, gluing code and fragments and activities with default operations on records of type defined by the user.
The latest and most developed Generator (in the DEV channel, used in the Android Generator for non-Developers. This is the Jenkins Job I have. It has:
0) Requirements – A zipped base project – with standard android app structure, configuration files, some environment setup
1) Download a Data Model from my site
1.1) Update some files and folders in the base project needed for the model
2) Generate code
3) Build for release (obfuscation included)
3.1) Upload APK
4) Clean everything

Android_with_Room – Generates All – models, data access, gluing code and fragments and activities with default operations on records of type defined by the user.
Until the end of 2018 I developed it alongside with the Kotlin Version. I’ll need to replicate the Jenkins Job, but using this as Generator and update it, because I left it and focused on Room With Kotlin..

Android_with_greenDAO – Generates All – models, data access, gluing code and fragments and activities with default operations on records of type defined by the user.
Temporary stopped from development. At the time of writing it was OK with test data models from the Standard Channel of GeneratorApp. It is broken in the DEV channel of the GeneratorApp because of the migration of the generated source code to Android Architecture Components. The step for building will be the same as Android_with_Room_Kotlin

Android_with_greenDAO_Kotlin_incompatible_for_now – Generates All – models, data access, gluing code and fragments and activities with default operations on records of type defined by the user.
(probably permanently) stopped from development because, at the time of researching about it GreenDao Library had it functionality encapsulated with OOP methodologies without exposing APIs from customization and Kotlin generates not exactly the same as Java byte-code which prevented me from from finishing the integration. I Don’t see value in continuing.

Android_with_ObjectBox – Generates All – models, data access, gluing code and fragments and activities with default operations on records of type defined by the user.
Added after a feedback from LinkedIn- temporary stopped from development. At the time of writing it was OK with test data models from the Standard Channel of GeneratorApp. It is broken in the DEV channel of the GeneratorApp because of the migration to source code generation of Android Architecture Components. The step should be the same as Android_with_Room_Kotlin.

Android_with_ObjectBox_Kotlin – Generates All – models, data access, gluing code and fragments and activities with default operations on records of type defined by the user.
Added after a feedback from LinkedIn- temporary stopped from development. At the time of writing it was OK with test data models from the Standard Channel of GeneratorApp. It is broken in the DEV channel of the GeneratorApp because of the migration to source code generation of Android Architecture Components. The step should be the same as Android_with_Room_Kotlin.

FLUTTER_under_development – Generates models, data access layer and widgets for managing the models
0) Requirements – Flutter SDK. The Flutter Command Line has the commands that I’ll probably need. The first, before doing anything is the ‘doctor’.
After it is OK:
0.1) “create” flutter command – for creating project
1) Get a Data Model
2) Generate code
2.1) Update the main.dart – to include the new Widgets
3) ‘build’ flutter command
4) Clean & Remove

JAVA_MODELS – Generates POJO classes – Plain Old Java Objects
0) Requirements – JDK, any working directory will be ok.
Will be tested only for compilation/syntax errors.
1) Get a Data Model
2) Generate Code
3) Compile
4) Clean & Remove

HIBERNATE_MODEL_under_development – Generates Pojos + hibernate mapping XML files.
0) Requirements – JDK, any working directory will be ok.
Will be tested only for compilation/syntax errors.
1) Get a Data Model
2) Generate Code
3) Compile
3.1) Test the mapping files by starting some kind of application that uses hibernate
4) Clean & Remove

JPA_MODEL_under_development – Generates Pojos, but with added JPA annotations (javax.persistence.* – @Entity, @Column, @Id, etc)
0) Requirements – JDK, any working directory will be ok.
Will be tested only for compilation/syntax errors.
1) Get a Data Model
2) Generate Code
3) Compile
3.1) Test the annotation with some kind of application that at scans the JPA models and loads them to the application context
4) Clean & Remove

JDBC – Generates the simplest and minimal in Java bridge between the POJOs and the Database – Data Access Layer
0) Will require JAVA_MODELS and The Databases Systems or libs. Will be tested only for compilation/syntax errors.
1) Get a Data Model
2) Generate Code
3) Compile
3.1) (For Future Development) – Generate/Run Tests
4) Clean & Remove

HIBERNATE_DAO_under_development – Generates Data Access Layer by using the Hibernate API (org.hibernate.* – Session, SessionFactory, CriteriaBuilder, Query)
0) Will require HIBERNATE_MODEL have been run before and The Databases Systems or libs. Will be tested only for compilation/syntax errors.
1) Get a Data Model
2) Generate Code
3) Compile

3.1) (For Future Development) – Generate/Run functional Tests
4) Clean & Remove

JPA_DAO_under_development – Should Generate Standard JPA Data Access Layer. Currently not started.

JSP, JSP_JSON – Exposes the models using JSP Web Pages and Rest Interface using JDBC and POJOs
0) Requirements extend JDBC requirements with a Servlet/JSP container.
1) Get Data Models
2) Generate Code
3) Compile It
3.1) Start container (or use embedded) and Deploy
3.2) Curl the JSP end points to verify all is OK
4) Stop container
4.1) Clean code and binary

GWT_MODELS – Generates POJOs, but with some small Google Web Toolkit additions.
0) Requirements – GWT SDK, an empty bootstrap project
1) Get Data Models
2) Generate Code
3) Compile It – javac + gwt compiler (Ant, CL or Maven script)
4) Clean code and binary


GWT_UI – Generates (or Updates) the GWT Servlet and stub Interfaces
0) Requirements – Same as GWT_MODELS
1) Get Data Models
2) Generate Code
3) Compile It – javac + gwt compiler (Ant, CL or Maven script)
3.1) Start container
3.2) Run as webapp, open at least index page. (for future development) Use Selenium For verification
4) Stop container
4.1) Clean code and binary


JAVA_SWING – Generates a AWT/Swing Java Desktop interface for managing the type of records defined by the user – using the JDBC layer and Java Models
0) Requirements – JAVA_MODEL, JDBC generators run before
1) Get Data Models
2) Generate Code
3) Compile It
3.1) (For Future Development) – Search for Java Swing functional tests
4) Clean

VAADIN – Generates Vaadin v8 Components for managing the type of records defined by the user
0) Requirements – Base (Maven) Project Template JAVA_MODEL, JDBC generators run before
1) Get Data Models
2) Generate Code
3) Compile It
3.1) Start servlet container
3.1) Open app/url
3.2) (for future development) Selenium tests
4) Stop container
4.1) Clean

VAADIN_10 – Generates Vaadin v10 Components for managing the type of records defined by the user
0) Requirements – Base (Maven) Project Template JAVA_MODEL, JDBC generators run before
1) Get Data Models
2) Generate Code
3) Compile It
3.1) Start Servlet container
3.1) Open app/url
3.2) (for future development) Selenium tests
4) Stop container
4.1) Clean

Java_Spring_early_alpha – Generates Spring/Spring Boot/ code – some common stuff, Dao layer if chosen – chosen the Spring Repository Option, Service Layer, and Controller Layer – exposing the app with Web Page and Rest Interfaces
0) Requirements – Base (Maven) Project Template JAVA_MODEL, (JDBC?) generators run before
1) Get Data Models
2) Generate Code
3) Compile It
3.1) Start Spring Boot App
3.1) Open app/url
3.2) (for future development) Selenium tests
4) Stop Spring Boot App
4.1) Clean

ANGULAR – Generates TypeScript code – models, service layer and UI Components – with TypeScript+HTML file. 3 Themes available – Bootstrap, Material and SQ-UI.
0) Requirements – nodeJS/NPM installment, angular framework downloaded, cached whatever possible (so not every test run – will download all the stuff)
1) Get Data Models
2) Create Angular Project
2.1) Move current directory to the app
2.2) install additional libs and themes if necessary
2.3)Generate Code
3) Compile It – for debug/or production
3.1) Run the nodeJS app (have a back-end app generated and started before if needed – like Spring, PHP_Json, JSP_Json, whatever)
4) Stop everything
4.1) Clean up

JSF_PRIMEFACES_DESKTOP_UI_under_development – The Idea was to create a Web Interface using Desktop Targeted – PrimeFace Components. Currently not started

JSF_PRIMEFACES_MOBILE_UI_under_development – The Idea was to create a Web Interface using Mobile Targeted – PrimeFace Components. Currently not started

XAMARIN_early_alpha – Generates C# Code And XML, targeting Mobile Apps(Xamarin.Forms) API/Project Template, for editing records with sqlite plugin. Generates models, Data Stores, ViewModels, List, Detail, Edit Pages (.cs and .xml) files.
0) Requirements – probably will need a Windows OS and base empty project
1) Get Data Models
2) Generate Code
3) Compile It (with a CL command to be searched is it available)
3.1) Start App on emulator (should be started all the time for speed)
3.2) (for future development) In App tests
4) Stop App
4.1) Clean

Swift_FMDB_under_development – generates models and data access layer using the FMDB sqlite library
0) Requirements – will probably require Mac OS
1) Get Data Models
2) Generate Code (on non-Mac just for in-GeneratorApp Bugs)
3) Compile it (with Cl command to be searched for)
4) Clean Up

Swift_Core_Data_early_alpha – generates models and the xmls that Core Data uses (or at least was using) to describe the models that it saves with this Data Framework by Apple.
0) Requirements – will probably require Mac OS
1) Get Data Models
2) Generate Code (on non-Mac just for in-GeneratorApp Bugs)
3) (For future Development) see how to integrate/load the XML directly to xcode/or search for some CL compiler
4) Clean Up

FRAMEWORK7_under_development – Should generate Framework7 Front-End using some Rest/Web back-end. Currently not started.

ReactNative_under_development – Should generate Cross-Platform App using some local sqlite or Rest back-end repo. Currently not started.

NativeScriptJS_under_development – Generates NativeScript simple Js – models, sqlite data access, view models and views(JS+XML) – WIP
0) Requirements – nodeJS/NPM installment, cached whatever possible (so not every test run – will download all the stuff)
1) Get Data Models
2) Create NS Project
2.1) Move current directory to the app
2.2) install additional libs and themes if necessary
2.3)Generate Code
3) Compile It – for debug/or production
3.1) Run the app on a simulator (have a back-end app generated and started before if needed – like Spring, PHP_Json, JSP_Json, whatever)
4) Stop app
4.1) Clean up

NativeScriptAngular_under_development – Same as Angular Generator, but tries to generate NativeScript HTML(XML) UI – WIP
0) Requirements – nodeJS/NPM installment, angular framework downloaded, cached whatever possible (so not every test run – will download all the stuff)
1) Get Data Models
2) Create NS Project
2.1) Move current directory to the app
2.2) install additional libs and themes if necessary
2.3)Generate Code
3) Compile It – for debug/or production
3.1) Run the app on a simulator (have a back-end app generated and started before if needed – like Spring, PHP_Json, JSP_Json, whatever)
4) Stop app
4.1) Clean up

VUE_JS_under_development – Should generate Vue Front-End Components using some Rest/Web back-end. Currently not started.

Legend – The solid green generators are considered ready for automation, the not exactly green will require some small effort or some kind of tuning to make it work, the pink generators are estimated to require a lot of effort and the red generators are considered as stopped from development for now.

Share
Add comment