FranzMarcus.de


PropertiesC

Introduction

ProeprtiesC is an ant task, that compiles files in java properties format to java source files. The java file contains a class that extends java.util.Properties. The class has setters and getters for all found entries. The found entries are taken as defaults, also.

Download

PropertiesC.jar

Synatx

Attributes:
srcfile: the file to compile
destdir: the target root directory
package: the package name which should be added to the source file

Definition of the task
	<patternset id="PropC-Libary">
		<include name="**/${prj.target.name}.jar"/>
	</patternset>
	
	<path id="PropertiesCTask-Classpath">
		<fileset dir="${PropC.dist.path}">
		    <patternset refid="PropC-Libary"/>
		</fileset>
	</path>

	<target name="-PropCTask" depends="-init">
		<taskdef name="PropertiesC"	classname="de.franzmarcus.tools.properties.ant.PropertiesC">
			<classpath refid="PropertiesCTask-Classpath"/>
		</taskdef>
	</target>
Usage
		<PropertiesC srcfile="${Test.source.path}/de/franzmarcus/tools/properties/resources/FacadeGeneratorTest.properties" destdir="${Test.generate.path}"/>

		<PropertiesC srcfile="${Test.root.path}/FacadeGeneratorTest.properties" destdir="${Test.generate.path}"/>

		<PropertiesC srcfile="${Test.root.path}/FacadeGeneratorTest.properties" package="de.franzmarcus.tools.properties.test" destdir="${Test.generate.path}"/>