s2jdbc-gen-build.xml のカスタマイズ ( maven 用）

メモ

```xml:s2jdbc-gen-build.xml
<project
	name="projectname"
	default="gen-ddl"
	basedir=".">

	<property
		name="rootpackagename"
		value="rootpackage" />
	<property
		name="entityfilepattern"
		value="rootpackage*/entity/**/*.java" />
	<property
		name="env"
		value="ut" />
	<property
		name="jdbcmanagername"
		value="jdbcManager" />
	<property
		name="projectName"
		value="util" />

	<property
		name="classpathdir"
		value="target/classes" />
	<property
		name="entitypackagename"
		value="entity" />
	<property
		name="namespackagename"
		value="names" />
	<property
		name="javafiledestdir"
		value="src/main/java" />
	<property
		name="testjavafiledestdir"
		value="src/test/java" />
	<property
		name="javafileencoding"
		value="UTF-8" />
	<property
		name="version"
		value="latest" />
	<property
		name="sqlfilepattern"
		value="META-INF/sql/**/*.sql" />
	<property
		name="applyenvtoversion"
		value="false" />
	<property
		name="uses2junit4"
		value="false" />

	<condition
		property="vmarg.encoding"
		value="-Dfile.encoding=UTF-8"
		else="">
		<isset property="eclipse.pdebuild.home" />
	</condition>

	<taskdef
		resource="s2jdbc-gen-task.properties"
		classpath="${maven.set.classpath}" />

	<target name="gen-entity">
		<gen-entity
			rootpackagename="${rootpackagename}"
			entitypackagename="${entitypackagename}"
			javafiledestdir="${javafiledestdir}"
			javafileencoding="${javafileencoding}"
			env="${env}"
			jdbcmanagername="${jdbcmanagername}"
			classpath="${maven.set.classpath}">
			<jvmarg value="${vmarg.encoding}" />
		</gen-entity>
		<javac
			srcdir="${javafiledestdir}"
			destdir="${classpathdir}"
			encoding="${javafileencoding}"
			fork="true"
			debug="on"
			classpath="${maven.set.classpath}">
			<include name="${entityfilepattern}" />
		</javac>
		<refresh projectName="${projectName}" />
	</target>

	<target name="gen-ddl">
		<gen-ddl
			classpathdir="${classpathdir}"
			rootpackagename="${rootpackagename}"
			entitypackagename="${entitypackagename}"
			env="${env}"
			jdbcmanagername="${jdbcmanagername}"
			classpath="${maven.set.classpath}">
			<jvmarg value="${vmarg.encoding}" />
		</gen-ddl>
		<refresh projectName="${projectName}" />
	</target>

	<target name="gen-names">
		<gen-names
			classpathdir="${classpathdir}"
			rootpackagename="${rootpackagename}"
			entitypackagename="${entitypackagename}"
			namespackagename="${namespackagename}"
			javafiledestdir="${javafiledestdir}"
			javafileencoding="${javafileencoding}"
			env="${env}"
			jdbcmanagername="${jdbcmanagername}"
			classpath="${maven.set.classpath}">
			<jvmarg value="${vmarg.encoding}" />
		</gen-names>
		<refresh projectName="${projectName}" />
	</target>

	<target name="gen-sqlfileconstants">
		<gen-sqlfileconstants
			classpathDir="${classpathdir}"
			rootpackagename="${rootpackagename}"
			javafiledestdir="${javafiledestdir}"
			javafileencoding="${javafileencoding}"
			env="${env}"
			jdbcmanagername="${jdbcmanagername}"
			classpath="${maven.set.classpath}">
			<sqlfileset dir="${classpathdir}">
				<include name="${sqlfilepattern}" />
			</sqlfileset>
			<jvmarg value="${vmarg.encoding}" />
		</gen-sqlfileconstants>
		<refresh projectName="${projectName}" />
	</target>

	<target name="gen-service">
		<gen-service
			classpathdir="${classpathdir}"
			rootpackagename="${rootpackagename}"
			entitypackagename="${entitypackagename}"
			namespackagename="${namespackagename}"
			javafiledestdir="${javafiledestdir}"
			javafileencoding="${javafileencoding}"
			env="${env}"
			jdbcmanagername="${jdbcmanagername}"
			classpath="${maven.set.classpath}">
			<jvmarg value="${vmarg.encoding}" />
		</gen-service>
		<refresh projectName="${projectName}" />
	</target>
	
	<target name="gen-entitytest">
		<gen-entitytest
			classpathdir="${classpathdir}"
			rootpackagename="${rootpackagename}"
			entitypackagename="${entitypackagename}"
			namespackagename="${namespackagename}"
			javafiledestdir="${testjavafiledestdir}"
			javafileencoding="${javafileencoding}"
			uses2junit4="${uses2junit4}"
			env="${env}"
			jdbcmanagername="${jdbcmanagername}"
			classpath="${maven.set.classpath}">
			<jvmarg value="${vmarg.encoding}" />
		</gen-entitytest>
		<refresh projectName="${projectName}" />
	</target>
	
	<target name="gen-servicetest">
		<gen-servicetest
			classpathdir="${classpathdir}"
			rootpackagename="${rootpackagename}"
			javafiledestdir="${testjavafiledestdir}"
			javafileencoding="${javafileencoding}"
			uses2junit4="${uses2junit4}"
			env="${env}"
			jdbcmanagername="${jdbcmanagername}"
			classpath="${maven.set.classpath}">
			<jvmarg value="${vmarg.encoding}" />
		</gen-servicetest>
		<refresh projectName="${projectName}" />
	</target>

	<target name="gen-sqlfiletest">
		<gen-sqlfiletest
			classpathdir="${classpathdir}"
			rootpackagename="${rootpackagename}"
			subpackagename="${entitypackagename}"
			javafiledestdir="${testjavafiledestdir}"
			javafileencoding="${javafileencoding}"
			uses2junit4="${uses2junit4}"
			env="${env}"
			jdbcmanagername="${jdbcmanagername}"
			classpath="${maven.set.classpath}">
			<sqlfileset dir="${classpathdir}">
				<include name="${sqlfilepattern}" />
			</sqlfileset>
			<jvmarg value="${vmarg.encoding}" />
		</gen-sqlfiletest>
		<refresh projectName="${projectName}" />
		<antcall target="migrate" />
	</target>

	<target name="migrate">
		<migrate
			classpathdir="${classpathdir}"
			rootpackagename="${rootpackagename}"
			entitypackagename="${entitypackagename}"
			applyenvtoversion="${applyenvtoversion}"
			version="${version}"
			env="${env}"
			jdbcmanagername="${jdbcmanagername}"
			classpath="${maven.set.classpath}">
			<jvmarg value="${vmarg.encoding}" />
		</migrate>
		<refresh projectName="${projectName}" />
	</target>

	<target name="rollback">
		<migrate
			classpathdir="${classpathdir}"
			rootpackagename="${rootpackagename}"
			entitypackagename="${entitypackagename}"
			applyenvtoversion="${applyenvtoversion}"
			version="previous"
			env="${env}"
			jdbcmanagername="${jdbcmanagername}"
			classpath="${maven.set.classpath}">
			<jvmarg value="${vmarg.encoding}" />
		</migrate>
		<refresh projectName="${projectName}" />
	</target>

	<target name="dump">
		<dump-data
			classpathdir="${classpathdir}"
			rootpackagename="${rootpackagename}"
			applyenvtoversion="${applyenvtoversion}"
			entitypackagename="${entitypackagename}"
			env="${env}"
			jdbcmanagername="${jdbcmanagername}"
			classpath="${maven.set.classpath}">
			<jvmarg value="${vmarg.encoding}" />
		</dump-data>
		<refresh projectName="${projectName}" />
	</target>

</project>
```