Skip to content

Commit

Permalink
smooth out the build process
Browse files Browse the repository at this point in the history
  • Loading branch information
Colcamex Resources Inc committed Apr 19, 2024
1 parent 8005b64 commit e51d477
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 24 deletions.
28 changes: 12 additions & 16 deletions jspc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
REQUIRES:
This build script requires that the normal build be run and
the expectation is that target/oscar.war was built and exists.
This script requires the environment variable CATALINA_HOME to be set,
this was tested against tomcat 6.0.18 and requires a version that
has the jasper compiler in it (5.0 versions did not).
This script requires the environment variable CATALINA_HOME to be set.
Tomcat version 6+ is required (preferably version 9+).
-->

<property environment="env" />
Expand All @@ -20,14 +19,18 @@
<property name="jspc.expandedWarDir" value="target/${jspc_target}" />
<property name="jspc.generatedDir" value="target/generated_jsp_classes" />

<echo message="war=${jspc.expandedWarDir}" />
<echo message="jsp=${jspc.generatedDir}" />

<target name="jspc" depends="jspc.clean">
<!--
The general algorithm is as follows :
1) compile jsp's into java source
2) compile java source into class files
-->

<mkdir dir="target/generated_jsp_classes"/>
<!-- build the compiled JSP directory -->
<mkdir dir="${jspc.generatedDir}"/>

<condition property="tomcat.lib" value="${catalina.home}/lib">
<available file="${catalina.home}/lib" type="dir" />
Expand All @@ -44,16 +47,7 @@
</classpath>
</taskdef>

<!-- tomcat 5.5 uses jasper2 where as tomcat 6 uses jasper -->
<if>
<equals arg1="${tomcat.lib.dir}" arg2="${catalina.home}/lib" />
<then>
<jasper uriroot="${jspc.expandedWarDir}" webXmlFragment="${jspc.generatedDir}/generated_web.xml" outputDir="${jspc.generatedDir}" failOnError="true" verbose="0" />
</then>
<else>
<jasper2 uriroot="${jspc.expandedWarDir}" webXmlFragment="${jspc.generatedDir}/generated_web.xml" outputDir="${jspc.generatedDir}" validateXml="false" failOnError="true" />
</else>
</if>
<jasper uriroot="${jspc.expandedWarDir}" webXmlFragment="${jspc.generatedDir}/generated_web.xml" outputDir="${jspc.generatedDir}" failOnError="true" verbose="0" />

<javac srcdir="${jspc.generatedDir}" source="8" target="8" debug="on" memoryInitialSize="128m" compiler="modern" includeantruntime="false" memoryMaximumSize="1024m" fork="yes" encoding="UTF8">
<classpath>
Expand All @@ -63,8 +57,10 @@
<pathelement path="${catalina.home}/bin/*" />
</classpath>

<!-- we will allow this exclusion because this is not our code and is just included code from another library, this will allow upgrades to be easier if we don't change other people's library code. -->
<exclude name="org/apache/jsp/jspspellcheck/**" />
<!-- we will allow this exclusion because this is not our code and is just
included code from another library, this will allow upgrades to be
easier if we don't change other people's library code.
<exclude name="org/apache/jsp/jspspellcheck/**" />-->
</javac>
</target>

Expand Down
13 changes: 7 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<groupId>org.oscarehr</groupId>
<artifactId>oscar</artifactId>
<packaging>war</packaging>
<version>v24.02.0</version>
<name>OpenOSCAR</name>
<version>0-SNAPSHOT</version>
<name>OpenO</name>
<description>OSCAR McMaster is a web-based electronic medical record (EMR) system initially developed for academic primary care clinics. It has grown into a comprehensive EMR and billing system used by many doctor's offices and private medical clinics in Canada and other parts of the world. The name is derived from where it was created and an acronym; OSCAR stands for Open Source Clinical Application and Resource and McMaster refers to McMaster University, where it was developed. It enables the delivery of evidence resources at the point of care.</description>
<issueManagement>
<system>SourceForge Tracker</system>
Expand Down Expand Up @@ -1442,16 +1442,17 @@
<replace file="target/classes/oscar_mcmaster.properties" token="${build.dateTime}" value="${build.dateTime.value}" />

<property environment="env" />
<echo message="ENVIRONMENT ${env}" />
<echo message="JOB_NAME - BUILD_NUMBER : ${env.JOB_NAME} - ${env.BUILD_NUMBER}" />
<echo message="JOB_NAME - BUILD_NUMBER : ${env.JOB_NAME}-${env.BUILD_NUMBER}" />
<replace file="target/classes/oscar_mcmaster.properties" token="${build.JOB_NAME}" value="${env.JOB_NAME}" />
<replace file="target/classes/oscar_mcmaster.properties" token="${build.BUILD_NUMBER}" value="${env.BUILD_NUMBER}" />
</target>
</configuration>
</execution>

<execution>
<!-- We're doing jspc this way because the codehaus jspc seems to be abandonded, it doesn't go beyond jdk 1.5 and the documentation is sparse, and the source code links to a broken page and I can't find the goals it supports. -->
<!-- We're doing jspc this way because the codehaus jspc seems to be abandonded,
it doesn't go beyond jdk 1.5 and the documentation is sparse, and the source
code links to a broken page and I can't find the goals it supports. -->
<id>jspc</id>
<phase>verify</phase>
<goals>
Expand All @@ -1460,7 +1461,7 @@
<configuration>
<target>
<property name="build.compiler" value="extJavac" />
<property name='jspc_target' value="${project.name}-${project.version}" />
<property name='jspc_target' value="${project.artifactId}-${project.version}" />
<ant antfile="jspc.xml" target="jspc" />
</target>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/oscar_mcmaster.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ldap.authorization=false
ldap.authMethod=simple
#ldap.authMethod=digest-md5
buildDateTime=${build.dateTime}
buildtag=${build.JOB_NAME}-${build.BUILD_NUMBER}
buildtag=${build.JOB_NAME} ${build.BUILD_NUMBER}

## Mysql connection

Expand Down
Empty file.
2 changes: 1 addition & 1 deletion src/main/webapp/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pageContext.setAttribute("isMobileDevice", isMobileDevice);
<%-- </c:choose>--%>
</title>

<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/Oscar.ico" />
<link rel="icon" href="${pageContext.request.contextPath}/images/Oscar.ico" />
<link href="${pageContext.request.contextPath}/css/Roboto.css" rel='stylesheet' type='text/css' />
<script type="text/javascript">
Expand Down

0 comments on commit e51d477

Please sign in to comment.