forked from Coded/SIPRP
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							111 lines
						
					
					
						
							3.9 KiB
						
					
					
				
			
		
		
	
	
							111 lines
						
					
					
						
							3.9 KiB
						
					
					
				| <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>
 | |
| 			<manifest>
 | |
| 				<attribute name="Permissions" value="all-permissions" />
 | |
| 			</manifest>
 | |
| 		</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> |