Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ykuwahara committed May 21, 2016
2 parents 0753240 + 6be534e commit ec8c391
Show file tree
Hide file tree
Showing 55 changed files with 1,526 additions and 323 deletions.
206 changes: 120 additions & 86 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,50 @@
basedir="."
default="install">

<!--
javaee7-web
target <= work directory to test archetype > ${workdir}
javaee7-web-min-test-site
javaee7-web-min
pom.xml
distribution
pom.xml <= *1
target
generated-sources/archetype <= output of archetype:create-from-project
and files of new archetype > ${newarchres}
pom.xml <= copy overwrite with *1
src/main/resources
META-INF
archetype-resources <= fillerd javaee7-web-min files > ${archresdir}
pom.xml
src
testscript
tools
-->
<property environment="env" />

<property name="newVersion" value="0.13" />
<input addproperty="artifactId"
validargs="javaee7-web-min,javaee7-web-tips"
defaultvalue="javaee7-web-min" />
<property name="newVersion" value="0.12" />
<property environment="env" />
<property name="workdir" value="${basedir}/target" />

<property name="workdir" value="${basedir}/${artifactId}/target" />
<property name="archresdir"
value="${artifactId}/target/generated-sources/archetype/src"
description="「mvn archetye:create-from-project」コマンドで作成された、アーキタイプとして格納される資源のディレクトリ" />
<property name="newarchdir" value="${workdir}/${artifactId}/newarch" description="新しいアーキタイプを作成するディレクトリ" />
<property name="resdir" value="${newarchdir}/src" />
<property name="db" value="derby" />
value="${artifactId}/target/generated-sources/archetype/src/main/resources/archetype-resources" />
<property name="newarchdir" value="${basedir}/${artifactId}/target/generated-sources/archetype" />

<condition property="test.glassfish">
<equals arg1="${artifactId}" arg2="javaee7-web-min" />
</condition>
<property name="test.site" value="false" />
<property name="test.glassfish" value="false" />
<property name="test.was-liberty" value="true" />
<property name="test.wildfly" value="false" />

<condition property="mvn.cmd" value="${env.MAVEN_HOME}/bin/mvn.cmd" else="/usr/local/bin/mvn">
<os family="windows" />
</condition>

<condition property="glassfish">
<equals arg1="${artifactId}" arg2="javaee7-web-min" />
</condition>


<target name="install">
Expand All @@ -43,59 +67,53 @@

<target name="process-all">
<antcall target="01_create-from-archetype" />
<antcall target="02_copy-archetype-resource" />
<antcall target="02_modify-archetype-resource" />
<antcall target="03_process-archetype" />
<antcall target="04_acceptance-test" />
</target>


<target name="01_create-from-archetype">

<echo message="${basedir}/${archresdir}>mvn clean archetype:create-from-project"/>
<exec executable="${mvn.cmd}" dir="${basedir}/${artifactId}" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="-Darchetype.filteredExtentions=java,xml,txt,groovy,cs,mdo,aj,jsp,gsp,vm,html,xhtml,properties,.classpath,.project,launch,component" />
<arg value="clean" />
<arg value="archetype:create-from-project" />
<arg value="-Darchetype.filteredExtentions=java,xml,txt,groovy,cs,mdo,aj,jsp,gsp,vm,html,xhtml,properties,.classpath,.project,launch,component" />
</exec>

</target>



<target name="02_copy-archetype-resource">

<copy todir="${resdir}">
<fileset dir="${archresdir}">
<exclude name=".git" />
<exclude name=".gitignore" />
<exclude name="/archetype/**" />
<exclude name="generated-sources/archetype/target" />
<exclude name="LICENSE" />
<exclude name="NOTICE" />
<exclude name="README.md" />
<exclude name="**/target/**" />
</fileset>
</copy>

<property name="settings" value="${resdir}/main/resources/archetype-resources/.settings" />


<target name="02_modify-archetype-resource">

<delete dir="${archresdir}/distribution" verbose="true"/>
<delete dir="${archresdir}/tools/derby/target" verbose="true"/>
<delete dir="${archresdir}/tools/mysql/data" verbose="true"/>
<delete dir="${archresdir}/tools/mysql/target" verbose="true"/>
<delete verbose="true">
<fileset dir="${archresdir}" includes="**/.DS_Store"/>
</delete>

<property name="settings" value="${archresdir}/.settings" />
<move todir="${settings}" includeemptydirs="false">
<fileset dir="${settings}" includes="*.launch" />
<globmapper from="${artifactId}*.launch" to="__artifactId__*.launch" />
</move>

<copy file="${basedir}/${artifactId}/distribution/pom.xml" todir="${newarchdir}" />
<copy file="${basedir}/${artifactId}/distribution/pom.xml" todir="${newarchdir}" overwrite="true" />

</target>



<target name="03_process-archetype">

<echo message="${newarchdir}>mvn version:set -DnewVewsion=${newVersion}"/>
<exec executable="${mvn.cmd}" dir="${newarchdir}" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="-DnewVersion=${newVersion}" />
<arg value="versions:set" />
<arg value="-DnewVersion=${newVersion}" />
<arg value="-e"/>
</exec>

<condition property="mvn.phase" value="install">
Expand All @@ -104,29 +122,30 @@
</not>
</condition>

<echo message="${newarchdir}>mvn clean ${mvn.phase} -DperformReleease=${mvn.performRelease}"/>
<exec executable="${mvn.cmd}" dir="${newarchdir}" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="-DperformRelease=${mvn.performRelease}" />
<arg value="clean" />
<arg value="${mvn.phase}" />
<arg value="-DperformRelease=${mvn.performRelease}" />
<arg value="-e"/>
</exec>

</target>


<target name="04_acceptance-test">

<antcall target="test-site"/>
<antcall target="test-glassfish"/>
<antcall target="test-was-liberty"/>
<antcall target="test-wildfly"/>
<antcall target="test-site" />
<antcall target="test-glassfish" />
<antcall target="test-was-liberty" />
<antcall target="test-wildfly" />

</target>


<target name="archetype-generate">

<delete dir="${workdir}/${testArtifactId}"/>


<exec executable="${mvn.cmd}" dir="${workdir}" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="-DarchetypeGroupId=org.sitoolkit.ad.archetype" />
Expand All @@ -142,104 +161,119 @@

</target>


<target name="test-site">

<property name="testArtifactId" value="${artifactId}-test-site"/>
<antcall target="archetype-generate"/>
<target name="test-site" if="${test.site}">

<property name="testArtifactId" value="${artifactId}-test-site" />
<antcall target="archetype-generate" />

<exec executable="${mvn.cmd}" dir="${workdir}/${testArtifactId}">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="-Ddb.port=3307" />
<arg value="-Dmysql=stop" />
</exec>

<exec executable="${mvn.cmd}" dir="${workdir}/${testArtifactId}" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="-Dfile.encoding=UTF-8" />
<arg value="-Ddb.port=1528" />
<arg value="-P${db},db-migrate" />
<arg value="-Ddb.port=3307" />
<arg value="-Dmpir.skip=true" />
<arg value="-Pmysql,db-migrate" />
<arg value="site" />
</exec>

<exec executable="${mvn.cmd}" dir="${workdir}/${testArtifactId}">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="-Dmysql=stop" />
</exec>

</target>


<target name="test-glassfish">

<property name="testArtifactId" value="${artifactId}-test-glassfish"/>
<antcall target="archetype-generate"/>

<exec executable="${mvn.cmd}"
dir="${workdir}/${testArtifactId}"
failonerror="true"
if:set="glassfish">
<target name="test-glassfish" if="${test.glassfish}">

<property name="testArtifactId" value="${artifactId}-test-glassfish" />
<antcall target="archetype-generate" />

<exec executable="${mvn.cmd}" dir="${workdir}/${testArtifactId}" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="-P${db},db-migrate,embedded-glassfish,it" />
<arg value="verify" />
<arg value="-Pderby,db-migrate,embedded-glassfish,it" />
<arg value="-Devidence.open=false" />
<arg value="-Dfile.encoding=UTF-8" />
<arg value="-Ddb.port=1528" />
<arg value="-Das.port=8081" />
<arg value="verify" />
<arg value="-e"/>
</exec>

</target>
<target name="test-was-liberty">
<property name="testArtifactId" value="${artifactId}-test-was-liberty"/>
<antcall target="archetype-generate"/>


<target name="test-was-liberty" if="${test.was-liberty}">

<property name="testArtifactId" value="${artifactId}-test-was-liberty" />
<antcall target="archetype-generate" />

<exec executable="${mvn.cmd}" dir="${workdir}/${testArtifactId}" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="-P${db},db-migrate,was-liberty,it" />
<arg value="verify" />
<arg value="-Pmysql,db-migrate,was-liberty,it" />
<arg value="-Devidence.open=false" />
<arg value="-Dfile.encoding=UTF-8" />
<arg value="-Ddb.port=1529" />
<arg value="-Ddb.port=3308" />
<arg value="-Das.port=8082" />
<arg value="verify" />
<arg value="-e"/>
</exec>

</target>


<target name="test-wildfly">

<property name="testArtifactId" value="${artifactId}-test-wildfly"/>
<antcall target="archetype-generate"/>
<target name="test-wildfly" if="${test.wildfly}">

<property name="testArtifactId" value="${artifactId}-test-wildfly" />
<antcall target="archetype-generate" />

<exec executable="${mvn.cmd}" dir="${workdir}/${testArtifactId}" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<env key="JBOSS_HOME" value="${workdir}/${testArtifactId}/target/wildfly-run/wildfly-10.0.0.Final" />
<arg value="-P${db},db-migrate,wildfly,it" />
<env key="JBOSS_HOME"
value="${workdir}/${testArtifactId}/target/wildfly-run/wildfly-10.0.0.Final" />
<arg value="verify" />
<arg value="-Pderby,db-migrate,wildfly,it" />
<arg value="-Dmaven.test.skip=false" />
<arg value="-Devidence.open=false" />
<arg value="-Dfile.encoding=UTF-8" />
<arg value="-Ddb.port=1530" />
<arg value="-Das.port=8083" />
<arg value="verify" />
<arg value="-e"/>
</exec>

</target>


<target name="set-version">

<exec executable="${mvn.cmd}" dir="${basedir}" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="-DnewVersion=${newVersion}" />
<arg value="versions:set" />
<arg value="clean" />
<arg value="versions:set" />
<arg value="install" />
</exec>

<exec executable="${mvn.cmd}" dir="${basedir}/javaee7-web-min" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="clean" />
<arg value="-DallowSnapshots=true" />
<arg value="versions:update-parent" />
</exec>

<exec executable="${mvn.cmd}" dir="${basedir}/javaee7-web-tips" failonerror="true">
<env key="JAVA_HOME" value="${java.home}" />
<arg value="clean" />
<arg value="-DallowSnapshots=true" />
<arg value="versions:update-parent" />
</exec>

</target>

</project>
6 changes: 5 additions & 1 deletion javaee7-web-min/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
target
/target/
/tools/derby/data/
/tools/hibernate-tools/target
/tools/mysql/data/
/tools/mysql/target
.DS_Store
44 changes: 22 additions & 22 deletions javaee7-web-min/.settings/javaee7-web-min_00_build-all.launch
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
<stringAttribute key="M2_GOALS" value="clean verify"/>
<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
<booleanAttribute key="M2_OFFLINE" value="false"/>
<stringAttribute key="M2_PROFILES" value="db-migrate,derby,was-liberty,it"/>
<listAttribute key="M2_PROPERTIES">
<listEntry value="maven.test.skip=false"/>
</listAttribute>
<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
<intAttribute key="M2_THREADS" value="1"/>
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
<stringAttribute key="M2_USER_SETTINGS" value=""/>
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/javaee7-web-min}"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
<stringAttribute key="M2_GOALS" value="clean verify"/>
<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
<booleanAttribute key="M2_OFFLINE" value="false"/>
<stringAttribute key="M2_PROFILES" value="mysql,db-migrate,was-liberty,it"/>
<listAttribute key="M2_PROPERTIES">
<listEntry value="maven.test.skip=false"/>
</listAttribute>
<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
<intAttribute key="M2_THREADS" value="1"/>
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
<stringAttribute key="M2_USER_SETTINGS" value=""/>
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/javaee7-web-min}"/>
</launchConfiguration>
Loading

0 comments on commit ec8c391

Please sign in to comment.