forked from Coded/SIPRP
git-svn-id: https://svn.coded.pt/svn/SIPRP@1653 bb69d46d-e84e-40c8-a05a-06db0d633741
parent
38bad5f197
commit
38a1a10915
@ -0,0 +1,60 @@
|
|||||||
|
<project name="evo-app-build-common" basedir="../../">
|
||||||
|
|
||||||
|
<import file="evo-app-compile-common.xml" />
|
||||||
|
|
||||||
|
<target name="app-build" description="Compiles all application classes" depends="app-prepare,app-pre-build">
|
||||||
|
<mkdir dir="${app.build.dir}" />
|
||||||
|
<depend srcdir="${app.src.dir}" destdir="${app.build.dir}" cache="${app.dependencies.chache.dir}">
|
||||||
|
<include name="**/*.java" />
|
||||||
|
</depend>
|
||||||
|
<javac srcdir="${app.src.dir}" destdir="${app.build.dir}" classpathref="app.build.classpath" debug="on" deprecation="on" fork="true" memoryMaximumSize="512M" />
|
||||||
|
<antcall target="app-post-build"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="run-codegen" description="Runs codegen for this project" depends="load-properties">
|
||||||
|
<available file="${codegen.project.ant}" property="codegen.project.exists"/>
|
||||||
|
<antcall target="show-codegen-project-error"/>
|
||||||
|
<antcall target="run-codegen-if-project-exists"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="run-codegen-if-project-exists" if="codegen.project.exists">
|
||||||
|
<available file="${codegen.properties.file}" property="codegen.properties.exists"/>
|
||||||
|
<antcall target="show-codegen-properties-error"/>
|
||||||
|
<antcall target="run-codegen-if-exists"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="show-codegen-project-error" unless="codegen.project.exists">
|
||||||
|
<echo message="Codegen's build-file not found at ${codegen.project.ant}"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="run-codegen-if-exists" if="codegen.properties.exists">
|
||||||
|
<ant inheritall="false" antfile="${codegen.project.ant}" target="app-run">
|
||||||
|
<property name="app.run.args" value="${basedir}" />
|
||||||
|
</ant>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="show-codegen-properties-error" unless="codegen.properties.exists">
|
||||||
|
<echo message="Project's codegen configuration file not found at ${codegen.properties.file}"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="run-batch-deployer" description="Batches multiple deploys" depends="load-properties">
|
||||||
|
<path id="deployer.classpath">
|
||||||
|
<fileset dir="${lib.tools.dir}" />
|
||||||
|
<path refid="app.build.classpath" />
|
||||||
|
</path>
|
||||||
|
<java jvmversion="${app.java.version}" classname="${deployer.main}" classpathref="deployer.classpath" fork="true" dir="${app.build.dir}">
|
||||||
|
<arg value="${basedir}"/>
|
||||||
|
</java>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="run-LEAF" description="Runs LEAF for this project" depends="load-properties">
|
||||||
|
<path id="leaf.classpath">
|
||||||
|
<fileset dir="${lib.tools.dir}" />
|
||||||
|
<path refid="app.build.classpath" />
|
||||||
|
</path>
|
||||||
|
<java jvmversion="${app.java.version}" classname="${leaf.main}" classpathref="leaf.classpath" fork="true" dir="${app.build.dir}">
|
||||||
|
<arg value="${app.src.dir}"/>
|
||||||
|
</java>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
<project name="evo-app-build-obfuscate-common" basedir="../../">
|
||||||
|
|
||||||
|
<path id="lib.tools.classpath"/>
|
||||||
|
|
||||||
|
<target name="obfuscate">
|
||||||
|
<taskdef resource="proguard/ant/task.properties" classpath="${app.dir}/lib.tools/proguard.jar" />
|
||||||
|
|
||||||
|
<delete file="${app.deploy.dist.dir}/${evolute.jar.name}" failonerror="false" />
|
||||||
|
|
||||||
|
<proguard printmapping="${app.dir}/${app.name}.map">
|
||||||
|
|
||||||
|
<injar file="${app.lib.dir}/evologger.jar" />
|
||||||
|
<outjar file="${app.deploy.dist.lib.dir}/evologger.jar" />
|
||||||
|
|
||||||
|
<injar file="${app.lib.dir}/evolute.jar" />
|
||||||
|
<outjar file="${app.deploy.dist.lib.dir}/evolute.jar" />
|
||||||
|
|
||||||
|
<injar file="${app.deploy.dist.dir}/${app.jar.name}" />
|
||||||
|
<outjar file="${app.deploy.dist.dir}/${app.jar.name}_guard.jar" />
|
||||||
|
|
||||||
|
<libraryjar file="${evolute.lib.dir}" />
|
||||||
|
<libraryjar file="${app.lib.dir}" />
|
||||||
|
<libraryjar file="${java.home}/lib/jce.jar" />
|
||||||
|
<libraryjar file="${java.home}/lib/jsse.jar" />
|
||||||
|
<libraryjar file="${java.home}/lib/rt.jar" />
|
||||||
|
|
||||||
|
-printseeds
|
||||||
|
-verbose
|
||||||
|
-dontskipnonpubliclibraryclasses
|
||||||
|
|
||||||
|
-keepclasseswithmembers public class * {
|
||||||
|
public static void main(java.lang.String[]);
|
||||||
|
}
|
||||||
|
</proguard>
|
||||||
|
<delete file="${app.deploy.dist.dir}/${app.jar.name}" failonerror="true" />
|
||||||
|
<move file="${app.deploy.dist.dir}/${app.jar.name}_guard.jar" tofile="${app.deploy.dist.dir}/${app.jar.name}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="ProguardTask">
|
||||||
|
<property file="${app.version.file}" prefix="version" />
|
||||||
|
<typedef classpathref="lib.tools.classpath" resource="net/jtools/classloadertask/antlib.xml">
|
||||||
|
<classpath>
|
||||||
|
<path refid="lib.tools.classpath"/>
|
||||||
|
</classpath>
|
||||||
|
</typedef>
|
||||||
|
<classloader loader="project">
|
||||||
|
<classpath>
|
||||||
|
<fileset dir="${lib.tools.dir}" includes="*.jar"/>
|
||||||
|
<fileset dir="${app.lib.dir}" includes="*.jar"/>
|
||||||
|
</classpath>
|
||||||
|
</classloader>
|
||||||
|
<taskdef name="proguardtask" classpathref="lib.tools.classpath" classname="com.evolute.ant.ProguardTask" onerror="ignore" />
|
||||||
|
|
||||||
|
<proguardtask filePath="${app.dir}/${app.name}.map" version="${version.major}.${version.minor}.${version.build}" fileName="${app.name}.map" projectName="${app.name}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="pre-deploy">
|
||||||
|
<antcall target="obfuscate" />
|
||||||
|
<antcall target="ProguardTask" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,108 @@
|
|||||||
|
<project name="evo-app-compile-common" basedir="../../">
|
||||||
|
|
||||||
|
<import file="evo-app-load-properties.xml" />
|
||||||
|
|
||||||
|
<!-- BUILD -->
|
||||||
|
|
||||||
|
<target name="app-post-build" />
|
||||||
|
|
||||||
|
<target name="app-pre-build" />
|
||||||
|
|
||||||
|
<target name="app-build" />
|
||||||
|
|
||||||
|
<target name="cifrar" depends="app-properties-exists" if="app.properties.exists" >
|
||||||
|
<echo message="Encrypting app.properties" />
|
||||||
|
<typedef classpathref="lib.tools.classpath" resource="net/jtools/classloadertask/antlib.xml">
|
||||||
|
<classpath>
|
||||||
|
<path refid="lib.tools.classpath"/>
|
||||||
|
</classpath>
|
||||||
|
</typedef>
|
||||||
|
<classloader loader="project">
|
||||||
|
<classpath>
|
||||||
|
<fileset dir="${lib.tools.dir}" includes="*.jar"/>
|
||||||
|
</classpath>
|
||||||
|
</classloader>
|
||||||
|
<taskdef name="cifrar-props" classpathref="lib.tools.classpath" classname="com.evolute.ant.PropsEncryptorTask" onerror="fail" />
|
||||||
|
<cifrar-props filepath="${properties.dir}${file.separator}app.properties" destpath="${app.build.dir}${file.separator}app.properties"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-properties-exists">
|
||||||
|
<available file="${properties.dir}${file.separator}app.properties" property="app.properties.exists"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-prepare" depends="load-properties">
|
||||||
|
<echo message="Dealing with package-info.java files (ant compilation problem workaround)" />
|
||||||
|
<delete failonerror="false">
|
||||||
|
<fileset dir="${app.build.dir}" includes="**/package-info.java"/>
|
||||||
|
</delete>
|
||||||
|
<echo message="Copying non-java files to build directory" />
|
||||||
|
<copy failonerror="false" overwrite="true" verbose="true" todir="${app.build.dir}" file="${app.version.file}"/>
|
||||||
|
<copy verbose="true" failonerror="true" overwrite="true" todir="${app.build.dir}">
|
||||||
|
<fileset dir="${app.src.dir}">
|
||||||
|
<exclude name="**/*.java" />
|
||||||
|
<exclude name="*.java" />
|
||||||
|
</fileset>
|
||||||
|
<fileset dir="${properties.dir}">
|
||||||
|
<exclude name="app.properties" />
|
||||||
|
<include name="**/*" />
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
<antcall target="cifrar"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-clean" description="Removes all generated files" depends="load-static-properties">
|
||||||
|
<delete verbose="true" failonerror="false">
|
||||||
|
<fileset dir="${app.build.dir}">
|
||||||
|
<include name="**/*" />
|
||||||
|
</fileset>
|
||||||
|
</delete>
|
||||||
|
<delete dir="${app.build.dir}" verbose="true" failonerror="true" />
|
||||||
|
<delete dir="${app.dist.dir}" verbose="true" failonerror="true" />
|
||||||
|
<delete dir="${app.deploy.dist.dir}" verbose="true" failonerror="true" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-run" description="Runs the application" depends="app-build">
|
||||||
|
<java jvmversion="${app.java.version}" classname="${app.main}" maxmemory="${app.max.mem}" classpathref="app.build.classpath" fork="true" dir="${app.build.dir}">
|
||||||
|
<jvmarg value="${jvm.run.args}" />
|
||||||
|
<arg value="${app.run.args}"/>
|
||||||
|
</java>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- JAR -->
|
||||||
|
<target name="app-deploy-create-jar" depends="app-clean, app-build" >
|
||||||
|
<mkdir dir="${app.deploy.dist.dir}" />
|
||||||
|
<jar destfile="${app.deploy.dist.dir}/${app.jar.name}" >
|
||||||
|
<fileset dir="${app.build.dir}">
|
||||||
|
<include name="**/*" />
|
||||||
|
</fileset>
|
||||||
|
</jar>
|
||||||
|
<copy todir="${app.deploy.dist.lib.dir}">
|
||||||
|
<fileset dir="${app.lib.dir}">
|
||||||
|
<include name="**/*" />
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-create-jar" description="Make application Jar" depends="app-clean, app-build" >
|
||||||
|
<pathconvert property="jar.classpath.converted" refid="app.jar.classpath" pathsep=" ">
|
||||||
|
<map from="${app.dir}/" to="" />
|
||||||
|
<map from="${basedir}/" to="" />
|
||||||
|
</pathconvert>
|
||||||
|
<mkdir dir="${app.dist.dir}" />
|
||||||
|
<jar destfile="${app.dist.dir}/${app.jar.name}">
|
||||||
|
<fileset dir="${app.build.dir}">
|
||||||
|
<include name="**/*" />
|
||||||
|
</fileset>
|
||||||
|
<manifest>
|
||||||
|
<attribute name="Main-Class" value="${app.main}" />
|
||||||
|
<attribute name="Class-Path" value="${jar.classpath.converted}" />
|
||||||
|
</manifest>
|
||||||
|
</jar>
|
||||||
|
<copy todir="${app.dist.lib.dir}">
|
||||||
|
<fileset dir="${app.lib.dir}">
|
||||||
|
<include name="**/*" />
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,195 @@
|
|||||||
|
<project name="evo-app-deploy-common" basedir="../../">
|
||||||
|
|
||||||
|
<!-- PROPERTIES -->
|
||||||
|
<property name="properties.key.name" value="name" />
|
||||||
|
<property name="properties.key.major" value="major" />
|
||||||
|
<property name="properties.key.minor" value="minor" />
|
||||||
|
<property name="properties.key.build" value="build" />
|
||||||
|
|
||||||
|
<!-- SETUP -->
|
||||||
|
<target name="prepare-deploy-location">
|
||||||
|
<sshexec trust="yes" host="${app.deploy.server}" username="${deploy.user}" command="sh ${deploy.prepare.script} ${app.name}" password="${deploy.password}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="run-jnlp-task" >
|
||||||
|
<typedef classpathref="lib.tools.classpath" resource="net/jtools/classloadertask/antlib.xml">
|
||||||
|
<classpath>
|
||||||
|
<path refid="lib.tools.classpath"/>
|
||||||
|
</classpath>
|
||||||
|
</typedef>
|
||||||
|
<classloader loader="project">
|
||||||
|
<classpath>
|
||||||
|
<fileset dir="${lib.tools.dir}" includes="*.jar"/>
|
||||||
|
</classpath>
|
||||||
|
</classloader>
|
||||||
|
<taskdef name="generate-jnlp" classpathref="lib.tools.classpath" classname="com.evolute.ant.JNLPGeneratorTask" onerror="ignore"/>
|
||||||
|
<generate-jnlp propertiesDir="${properties.dir}" basedir="${app.dir}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- DEPLOY -->
|
||||||
|
|
||||||
|
<target name="load-properties" />
|
||||||
|
|
||||||
|
<target name="pre-deploy" />
|
||||||
|
|
||||||
|
<target name="ask-deploy.version" unless="deploy.version">
|
||||||
|
<input defaultvalue="" addproperty="deploy.version">
|
||||||
|
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.VersionInputHandler" />
|
||||||
|
</input>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="ask-deploy.jars" unless="deploy.jars">
|
||||||
|
<input defaultvalue="${basedir}:${app.appName}" addproperty="deploy.jars">
|
||||||
|
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.JarInputHandler" />
|
||||||
|
</input>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="ask-deploy.user" unless="deploy.user">
|
||||||
|
<input message="" addproperty="deploy.user">
|
||||||
|
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.UserInputHandler" />
|
||||||
|
</input>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="ask-deploy.password" unless="deploy.password">
|
||||||
|
<input message="password:>" addproperty="deploy.password">
|
||||||
|
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.PasswordInputHandler" />
|
||||||
|
</input>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-deploy-version" if="deploy.version" depends="ask-deploy.jars,ask-deploy.user,ask-deploy.password" >
|
||||||
|
<antcall target="app-deploy-create-jar"/>
|
||||||
|
<antcall target="pre-deploy" />
|
||||||
|
<antcall target="run-jnlp-task" />
|
||||||
|
<condition property="do.abort">
|
||||||
|
<equals arg1="${deploy.jars}" arg2="null"/>
|
||||||
|
</condition>
|
||||||
|
<fail if="do.abort">Deploy cancelled</fail>
|
||||||
|
<antcall target="app-deploy-version-jars"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-version-increase-test">
|
||||||
|
<property name="TESTDEPLOY" value="yes"/>
|
||||||
|
<antcall target="app-version-increase-build"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-version-increase-major">
|
||||||
|
<propertyfile file="${app.version.file}" comment="${app.version.comment}" >
|
||||||
|
<entry key="${properties.key.name}" value="${app.name}"/>
|
||||||
|
<entry key="${properties.key.major}" type="int" operation="+" value="1"/>
|
||||||
|
<entry key="${properties.key.minor}" type="int" operation="=" value="0"/>
|
||||||
|
<entry key="${properties.key.build}" type="int" operation="=" value="0"/>
|
||||||
|
</propertyfile>
|
||||||
|
<antcall target="app-deploy-version"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-version-increase-minor">
|
||||||
|
<propertyfile file="${app.version.file}" comment="${app.version.comment}" >
|
||||||
|
<entry key="${properties.key.name}" value="${app.name}"/>
|
||||||
|
<entry key="${properties.key.major}" type="int" operation="+" value="0"/>
|
||||||
|
<entry key="${properties.key.minor}" type="int" operation="+" value="1"/>
|
||||||
|
<entry key="${properties.key.build}" type="int" operation="=" value="0"/>
|
||||||
|
</propertyfile>
|
||||||
|
<antcall target="app-deploy-version"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-version-increase-build">
|
||||||
|
<propertyfile file="${app.version.file}" comment="${app.version.comment}" >
|
||||||
|
<entry key="${properties.key.name}" value="${app.name}"/>
|
||||||
|
<entry key="${properties.key.major}" type="int" operation="+" value="0"/>
|
||||||
|
<entry key="${properties.key.minor}" type="int" operation="+" value="0"/>
|
||||||
|
<entry key="${properties.key.build}" type="int" operation="+" value="1"/>
|
||||||
|
</propertyfile>
|
||||||
|
<antcall target="app-deploy-version"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="deploy-test" if="TESTDEPLOY">
|
||||||
|
<sshexec trust="yes" host="${app.deploy.server}" username="${deploy.user}" command="sh ${app.deploy.test.script} ${app.name}" password="${deploy.password}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="deploy-production" unless="TESTDEPLOY">
|
||||||
|
<echo message="Deploying to ${deploy.user}@${app.deploy.server}"/>
|
||||||
|
<sshexec failonerror="true" trust="yes" host="${app.deploy.server}" username="${deploy.user}" command="sh ${app.deploy.production.script} ${app.name}" password="${deploy.password}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-deploy-version-jars-user-pass" if="deploy.password">
|
||||||
|
<antcall target="prepare-deploy-location" />
|
||||||
|
<echo message="Uploading files: ${deploy.jars}"/>
|
||||||
|
<scp verbose="yes" todir="${deploy.user}@${app.deploy.server}:${app.deploy.path}" password="${deploy.password}" sftp="true" trust="true" >
|
||||||
|
<fileset dir="${app.deploy.dist.dir}" includes="${deploy.jars}"/>
|
||||||
|
</scp>
|
||||||
|
<echo message="Uploading jnlps"/>
|
||||||
|
<scp verbose="yes" todir="${deploy.user}@${app.deploy.server}:${app.deploy.jnlp.path}" password="${deploy.password}" sftp="true" trust="true" >
|
||||||
|
<fileset dir="${jnlp.dir}" includes="**/*.jnlp"/>
|
||||||
|
</scp>
|
||||||
|
<antcall target="deploy-test"/>
|
||||||
|
<antcall target="deploy-production"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-deploy-version-jars-user" if="deploy.user">
|
||||||
|
<antcall target="app-deploy-version-jars-user-pass"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-deploy-version-jars" if="deploy.jars" >
|
||||||
|
<antcall target="app-deploy-version-jars-user" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-deploy-choose-version" if="deploy.version" >
|
||||||
|
<antcall target="app-version-increase-${deploy.version}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-deploy" description="Deploys application" depends="load-properties,ask-deploy.version">
|
||||||
|
<antcall target="app-deploy-choose-version"/>
|
||||||
|
<antcall target="app-create-software-evo-licensor"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-create-software-evo-licensor" depends="load-properties">
|
||||||
|
<property file="${app.version.file}" prefix="version" />
|
||||||
|
<typedef classpathref="lib.tools.classpath" resource="net/jtools/classloadertask/antlib.xml">
|
||||||
|
<classpath>
|
||||||
|
<path refid="lib.tools.classpath"/>
|
||||||
|
</classpath>
|
||||||
|
</typedef>
|
||||||
|
<classloader loader="project">
|
||||||
|
<classpath>
|
||||||
|
<fileset dir="${lib.tools.dir}" includes="*.jar"/>
|
||||||
|
<fileset dir="${app.lib.dir}" includes="*.jar"/>
|
||||||
|
</classpath>
|
||||||
|
</classloader>
|
||||||
|
<taskdef name="createTask" classpathref="lib.tools.classpath" classname="com.evolute.ant.CreateSoftwareAntTask" onerror="ignore"/>
|
||||||
|
|
||||||
|
<createTask projectVersion="${version.major}.${version.minor}.${version.build}" projectName="${app.name}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- DOCUMENTATION -->
|
||||||
|
|
||||||
|
<target name="docs-generate-upload" description="Generates and uploads the project documentation" depends="load-properties,docs-generate,docs-upload"/>
|
||||||
|
|
||||||
|
<target name="docs-generate">
|
||||||
|
<mkdir dir="${docs.api.dir}"/>
|
||||||
|
<javadoc verbose="true" classpath="lib.docs.classpath" destdir="${docs.api.dir}" docencoding="UTF-8" doctitle="${app.name}" sourcepath="${app.src.dir}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="docs-upload">
|
||||||
|
<input message="" addproperty="deploy.user">
|
||||||
|
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.UserInputHandler" />
|
||||||
|
</input>
|
||||||
|
<input message="password:>" addproperty="deploy.password">
|
||||||
|
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.PasswordInputHandler" />
|
||||||
|
</input>
|
||||||
|
<typedef classpathref="lib.tools.classpath" resource="net/jtools/classloadertask/antlib.xml">
|
||||||
|
<classpath>
|
||||||
|
<path refid="lib.tools.classpath"/>
|
||||||
|
</classpath>
|
||||||
|
</typedef>
|
||||||
|
<classloader loader="project">
|
||||||
|
<classpath>
|
||||||
|
<fileset dir="${lib.tools.dir}" includes="*.jar"/>
|
||||||
|
</classpath>
|
||||||
|
</classloader>
|
||||||
|
<sshexec trust="yes" host="${app.deploy.docs.server}" username="${deploy.user}" command="sh ${app.docs.prepare.script} ${app.name}" password="${deploy.password}" />
|
||||||
|
<scp verbose="yes" todir="${deploy.user}@${app.deploy.docs.server}:${app.deploy.docs.path}" password="${deploy.password}" sftp="true" trust="true" >
|
||||||
|
<fileset dir="${docs.dir}"/>
|
||||||
|
</scp>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,88 @@
|
|||||||
|
<project name="evo-app-load-properties" basedir="../../">
|
||||||
|
|
||||||
|
<property name="properties.base.dir" value="${basedir}/properties" />
|
||||||
|
<property name="lib.tools.dir" value="${basedir}/lib.tools" />
|
||||||
|
|
||||||
|
<path id="lib.tools.classpath">
|
||||||
|
<fileset dir="${lib.tools.dir}" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<target name="load-static-properties" >
|
||||||
|
<property name="app.dir" value="${basedir}" />
|
||||||
|
<property name="evolute.dir" value="${basedir}/../evolute" />
|
||||||
|
<property name="evolute.lib.dir" value="${evolute.dir}/lib" />
|
||||||
|
<property name="evolute.lib.tools.dir" value="${evolute.dir}/lib.tools" />
|
||||||
|
<property name="evolute.ant.dir" value="${evolute.dir}/ant" />
|
||||||
|
<property name="evolute.jar.name" value="evolute.jar" />
|
||||||
|
<property name="docs.dir" value="${app.dir}/docs" />
|
||||||
|
<property name="docs.api.dir" value="${docs.dir}/api" />
|
||||||
|
<property name="app.src.dir" value="${app.dir}/src" />
|
||||||
|
<property name="app.lib.dir" value="${app.dir}/lib" />
|
||||||
|
<property name="deploy.project.relative.lib.dir" value="lib" />
|
||||||
|
<property name="app.dist.dir" value="${app.dir}/dist" />
|
||||||
|
<property name="app.dist.lib.dir" value="${app.dist.dir}/lib" />
|
||||||
|
<property name="app.deploy.dist.dir" value="${app.dir}/deploy" />
|
||||||
|
<property name="app.deploy.dist.lib.dir" value="${app.deploy.dist.dir}/lib" />
|
||||||
|
<property name="app.build.dir" value="${app.dir}/build" />
|
||||||
|
<property name="app.dependencies.chache.dir" value="${app.dir}/dependenciesCache" />
|
||||||
|
<property name="codegen.project.ant" value="${basedir}/../codegen/build.xml"/>
|
||||||
|
<property name="codegen.properties.file" value="${basedir}/properties/codegen.xml"/>
|
||||||
|
<property name="leaf.project.ant" value="${basedir}/../LEAF/build.xml"/>
|
||||||
|
|
||||||
|
<path id="app.jar.classpath">
|
||||||
|
<fileset dir="${app.lib.dir}" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path id="app.build.classpath">
|
||||||
|
<pathelement location="${app.build.dir}" />
|
||||||
|
<path refid="app.jar.classpath" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path id="lib.docs.classpath">
|
||||||
|
<path refid="lib.tools.classpath" />
|
||||||
|
<path refid="app.jar.classpath" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="lib.tools.classpath" />
|
||||||
|
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="load-properties-file" >
|
||||||
|
<property name="properties.dir" value="${properties.base.dir}" />
|
||||||
|
<property file="${properties.dir}/app.properties" />
|
||||||
|
<property file="${properties.dir}/project.properties" />
|
||||||
|
<antcall target="load-static-properties"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="load-properties" depends="load-static-properties,load-properties-file">
|
||||||
|
|
||||||
|
<property name="app.name" value="${app.appName}" />
|
||||||
|
<property name="app.main" value="${app.main-class}" />
|
||||||
|
|
||||||
|
<property name="app.jar.name" value="${app.name}.jar" />
|
||||||
|
<property name="jnlp.dir" value="${app.dir}/jnlp" />
|
||||||
|
<property name="jnlp.extensions.dir" value="${jnlp.dir}/extensions" />
|
||||||
|
<property name="app.java.version" value="${java.version}" />
|
||||||
|
<property name="app.deploy.server" value="www.evolute.pt" />
|
||||||
|
<property name="app.deploy.path" value="/home/software/src_${app.name}" />
|
||||||
|
<property name="app.deploy.jnlp.path" value="${app.deploy.path}/jnlp" />
|
||||||
|
<property name="app.deploy.production.script" value="/home/software/auto_deploy.sh ${app.name}" />
|
||||||
|
<property name="app.deploy.test.script" value="/home/software/auto_test_deploy.sh ${app.name}" />
|
||||||
|
<property name="deploy.prepare.script" value="/home/software/auto_prepare_deploy.sh ${app.name}" />
|
||||||
|
<property name="app.deploy.docs.server" value="${app.deploy.server}" />
|
||||||
|
<property name="app.deploy.docs.path" value="/home/software/public_html/docs/${app.name}" />
|
||||||
|
<property name="app.docs.prepare.script" value="/home/software/auto_prepare_docs_upload.sh" />
|
||||||
|
|
||||||
|
<property name="app.version.file" value="${properties.base.dir}/version.properties" />
|
||||||
|
<property name="app.version.comment" value="${app.name} versioning file" />
|
||||||
|
<property name="app.run.args" value="" />
|
||||||
|
<property name="jvm.run.args" value="-XX:-UseGCOverheadLimit" />
|
||||||
|
<property name="app.ws.wsdl.url" value="${app.ws.wsdl.url.protocol}://${app.ws.wsdl.url.host}:${app.ws.wsdl.url.port}${app.ws.wsdl.url.path}" />
|
||||||
|
|
||||||
|
<property name="app.max.mem" value="512M" />
|
||||||
|
|
||||||
|
<property name="leaf.main" value="com.evolute.leaf.Main" />
|
||||||
|
<property name="deployer.main" value="com.evolute.deploy.Main" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
<project name="evo-app-multiple-client-common" basedir="../../">
|
||||||
|
|
||||||
|
<target name="load-properties-file" depends="ask-target">
|
||||||
|
<property file="${properties.dir}/app.properties" />
|
||||||
|
<property file="${properties.dir}/project.properties" />
|
||||||
|
<property file="${properties.base.dir}/app.properties" />
|
||||||
|
<property file="${properties.base.dir}/project.properties" />
|
||||||
|
<copy verbose="true" failonerror="true" overwrite="true" todir="${basedir}/build">
|
||||||
|
<fileset dir="${properties.dir}">
|
||||||
|
<include name="*" />
|
||||||
|
<include name="**/*" />
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="ask-target" unless="properties.dir">
|
||||||
|
<input defaultvalue="${properties.base.dir}" addproperty="properties.dir">
|
||||||
|
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.ProjectClientInputHandler" />
|
||||||
|
</input>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,113 @@
|
|||||||
|
<project name="evo-app-build-5" basedir="../">
|
||||||
|
|
||||||
|
<import file="common/evo-app-load-properties.xml" />
|
||||||
|
<import file="common/evo-app-deploy-common.xml" />
|
||||||
|
|
||||||
|
<!-- CLASSPATH -->
|
||||||
|
<path id="app.jar.classpath">
|
||||||
|
<fileset dir="${app.lib.dir}" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path id="app.build.classpath">
|
||||||
|
<path refid="app.jar.classpath" />
|
||||||
|
<pathelement location="${app.build.dir}" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path id="svn.classpath">
|
||||||
|
<fileset dir="${evolute.lib.tools.dir}" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path id="jsch.classpath">
|
||||||
|
<fileset dir="${evolute.lib.tools.dir}" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path id="lib.tools.classpath">
|
||||||
|
<fileset dir="${lib.tools.dir}" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<!-- BUILD -->
|
||||||
|
<target name="app-prepare" depends="load-properties">
|
||||||
|
<echo message="Copying non-java files to build directory" />
|
||||||
|
<copy todir="${app.build.dir}">
|
||||||
|
<fileset dir="${app.src.dir}">
|
||||||
|
<exclude name="**/*.java" />
|
||||||
|
<exclude name="*.java" />
|
||||||
|
</fileset>
|
||||||
|
<fileset dir="${properties.dir}">
|
||||||
|
<include name="*" />
|
||||||
|
<include name="**/*" />
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-build" description="Compiles all application classes" depends="app-prepare">
|
||||||
|
<mkdir dir="${app.build.dir}" />
|
||||||
|
<depend srcdir="${app.src.dir}" destdir="${app.build.dir}" cache="${app.dependencies.chache.dir}">
|
||||||
|
<include name="**/*.java" />
|
||||||
|
</depend>
|
||||||
|
<javac srcdir="${app.src.dir}" destdir="${app.build.dir}" classpathref="app.build.classpath" debug="on" deprecation="on" fork="true" memoryMaximumSize="512M" source="1.5" target="1.5" />
|
||||||
|
<antcall target="app-datanucleus"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-datanucleus">
|
||||||
|
<path id="jpox.enhancer.classpath">
|
||||||
|
<fileset dir="${lib.tools.dir}" />
|
||||||
|
<path refid="app.build.classpath" />
|
||||||
|
</path>
|
||||||
|
<taskdef name="jpoxEnhancer" description="JPOX Enhancer" classpathref="jpox.enhancer.classpath" classname="org.datanucleus.enhancer.tools.EnhancerTask" />
|
||||||
|
<jpoxEnhancer maxmemory="256M" classpathref="jpox.enhancer.classpath" dir="${app.build.dir}" verbose="true"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-clean" description="Removes all generated files">
|
||||||
|
<delete failonerror="false">
|
||||||
|
<fileset dir="${app.build.dir}">
|
||||||
|
<include name="**/*" />
|
||||||
|
</fileset>
|
||||||
|
</delete>
|
||||||
|
<delete dir="${app.build.dir}" failonerror="false" />
|
||||||
|
<delete dir="${app.dist.dir}" failonerror="false" />
|
||||||
|
<delete dir="${app.deploy.dist.dir}" failonerror="false" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-run" description="Runs the application" depends="app-build">
|
||||||
|
<java classname="${app.main}" classpathref="app.build.classpath" fork="true" dir="${app.build.dir}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- JAR -->
|
||||||
|
<target name="app-deploy-create-jar" depends="app-clean, app-build" >
|
||||||
|
<mkdir dir="${app.deploy.dist.dir}" />
|
||||||
|
<jar destfile="${app.deploy.dist.dir}/${app.jar.name}" >
|
||||||
|
<fileset dir="${app.build.dir}">
|
||||||
|
<include name="**/*" />
|
||||||
|
</fileset>
|
||||||
|
</jar>
|
||||||
|
<copy todir="${app.deploy.dist.lib.dir}">
|
||||||
|
<fileset dir="${app.lib.dir}">
|
||||||
|
<include name="**/*" />
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-create-jar" description="Make application Jar" depends="app-clean, app-build" >
|
||||||
|
<pathconvert property="jar.classpath.converted" refid="app.jar.classpath" pathsep=" ">
|
||||||
|
<map from="${app.dir}/" to="" />
|
||||||
|
<map from="${basedir}/" to="" />
|
||||||
|
</pathconvert>
|
||||||
|
<mkdir dir="${app.dist.dir}" />
|
||||||
|
<jar destfile="${app.dist.dir}/${app.jar.name}">
|
||||||
|
<fileset dir="${app.build.dir}">
|
||||||
|
<include name="**/*" />
|
||||||
|
</fileset>
|
||||||
|
<manifest>
|
||||||
|
<attribute name="Main-Class" value="${app.main}" />
|
||||||
|
<attribute name="Class-Path" value="${jar.classpath.converted}" />
|
||||||
|
</manifest>
|
||||||
|
</jar>
|
||||||
|
<copy todir="${app.dist.lib.dir}">
|
||||||
|
<fileset dir="${app.lib.dir}">
|
||||||
|
<include name="**/*" />
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
<project name="evo-app-build-jdo" basedir="../">
|
||||||
|
|
||||||
|
<import file="common/evo-app-compile-common.xml" />
|
||||||
|
<import file="common/evo-app-deploy-common.xml" />
|
||||||
|
|
||||||
|
<target name="app-build" description="Compiles all application classes" depends="app-prepare,app-pre-build">
|
||||||
|
<mkdir dir="${app.build.dir}" />
|
||||||
|
<depend srcdir="${app.src.dir}" destdir="${app.build.dir}" cache="${app.dependencies.chache.dir}">
|
||||||
|
<include name="**/*.java" />
|
||||||
|
</depend>
|
||||||
|
<javac srcdir="${app.src.dir}" destdir="${app.build.dir}" classpathref="app.build.classpath" debug="on" deprecation="on" fork="true" memoryMaximumSize="512M" />
|
||||||
|
<antcall target="app-datanucleus"/>
|
||||||
|
<antcall target="app-post-build"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="app-datanucleus">
|
||||||
|
<path id="jpox.enhancer.classpath">
|
||||||
|
<fileset dir="${lib.tools.dir}" />
|
||||||
|
<path refid="app.build.classpath" />
|
||||||
|
</path>
|
||||||
|
<taskdef name="jpoxEnhancer" description="JPOX Enhancer" classpathref="jpox.enhancer.classpath" classname="org.datanucleus.enhancer.tools.EnhancerTask" />
|
||||||
|
<jpoxEnhancer maxmemory="256M" classpathref="jpox.enhancer.classpath" dir="${app.build.dir}" verbose="true"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
<project name="evo-app-build-obfuscate-jdo" basedir="../">
|
||||||
|
|
||||||
|
<import file="common/evo-app-compile-common.xml" />
|
||||||
|
<import file="common/evo-app-deploy-common.xml" />
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
<project name="evo-app-build-obfuscate" basedir="../">
|
||||||
|
|
||||||
|
<import file="common/evo-app-build-common.xml" />
|
||||||
|
<import file="common/evo-app-build-obfuscate-common.xml" />
|
||||||
|
<import file="common/evo-app-deploy-common.xml" />
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
<project name="evo-app-build" basedir="../">
|
||||||
|
|
||||||
|
<import file="common/evo-app-build-common.xml" />
|
||||||
|
<import file="common/evo-app-deploy-common.xml" />
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
<project name="evo-app-multiple-client-build" basedir="../">
|
||||||
|
|
||||||
|
<import file="common/evo-app-multiple-client-common.xml" />
|
||||||
|
<import file="common/evo-app-build-common.xml" />
|
||||||
|
<import file="common/evo-app-deploy-common.xml" />
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
<project name="evo-app-multiple-client-build" basedir="../">
|
||||||
|
|
||||||
|
<import file="common/evo-app-multiple-client-common.xml" />
|
||||||
|
<import file="evo-app-build-obfuscate.xml" />
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
<project name="evo-app-ws-client-build" basedir="../">
|
||||||
|
|
||||||
|
|
||||||
|
<import file="common/evo-app-build-common.xml" />
|
||||||
|
|
||||||
|
<path id="jaxws.classpath">
|
||||||
|
<path refid="lib.tools.classpath"/>
|
||||||
|
<pathelement location="${java.home}/../lib/tools.jar" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<target name="receitas-gen-client" depends="app-build" description="generates client">
|
||||||
|
<taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport" onerror="ignore">
|
||||||
|
<classpath refid="lib.tools.classpath" />
|
||||||
|
</taskdef>
|
||||||
|
<java fork="false" classname="com.evolute.ssl.InstallCert" classpathref="app.build.classpath">
|
||||||
|
<arg value="${app.ws.wsdl.url.host}"/>
|
||||||
|
<arg value="${app.ws.wsdl.url.port}"/>
|
||||||
|
<arg value="${app.ssl.truststore.file}"/>
|
||||||
|
<arg value="${app.ssl.truststore.pass}"/>
|
||||||
|
<arg value="true"/>
|
||||||
|
<arg value="true"/>
|
||||||
|
</java>
|
||||||
|
<wsimport fork="false" debug="true" verbose="true" keep="true" sourcedestdir="${app.src.dir}" package="${app.ws.dest.package}" wsdl="${app.ws.wsdl.url}">
|
||||||
|
<jvmarg value="-Djavax.net.ssl.trustStore=${basedir}/jssecacerts" />
|
||||||
|
<jvmarg value="-Djavax.net.ssl.trustStorePassword=changeit" />
|
||||||
|
<jvmarg value="-Djavax.net.ssl.keyStore=${basedir}/jssecacerts" />
|
||||||
|
<jvmarg value="-Djavax.net.ssl.keyStorePassword=changeit" />
|
||||||
|
</wsimport>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
<project name="evo-gwt-library-build" default="library-deploy" basedir="../">
|
||||||
|
|
||||||
|
<target name="app-pre-build">
|
||||||
|
<copy verbose="true" failonerror="true" overwrite="true" todir="${app.build.dir}">
|
||||||
|
<fileset dir="${app.src.dir}">
|
||||||
|
<include name="**/*.java" />
|
||||||
|
<include name="*.java" />
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<import file="evo-library-build.xml" />
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
<project name="evo-library-build" default="library-deploy" basedir="../">
|
||||||
|
|
||||||
|
<import file="common/evo-app-build-common.xml" />
|
||||||
|
|
||||||
|
<target name="deploy-default-project" depends="app-create-jar">
|
||||||
|
<mkdir dir="${deploy.project.dir}${file.separator}${deploy.project.relative.lib.dir}"/>
|
||||||
|
<copy failonerror="false" verbose="true" file="${app.dist.dir}/${app.jar.name}" toDir="${deploy.project.dir}${file.separator}${deploy.project.relative.lib.dir}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="deploy-project" if="deploy.project.dir">
|
||||||
|
<antcall target="deploy-default-project" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="library-deploy" description="Deploys current version of evolute utilities" depends="load-static-properties">
|
||||||
|
<input defaultvalue="${basedir}" addproperty="deploy.project.dir">
|
||||||
|
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.ProjectInputHandler" />
|
||||||
|
</input>
|
||||||
|
<antcall target="deploy-project" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
<project name="evo-tool-build" default="tool-deploy" basedir="../">
|
||||||
|
|
||||||
|
<import file="common/evo-app-build-common.xml" />
|
||||||
|
|
||||||
|
<target name="deploy-default-tool" depends="app-create-jar">
|
||||||
|
<mkdir dir="${deploy.project.dir}/lib.tools"/>
|
||||||
|
<copy failonerror="false" verbose="true" file="${app.dist.dir}/${app.jar.name}" toDir="${deploy.project.dir}/lib.tools" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="deploy-to-project" if="deploy.project.dir">
|
||||||
|
<antcall target="deploy-default-tool" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="tool-deploy" description="Deploys current version of evolute utilities" depends="load-static-properties">
|
||||||
|
<input defaultvalue="${basedir}" addproperty="deploy.project.dir">
|
||||||
|
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.ProjectInputHandler" />
|
||||||
|
</input>
|
||||||
|
<antcall target="deploy-to-project" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -1,71 +1,141 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- You may freely edit this file. See commented blocks below for -->
|
<project name="PlanosActuacao" basedir=".">
|
||||||
<!-- some examples of how to customize the build. -->
|
|
||||||
<!-- (If you delete it and reopen the project it will be recreated.) -->
|
<import file="ant/evo-app-build.xml" />
|
||||||
<!-- By default, only the Clean and Build commands use this build script. -->
|
|
||||||
<!-- Commands such as Run, Debug, and Test only use this build script if -->
|
<!-- COMMON PROPERTIES -->
|
||||||
<!-- the Compile on Save feature is turned off for the project. -->
|
<property name="lib.tools.dir" value="${basedir}/lib.tools" />
|
||||||
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
|
|
||||||
<!-- in the project's Project Properties dialog box.-->
|
<!-- CIM WEB PROPERTIES -->
|
||||||
<project name="PlanosActuacao" default="default" basedir=".">
|
<property name="web.name" value="PlanosActuacao" />
|
||||||
<description>Builds, tests, and runs the project PlanosActuacao.</description>
|
<property name="web.dir" value="${basedir}" />
|
||||||
<import file="nbproject/build-impl.xml"/>
|
<property name="web.src.dir" value="${web.dir}/src" />
|
||||||
|
<property name="web.lib.dir" value="${web.dir}/lib" />
|
||||||
|
<property name="web.build.dir" value="${web.dir}/build" />
|
||||||
|
<property name="web.build.classes.dir" value="${web.build.dir}/classes" />
|
||||||
|
<property name="web.build.WEB-INF.dir" value="${web.build.dir}/WEB-INF" />
|
||||||
|
<property name="web.dist.dir" value="${web.dir}/dist" />
|
||||||
|
<property name="web.contents.dir" value="${web.dir}/web" />
|
||||||
|
<property name="web.warfile" value="${web.name}.war" />
|
||||||
|
<property name="web.WEB-INF.dir" value="${web.dir}/web/WEB-INF" />
|
||||||
|
<property name="web.xmlfile" value="web.xml" />
|
||||||
|
<property name="web.dependencies.chache.dir" value="${basedir}/temp" />
|
||||||
|
|
||||||
|
<property name="app.build.dir" value="${web.build.classes.dir}" />
|
||||||
|
<property name="properties.dir" value="${basedir}/properties" />
|
||||||
|
|
||||||
|
<!-- TOMCAT MANAGER PROPERTIES -->
|
||||||
|
|
||||||
|
<property name="url" value="http://localhost:8080/manager" />
|
||||||
|
<property name="username" value="tomcat" />
|
||||||
|
<property name="password" value="tomcat" />
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
<property name="url" value="http://www.evolute.pt:12080/manager" />
|
||||||
|
<property name="username" value="admin" />
|
||||||
|
<property name="password" value="evo-cimcp-manager" />
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- COMMON CLASSPATHS -->
|
||||||
|
|
||||||
|
<path id="jpox.enhancer.classpath">
|
||||||
|
<fileset dir="${lib.tools.dir}" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path id="catalina.path">
|
||||||
|
<fileset dir="${lib.tools.dir}">
|
||||||
|
<include name="catalina-ant.jar" />
|
||||||
|
</fileset>
|
||||||
|
</path>
|
||||||
|
|
||||||
|
|
||||||
There exist several targets which are by default empty and which can be
|
<!-- TOMCAT TASKS (from catalina-ant.jar) -->
|
||||||
used for execution of your tasks. These targets are usually executed
|
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask" classpathref="catalina.path" />
|
||||||
before and after some main targets. They are:
|
<taskdef name="list" classname="org.apache.catalina.ant.ListTask" classpathref="catalina.path" />
|
||||||
|
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask" classpathref="catalina.path" />
|
||||||
-pre-init: called before initialization of project properties
|
<taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask" classpathref="catalina.path" />
|
||||||
-post-init: called after initialization of project properties
|
<taskdef name="roles" classname="org.apache.catalina.ant.RolesTask" classpathref="catalina.path" />
|
||||||
-pre-compile: called before javac compilation
|
<taskdef name="start" classname="org.apache.catalina.ant.StartTask" classpathref="catalina.path" />
|
||||||
-post-compile: called after javac compilation
|
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask" classpathref="catalina.path" />
|
||||||
-pre-compile-single: called before javac compilation of single file
|
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask" classpathref="catalina.path" />
|
||||||
-post-compile-single: called after javac compilation of single file
|
|
||||||
-pre-compile-test: called before javac compilation of JUnit tests
|
<!-- WEB CLASSPATHS -->
|
||||||
-post-compile-test: called after javac compilation of JUnit tests
|
<path id="web.jar.classpath">
|
||||||
-pre-compile-test-single: called before javac compilation of single JUnit test
|
<fileset dir="${web.lib.dir}" />
|
||||||
-post-compile-test-single: called after javac compilation of single JUunit test
|
<fileset dir="${lib.tools.dir}">
|
||||||
-pre-dist: called before archive building
|
<include name="servlet-api.jar" />
|
||||||
-post-dist: called after archive building
|
</fileset>
|
||||||
-post-clean: called after cleaning build products
|
</path>
|
||||||
-pre-run-deploy: called before deploying
|
|
||||||
-post-run-deploy: called after deploying
|
<path id="web.build.classpath">
|
||||||
|
<path refid="web.jar.classpath" />
|
||||||
Example of pluging an obfuscator after the compilation could look like
|
<pathelement location="${web.build.classes.dir}" />
|
||||||
|
</path>
|
||||||
<target name="-post-compile">
|
|
||||||
<obfuscate>
|
<!-- WEB TARGETS -->
|
||||||
<fileset dir="${build.classes.dir}"/>
|
<target name="web-prepare">
|
||||||
</obfuscate>
|
<mkdir dir="${web.build.WEB-INF.dir}" />
|
||||||
|
<copy todir="${web.build.classes.dir}">
|
||||||
|
<fileset dir="${web.src.dir}">
|
||||||
|
<!-- <include name="**/*.properties" /> -->
|
||||||
|
</fileset>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<fileset dir="${web.properties.dir}">
|
||||||
|
<include name="app.properties" />
|
||||||
|
</fileset>
|
||||||
|
-->
|
||||||
|
</copy>
|
||||||
|
<copy todir="${web.build.WEB-INF.dir}">
|
||||||
|
<fileset dir="${web.contents.dir}">
|
||||||
|
<exclude name="**/web.xml" />
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
<echo message="Copying configuration files to build directory" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
For list of available properties check the imported
|
<target name="web-build" description="Compiles all application classes" depends="web-prepare, cifrar">
|
||||||
nbproject/build-impl.xml file.
|
<mkdir dir="${web.build.classes.dir}" />
|
||||||
|
<depend srcdir="${web.src.dir}" destdir="${web.build.classes.dir}"
|
||||||
|
cache="${web.dependencies.chache.dir}">
|
||||||
|
<include name="**/*.java"/>
|
||||||
|
</depend>
|
||||||
|
<javac srcdir="${web.src.dir}" destdir="${web.build.classes.dir}" classpathref="web.build.classpath" debug="on" deprecation="on" fork="true" memoryMaximumSize="512M" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="web-clean" description="Removes all generated files">
|
||||||
|
<delete failonerror="false">
|
||||||
|
<fileset dir="${web.build.dir}" />
|
||||||
|
</delete>
|
||||||
|
<delete dir="${web.build.dir}" failonerror="false" />
|
||||||
|
<delete file="${web.dist.dir}/${web.warfile}" failonerror="false" />
|
||||||
|
</target>
|
||||||
|
|
||||||
Other way how to customize the build is by overriding existing main targets.
|
<target name="web-makeWar" depends="web-build">
|
||||||
The target of interest are:
|
<mkdir dir="${web.dist.dir}" />
|
||||||
|
<war destfile="${web.dist.dir}/${web.warfile}" webxml="${web.WEB-INF.dir}/${web.xmlfile}">
|
||||||
|
<fileset dir="${web.build.WEB-INF.dir}" />
|
||||||
|
<lib dir="${web.lib.dir}">
|
||||||
|
<exclude name="servlet-api.jar" />
|
||||||
|
<exclude name="el-api.jar" />
|
||||||
|
</lib>
|
||||||
|
<!-- <lib dir="${lib.tools.dir}" /> -->
|
||||||
|
<classes dir="${web.build.classes.dir}" />
|
||||||
|
</war>
|
||||||
|
</target>
|
||||||
|
|
||||||
init-macrodef-javac: defines macro for javac compilation
|
<target name="web-tomcat-deploy" description="Install web application" depends="web-makeWar">
|
||||||
init-macrodef-junit: defines macro for junit execution
|
<deploy url="${url}" username="${username}" password="${password}" path="/${web.name}" war="${web.dist.dir}/${web.warfile}" />
|
||||||
init-macrodef-debug: defines macro for class debugging
|
</target>
|
||||||
do-dist: archive building
|
|
||||||
run: execution of project
|
|
||||||
javadoc-build: javadoc generation
|
|
||||||
|
|
||||||
Example of overriding the target for project execution could look like
|
<target name="web-tomcat-reload" description="Reload web application">
|
||||||
|
<reload url="${url}" username="${username}" password="${password}" path="/${web.name}" />
|
||||||
|
</target>
|
||||||
|
|
||||||
<target name="run" depends="<PROJNAME>-impl.jar">
|
<target name="web-tomcat-undeploy" description="Remove web application">
|
||||||
<exec dir="bin" executable="launcher.exe">
|
<undeploy url="${url}" username="${username}" password="${password}" path="/${web.name}" />
|
||||||
<arg file="${dist.jar}"/>
|
|
||||||
</exec>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
Notice that overridden target depends on jar target and not only on
|
<target name="web-tomcat-redeploy" description="Undeploys and then Deploys... all in one click" depends="web-tomcat-undeploy, web-tomcat-deploy" />
|
||||||
compile target as regular run target does. Again, for list of available
|
|
||||||
properties which you can use check the target you are overriding in
|
|
||||||
nbproject/build-impl.xml file.
|
|
||||||
|
|
||||||
-->
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,40 @@
|
|||||||
|
|
||||||
|
# production
|
||||||
|
#server.siprp = localhost
|
||||||
|
#port.siprp = 5436
|
||||||
|
#database.siprp = siprp
|
||||||
|
#username.siprp = postgres
|
||||||
|
##password.siprp =
|
||||||
|
#
|
||||||
|
#server.siprp_local = localhost
|
||||||
|
#port.siprp_local = 5436
|
||||||
|
#database.siprp_local = siprp_local_3
|
||||||
|
#username.siprp_local = postgres
|
||||||
|
##password.siprp_local =
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# tests
|
||||||
|
server.siprp = localhost
|
||||||
|
port.siprp = 5432
|
||||||
|
database.siprp = siprp
|
||||||
|
username.siprp = postgres
|
||||||
|
password.siprp = Typein
|
||||||
|
|
||||||
|
server.siprp_local = localhost
|
||||||
|
port.siprp_local = 5432
|
||||||
|
database.siprp_local = siprp_local_3
|
||||||
|
username.siprp_local = postgres
|
||||||
|
password.siprp_local = Typein
|
||||||
|
|
||||||
|
#server.siprp = www.evolute.pt
|
||||||
|
#port.siprp = 5436
|
||||||
|
#database.siprp = siprp
|
||||||
|
#username.siprp = postgres
|
||||||
|
#password.siprp = -rg2hpgsql
|
||||||
|
#
|
||||||
|
#server.siprp_local = www.evolute.pt
|
||||||
|
#port.siprp_local = 5436
|
||||||
|
#database.siprp_local = siprp_local_3
|
||||||
|
#username.siprp_local = postgres
|
||||||
|
#password.siprp_local = -rg2hpgsql
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue