Install
The installation of buildtemplate occurs once for all the developers on your team. You do not need to install it on everyone's machine. There is two options below...
- installing it on a brand new code base
- installing it on an existing code base
I don't have any source code yet and am starting a project
- Run "java -jar buildtemplate.jar -directory [installdirectory]"
- Check [installdirectory] into your SCM
- Customize bldfiles/ant.properties to your specific project needs
- Have all your developers run [installdirectory]/build from any OS after checking out what you checked in and it will build your app
- To upgrade in the future, just drop in buildtemplate.jar into the tools directory(there is not need to run java -jar again)
- Skip to customization below to add customization
I already have source code. How do I upgrade
This has reportedly taken some people 10 minutes to do!!!
- Run "java -jar buildtemplate.jar -directory [basedir]" where basedir is your existing project directory.
- Erase the [basedir]/input directory. You do not need this. It is just the default directory structure when starting a brand new project.
- Add the property javacode to [basedir]/bldfiles/ant.properties. Set this to where your java source code is. (ie. A com, org, biz, or net folder is usually here like biz.xsoftware.xxxx)
- Add the property lib to [basedir]/bldfiles/ant.properties. Set this to the directory that contains your third party jars. All jars in this folder and subfolders on down will be put in the classpath to compile your application
- Run [basedir]/build from any OS to build your app
- To upgrade in the future, just drop a new buildtemplate.jar in and run build again. No need to run java -jar again. It is just a third party library containing your tools.
Customization
This buildtemplate currently offers two points of customization out of the box. Complete customization can still be obtained by unzipping the jar and replacing files with your own build.xml file and such. These two hooks are dist.xml and release.xml.
The [basedir]/bldfiles/dist.xml is meant to put together your distribution. All properties from ant.properties and directories.txt are passed to this file. Use it to create your zip, rpm, etc. that is specific to your target.
The [basedir]/bldfiles/release.xml is meant to release your distribution. Every project wants to release to a different place by posting jars here, zips there, webpages somewhere else and this is the place to do that.