Skip to content

Commit

Permalink
Merge pull request #1283 from zspitzer/build-remove-duplicates
Browse files Browse the repository at this point in the history
Build remove duplicates
  • Loading branch information
zspitzer authored Apr 19, 2021
2 parents 0a7dd90 + 0d6d272 commit 98f1eb1
Show file tree
Hide file tree
Showing 63 changed files with 868 additions and 7,911 deletions.
79 changes: 63 additions & 16 deletions ant/build-core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<property name="temp" location="${rootDir}/temp"/>
<property name="loader" location="${temp}/loader"/>
<property name="core" location="${temp}/core"/>
<property name="tmpContext" location="${temp}/context"/>
<property name="deployLco" value=""/>
<!-- <property file="${rootDir}/build.properties"/> -->

Expand Down Expand Up @@ -193,6 +194,8 @@
<mkdir dir="${loader}"/>
<mkdir dir="${temp}/agent"/>
<mkdir dir="${cache}"/>
<mkdir dir="${tmpContext}"/>
<mkdir dir="${tmpContext}/cfml"/>

</target>

Expand All @@ -217,27 +220,35 @@
</target>

<target name="copyDeployFiles" depends="init,check" description="copy files from source/cfml to source/java/core/src/resource">
<echots message="copy files from source/cfml to source/java/core/src/resource"/>
<echots message="copying files from ${srcCFML} and ${srcCore}/resource to ${tmpContext}/cfml"/>

<copy todir="${srcCore}/resource/context/" overwrite="true">
<fileset dir="${srcCFML}/context/">
<include name="*.cfm"/>
<include name="*.cfc"/>
<include name="*.lucee"/>
<include name="*.xml"/>
<!-- context files are both under cfml and java, merge them in a temp directory, avoid duplicated files -->

<copy todir="${tmpContext}/context" overwrite="true">
<fileset dir="${srcCore}/resource/">
<include name="**/*"/>
</fileset>
</copy>

<copy todir="${srcCore}/resource/context/admin/resources/language/" overwrite="true">
<copy todir="${tmpContext}/cfml" overwrite="true">
<fileset dir="${srcCFML}/context">
<include name="**/*"/>
</fileset>
</copy>

<copy todir="${tmpContext}/cfml/doc" overwrite="true">
<fileset dir="${srcCFML}/context/doc">
<include name="**/*"/>
</fileset>
</copy>

<copy todir="${tmpContext}/context/admin/resources/language/" overwrite="true">
<fileset dir="${srcCFML}/context/admin/resources/language/">
<include name="*.cfm"/>
<include name="*.cfc"/>
<include name="*.lucee"/>
<include name="*.xml"/>
</fileset>
</copy>

<copy todir="${srcCore}/resource/context/gateway" overwrite="true">
<copy todir="${tmpContext}/cfml/gateway" overwrite="true">
<fileset dir="${srcCFML}/context/gateway">
<include name="*.cfm"/>
<include name="*.cfc"/>
Expand All @@ -246,7 +257,7 @@
</fileset>
</copy>

<copy todir="${srcCore}/resource/context/templates/error" overwrite="true">
<copy todir="${tmpContext}/cfml/templates/error" overwrite="true">
<fileset dir="${srcCFML}/context/templates/error">
<include name="*.cfm"/>
<include name="*.cfc"/>
Expand All @@ -255,14 +266,39 @@
</fileset>
</copy>

<copy todir="${srcCore}/resource/context/admin/plugin" overwrite="true">
<copy todir="${tmpContext}/context/admin/plugin" overwrite="true">
<fileset dir="${srcCFML}/context/admin/plugin">
<include name="**/*.cfm"/>
<include name="**/*.cfc"/>
<include name="**/*.lucee"/>
<include name="**/*.xml"/>
</fileset>
</copy>

<!-- separate the lucee context from the admin and docs -->
<copy todir="${tmpContext}/cfml-context">
<fileset dir="${tmpContext}/cfml/">
<include name="**/*"/>
<exclude name="admin/**"/>
<exclude name="doc/**"/>
</fileset>
</copy>

<copy todir="${tmpContext}/cfml-context/admin/resources/language/" overwrite="true">
<fileset dir="${srcCFML}/context/admin/resources/language/">
<include name="*.xml"/>
</fileset>
</copy>

<copy todir="${tmpContext}/cfml-context/admin/plugin" overwrite="true">
<fileset dir="${srcCFML}/context/admin/plugin">
<include name="**/*.cfm"/>
<include name="**/*.cfc"/>
<include name="**/*.lucee"/>
<include name="**/*.xml"/>
</fileset>
</copy>

</target>

<target name="agent" depends="copyDeployFiles" description="create external-agent jar used as backup when dynamic agent fails" >
Expand Down Expand Up @@ -331,14 +367,25 @@
<classpath refid="classpath" />
</javac>

<!-- copy all non java files -->
<!-- copy all non java files from src -->
<copy todir="${core}">
<fileset dir="${srcCore}">
<exclude name="**/*.java"/>
<exclude name=".*"/>
</fileset>
</copy>

<!-- copy all non java files from temp context -->
<copy todir="${core}/resource/context">
<fileset dir="${tmpContext}/cfml-context">
<exclude name="**/*.java"/>
<exclude name="**/*.js"/>
<exclude name="debug/**"/>
<exclude name=".*"/>
</fileset>
</copy>


<!-- set date in default properties -->
<loadfile property="defprop"
srcFile="${core}/default.properties"/>
Expand Down Expand Up @@ -409,7 +456,7 @@
<jvmarg value="-XX:StartFlightRecording=disk=true,dumponexit=true,filename=${temp}/../lucee-compile.jfr,maxsize=1024m,maxage=1d,settings=profile,path-to-gc-roots=true"/>
-->

<jvmarg value="-Dsrc=${srcCFML}/context"/>
<jvmarg value="-Dsrc=${tmpContext}"/>
<jvmarg value="-Dtemp=${temp}/archive"/>
<jvmarg value="-Dtestbox=${temp}/testbox/testbox"/>
<jvmarg value="-DcompileTestBox=${compileTestBox}"/>
Expand Down
21 changes: 8 additions & 13 deletions ant/build-create-archive.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project default="all" basedir="." name="Lucee">

<property name="srcCFML" location="${temp}/context"/>
<property name="srcAdmin" location="${src}/admin"/>
<property name="srcDoc" location="${src}/doc"/>
<property name="srcCFML" location="${src}"/>
<property name="srcAdmin" location="${src}/cfml/admin"/>
<property name="srcDoc" location="${src}/cfml/doc"/>
<property name="srcTB" location="${testbox}"/>

<macrodef name="echots">
Expand All @@ -19,20 +19,15 @@

<target name="all">

<!-- first we need to separate the lucee context from the admin -->
<copy todir="${srcCFML}">
<fileset dir="${src}">
<include name="**/*"/>
<exclude name="admin/**"/>
<exclude name="doc/**"/>
</fileset>
</copy>

<echots message="Starting Lucee"/>
<script language="CFML">
<![CDATA[
systemOutput("---------- #DateTimeFormat(now(),'yyyy-mm-dd HH:nn:ss')# - Lucee Started ----------", true);
SystemOutput("srcCFML: #srcCFML#", true);
SystemOutput("srcAdmin: #srcAdmin#", true);
SystemOutput("srcDoc: #srcDoc#", true);
try {
// set a password for the admin
Expand Down Expand Up @@ -61,7 +56,7 @@
type="web"
password="webweb"
virtual="/context"
physical="#srcCFML#"
physical="#srcCFML#/cfml-context"
toplevel="true"
archive=""
primary="physical"
Expand Down
Loading

0 comments on commit 98f1eb1

Please sign in to comment.