Project Build

A Cmobilecom AF project consists of a number of module projects using gradle multi-project build.

Directory structure:


productRootDir/
	web/build.gradle
	web/setting.gradle
	
	web/app/build.gradle
	
	module1/
	module2/
	
	docs/help/
		index.html
		[locale]/index.html
	install
		bundle/
			messages.properties
			messages_[locale].properties
		images/
		install_[os].properties
		seed/
		    seed.xml
		    multitenant/seed.xml
	conf/
		META-INF/persistence.xml
		system-config.xml
		multitenant/
		    META-INF/persistence.xml
		    system-config.xml
	resources/bundle/
		messages.properties
		messages_[locale].properties

	proguard.conf
	LICENSE.txt
	NOTICE.txt
	RELEASE_NOTES.txt
setting.gradle defines subprojects. For example, web root project:
	rootProject.name = 'myapp-web'
	
	include 'app'
	
	include 'module-module1'
	project(':module-module1').projectDir = new File('../module1')
	
	include 'module-module2'
	project(':module-module2').projectDir = new File('../module2')

Root Project

create installer, run installer and deploy applications.

build.gradle

	// define properties before applying root.gradle, see Cmobilecom AF examples.
	apply from : "$cmobilecomAFBuildCommonDir/root.gradle"

App Project

assemble war and proguard war.

build.gradle

	apply from : "${rootProject.cmobilecomAFBuildCommonDir}/app.gradle"

Module Project

create module jars. Module project name must start with "module-".

build.gradle: define module version. For example,

	jar {
		version '1.0'
	}
Define dependencies if any. For example,
	dependencies {
		compile project(':module-module1')
		compile group: 'foo', name: 'bar', version: '1.0'
	}
see Module Development for module directory structure.

see Cmobilecom AF examples README for gradle tasks.

Install

Put installation related files under install/ directory. see Installer on how to create an installer.

Resources

Resource bundle for software introduction and InstanceType display names in system-config.xml. Module assembly bundle base name needs to be specified in system-config.xml. For example,

	<property name="resource.bundle.basename" value="cmobilecom-af-examples.bundle.messages"/>
see Cmobilecom AF examples for more information.