Skip to content

Commit

Permalink
now also builds .war
Browse files Browse the repository at this point in the history
  • Loading branch information
fapret committed Oct 18, 2024
1 parent 336b70c commit 512c3b5
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion proyecto/java_microservice/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. --><project basedir="." default="build" name="curricula_microservice">
as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="curricula_microservice">
<property environment="env"/>
<property name="proyecto.location" value="../"/>
<property name="ECLIPSE_HOME" value="../../../../eclipse/jee-2024-09/eclipse/"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="17"/>
<property name="source" value="17"/>

<path id="Web App Libraries.libraryclasspath">
<pathelement location="src/main/webapp/WEB-INF/lib/org.eclipse.emf.common_2.28.0.v20230315-1321.jar"/>
<pathelement location="src/main/webapp/WEB-INF/lib/org.eclipse.emf.ecore.change_2.15.0.v20230211-1150.jar"/>
<pathelement location="src/main/webapp/WEB-INF/lib/org.eclipse.emf.ecore.xmi_2.18.0.v20230211-1150.jar"/>
<pathelement location="src/main/webapp/WEB-INF/lib/org.eclipse.emf.ecore_2.34.0.v20230406-1203.jar"/>
<pathelement location="src/main/webapp/WEB-INF/lib/servlet-api.jar"/>
</path>

<path id="EAR Libraries.libraryclasspath"/>

<path id="curricula_microservice.classpath">
<pathelement location="build/classes"/>
<path refid="Web App Libraries.libraryclasspath"/>
Expand All @@ -28,6 +32,7 @@
<pathelement location="src/main/webapp/WEB-INF/lib/org.eclipse.emf.ecore.xmi_2.18.0.v20230211-1150.jar"/>
<pathelement location="${proyecto.location}/java_microservice/src/main/webapp/WEB-INF/lib/servlet-api.jar"/>
</path>

<target name="init">
<mkdir dir="build/classes"/>
<copy includeemptydirs="false" todir="build/classes">
Expand All @@ -37,20 +42,44 @@
</fileset>
</copy>
</target>

<target name="clean">
<delete dir="build/classes"/>
<delete file="build/${ant.project.name}.war"/>
</target>

<target depends="clean" name="cleanall"/>

<target depends="build-subprojects,build-project" name="build"/>

<target name="build-subprojects"/>

<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="build/classes" includeantruntime="false" source="${source}" target="${target}">
<src path="src/main/java"/>
<classpath refid="curricula_microservice.classpath"/>
</javac>
</target>

<target name="war" depends="build-project">
<echo message="Creating WAR file..."/>
<mkdir dir="build/${ant.project.name}"/>
<copy todir="build/${ant.project.name}">
<fileset dir="src/main/webapp">
<include name="**/*"/>
</fileset>
</copy>
<war destfile="build/${ant.project.name}.war" basedir="build/${ant.project.name}">
<webinf>
<fileset dir="src/main/webapp/WEB-INF"/>
</webinf>
</war>
<echo message="WAR file created at build/${ant.project.name}.war"/>
</target>

<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>

<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
Expand All @@ -60,6 +89,7 @@
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>

<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
Expand Down

0 comments on commit 512c3b5

Please sign in to comment.