As a developer, the use of the term 'build' here isn't that accurate; really what we are talking about is combining, minifying and compressing Javascript.
Unfortunately, an out-of-box installation of MapGuide Fusion 2012 does not include all of the pieces of the puzzle necessary to perform the build. So, the first couple of steps are to sort this out.
Step 1 – Obtain build.xml
You will need to get your hands on the build.xml file. Ideally, get the build.xml file for the version you are running. You can try getting the file from the OSGeo source repository.
Place the build.xml file in the fusion folder.
Step 2 – Download Apache Ant
Download from here. Once downloaded, extract the zip file somewhere on your hard disk.
Step 3 – Create config_dist.json
All you have to do here is copy the config.json file.
copy .\fusion\config.json .\fusion\config_dist.json |
Step 4 – Build it!
Run ant and it performs the build according to the build.xml file
call ..\apache-ant-1.8.2\bin\ant.bat compress |
That's it. Just make sure you have your index.html referencing fusionSF-compressed.js (or fusionSF.js if you prefer – this file makes it easier to debug)
You might be wondering whether all the 'source' files for this build are needed in a production deployment and the answer is they are not. I have a separate blog post here on how to remove these files.
Comments