Creating a build

From MyMemberSoftware wiki
Jump to: navigation, search

Creating a build or package

For testing and distribution we need to create a build. These builds can then be installed using the component installer of joomla or through the update procedure.

A build (zip file) is created using ant. Ant uses xml scripts to automate procedures much like a bat file used to do, except a lot more complex stuff is possible. A prerequisite is that you have ant installed on your computer. For windows you can use winant or in many cases its a pre-installed plugin for your IDE, like Netbeans or Eclipse. In this demonstration I will use Netbeans.

Netbeans.PNG

In order to create a build you need to go to the root of the project, there is folder called builds/build-files. Here you will find the ant files for creating the builds.

There are 4 xml build files, one for each of the projects (components/plugin) we have. Each build file also has its own .properties file containing the version that was build last. There is also a component-build.properties . This properties file contains information about where the projects are stored on you file system. Before you make a build make sure these settings are correct. The build folder in the file component-builder.properties is the only file that you might need to alter

 #set global properties for this build
 src=/../..                                      <= don't alter this one, its a relative path

 build=d\:/projects/joomla/ledenadmin/build      <= a temporary build folder
 dist=/../../builds                              <= don't alter this one, its a relative path
 components=components                           <= don't alter this one, its a relative path
 admin=administrator/components                  <= don't alter this one, its a relative path
 plugins=plugins/system                          <= don't alter this one, its a relative path
 modules=modules                                 <= don't alter this one, its a relative path
 templates=templates                             <= don't alter this one, its a relative path
 languages_en=language/en-GB                     <= don't alter this one, its a relative path
 languages_nl=language/nl-NL                     <= don't alter this one, its a relative path

The other file you will have to check is build-intcom_ledenadministratie : is the current version number correct ? If the max build version is 6.0.10, then this file has to contain:

#Sat, 09 Jan 2016 15:31:45 +0100
version.major=6
version.minor=0
version.revision=10

After the run-builder is done, this version number will be automtically changed to 11.

Creating the build

Nebeans-build.png

To run a file and create the build do the following. Go the file of the build you want to create, for example build-ledencontributie.xml. Right click with the mouse, on the selected file choose Run Target => run-builder. The script is now executed and a zip file will be created and should say BUILD SUCCESSFUL in the log like depicted below

Snippet of the log

Copying 1 file to D:\apps\xampp\htdocs\ledenadminJ3\builds\updates\ledencontributie
Building zip: D:\apps\xampp\htdocs\ledenadminJ3\builds\updates\ledencontributie\ledencontributie_5.2.20.zip
BUILD SUCCESSFUL (total time: 1 second)

In the folder updates/ledencontributie/ 2 files were created. Upload them to ledenadministratieonline.com/updates/ledencontributie/ You can now upload the newly created build along with the update.xml to the update site.

* ledencontributie_5.2.20.zip
* ledencontributie_update.xml

Commit the changed files to the SVN server.