forked from cjoakim/azure-cosmosdb-altgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackup.xml
91 lines (72 loc) · 2.8 KB
/
backup.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
<project name="backup" default="backup" basedir=".">
<description>
Ant script to create a zip file backup of this project.
Chris Joakim, Microsoft, November 2022
ant -f backup.xml
</description>
<!-- These are the only properties you should have to change. -->
<property name="_projectRoot" value="/Users/${user.name}/github/" />
<property name="_projectName" value="azure-cosmosdb-altgraph" />
<property name="_backupRoot" value="/Users/${user.name}/Backups/projects" />
<!-- These properties are computed from the above. -->
<property name="_projectDir" value="${_projectRoot}/${_projectName}" />
<property name="_backupDir" value="${_backupRoot}/${_projectName}" />
<!-- ******************************************************************* -->
<target name="echoProperties">
<description>
This step simply displays the properties defined above.
</description>
<echo message="Properties used in this script:" />
<echo message="projectRoot... ${_projectRoot}" />
<echo message="projectName... ${_projectName}" />
<echo message="backupRoot.... ${_backupRoot}" />
<echo message="projectDir.... ${_projectDir}" />
<echo message="backupDir..... ${_backupDir}" />
</target>
<!-- ******************************************************************* -->
<target name="backup" depends="echoProperties" >
<description>
Create the backup zip file.
</description>
<tstamp>
<format property="_backupTstamp" pattern="yyyyMMdd-HHmmss" />
</tstamp>
<property name="_zipFilename"
value="${_backupDir}/${_projectName}-${_backupTstamp}.zip" />
<mkdir dir="${_backupRoot}" />
<mkdir dir="${_backupDir}" />
<delete file="${_zipFilename}" />
<zip zipfile="${_zipFilename}"
basedir="${_projectDir}"
excludes="
**/*.class,
**/*.jar,
**/*.pyc,
**/*.tar,
**/*.tsv,
**/*.war,
**/*.zip,
**/.classpath,
**/.git/,
**/.gradle/,
**/.idea/,
**/.mvn/,
**/.project,
**/.settings/,
**/bin/,
**/build/,
**/cache/,
**/coverage/,
**/include/,
**/lib/,
**/log/,
**/man/,
**/node_modules/,
**/out/,
**/raw/,
**/target/,
**/tmp/" />
<echo message="file created: ${_zipFilename}" />
<echo message="done." />
</target>
</project>