forked from adempiere/adempiere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
96 lines (87 loc) · 4.76 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<project name="Adempiere Build Travis" default="build" basedir=".">
<description>
Building ADempiere
by
Yamel Senih
http://www.erpya.com
Victor Perez [email protected]
http://www.e-evolution.com
</description>
<property environment="env" />
<!-- set global properties for this build -->
<property name="env_directory" location="adempiere/Adempiere/utils"/>
<property name="AD_directory" location="adempiere/Adempiere"/>
<property name="adempiere_build" location="utils_dev/build.xml"/>
<property name="myEnvironment" location="adempiere/Adempiere/utils/myEnvironment.sh"/>
<property name="myEnvironmentTemplate" location="adempiere/Adempiere/utils/myEnvironmentTemplate.sh"/>
<property name="RUN_DBRestore" location="adempiere/Adempiere/utils/RUN_DBRestore.sh"/>
<property name="RUN_DBExport" location="adempiere/Adempiere/utils/RUN_DBExport.sh"/>
<property name="RUN_ExportReference" location="adempiere/Adempiere/utils/RUN_ExportReference.sh"/>
<property name="RUN_ImportAdempiere" location="adempiere/Adempiere/utils/RUN_ImportAdempiere.sh"/>
<property name="RUN_MigrateXML" location="adempiere/Adempiere/utils/RUN_MigrateXML.sh"/>
<property name="RUN_silentsetup" location="adempiere/Adempiere/RUN_silentsetup.sh"/>
<property name="AdempierePropertiesFrom" location="adempiere/Adempiere/AdempiereEnvTemplate.properties"/>
<property name="AdempierePropertiesTo" location="adempiere/Adempiere/AdempiereEnv.properties"/>
<property name="myDBcopyTemplate" location="adempiere/Adempiere/utils/myDBcopyTemplate.sh"/>
<property name="myDBcopy" location="adempiere/Adempiere/utils/myDBcopy.sh"/>
<target name="build">
<echo message="Building ADempiere"/>
<ant antfile="${adempiere_build}" target="complete"/>
<echo message="Deploy ADempiere"/>
<chmod dir="${AD_directory}" perm="ugo+rx" includes="**/*.sh"/>
<chmod dir="${AD_directory}/data" perm="ugo+rx" includes="**/*.dmp"/>
<chmod dir="${env_directory}" perm="ugo+rx" includes="**/*.sh"/>
<chmod dir="${env_directory}/PostgreSQL" perm="ugo+rx" includes="**/*.sh"/>
<echo message="Java Home : ${env.JAVA_HOME}"/>
<echo message="Adempiere Home : ${env.ADEMPIERE_HOME}"/>
<echo message="Copy AdempiereEnvTemplate.properties to AdempiereEnv.properties"/>
<copy file="${AdempierePropertiesFrom}" tofile="${AdempierePropertiesTo}" filtering="yes" overwrite="yes" />
<replaceregexp file="${AdempierePropertiesTo}" match="ADEMPIERE_HOME=/opt/Adempiere" replace="ADEMPIERE_HOME=${env.ADEMPIERE_HOME}" byline="true"/>
<replaceregexp file="${AdempierePropertiesTo}" match="JAVA_HOME=/usr/lib/jvm/jdk-11" replace="JAVA_HOME=${env.JAVA_HOME}" byline="true"/>
<property file="${AdempierePropertiesTo}"/>
<filter filtersfile="${AdempierePropertiesTo}" />
<echo message="Generate myEnvironment.sh"/>
<copy file="${myEnvironmentTemplate}" tofile="${myEnvironment}" filtering="yes" overwrite="yes" />
<java dir="${env.ADEMPIERE_HOME}" classname="org.compiere.install.SilentSetup" fork="true">
<arg value="ALL"/>
<jvmarg value="--add-opens"/>
<jvmarg value="java.base/sun.security.tools.keytool=ALL-UNNAMED"/>
<jvmarg value="--add-exports"/>
<jvmarg value="java.base/jdk.internal.misc=ALL-UNNAMED"/>
<jvmarg value="--add-opens"/>
<jvmarg value="java.base/java.lang=ALL-UNNAMED"/>
<sysproperty key="ADEMPIERE_HOME" value="${env.ADEMPIERE_HOME}"/>
<classpath>
<pathelement location="${env.ADEMPIERE_HOME}/lib/CInstall.jar"/>
<pathelement location="${env.ADEMPIERE_HOME}/lib/Adempiere.jar"/>
<pathelement location="${env.ADEMPIERE_HOME}/lib/CCTools.jar"/>
<pathelement location="${env.ADEMPIERE_HOME}/lib/oracle.jar"/>
<pathelement location="${env.ADEMPIERE_HOME}/lib/postgresql.jar"/>
<pathelement path="${java.class.path}"/>
</classpath>
</java>
<tstamp>
<format property="current.time" pattern="dd/MM/yyyy hh:mm:ss"/>
</tstamp>
<concat destfile="${AdempierePropertiesTo}" append="true">CDate=${current.time}</concat>
<echo message="Copy myDBcopyTemplate to myDBcopy"/>
<copy file="${myDBcopyTemplate}"
tofile="${myDBcopy}" filtering="yes" overwrite="yes" />
<echo message="Run Import Adempiere"/>
<exec dir="${env_directory}" executable="/bin/bash" failonerror="true">
<arg value="${RUN_ImportAdempiere}"/>
</exec>
<echo message="Run DB Restore Adempiere"/>
<exec dir="${env_directory}" executable="/bin/bash" failonerror="true">
<arg value="${RUN_DBRestore}"/>
</exec>
<echo message="Run Migrate XML"/>
<exec dir="${AD_directory}" executable="/bin/bash" failonerror="true">
<arg value="${RUN_MigrateXML}"/>
</exec>
<echo message="Run Export Database"/>
<exec dir="${env_directory}" executable="/bin/bash" failonerror="true">
<arg value="${RUN_ExportReference}"/>
</exec>
</target>
</project>