This repository has been archived by the owner on Nov 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.xml
109 lines (87 loc) · 4.95 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
97
98
99
100
101
102
103
104
105
106
107
108
109
<?xml version="1.0" encoding="UTF-8"?>
<project name="DMS" default="package" basedir=".">
<property name="distributionDir" value="${project.basedir}/_distribution" override="true" />
<target name="docs">
<exec command="phpdoc -t ${project.basedir}/docs -d ${project.basedir}/src --title DMS " />
</target>
<target name="package" description="prepares for packaging">
<phingcall target="docs" />
</target>
<!-- Filter Package -->
<target name="release_filter" description="Releases a new version">
<propertyprompt propertyName="version" defaultValue="invalid-version"
promptText="Which version do you wish to tag? (do not include a 'v')" />
<phingcall target="split_filter" />
<phingcall target="tag_release">
<property name="tagVersion" value="${version}"/>
<property name="repoDir" value="Filter" override="true"/>
</phingcall>
<phingcall target="tag_release">
<property name="tagVersion" value="${version}"/>
<property name="repoDir" value="Bundle/FilterBundle" override="true"/>
</phingcall>
</target>
<target name="split_filter" description="Does a Sub-Tree split for Filter (Lib + Package)">
<phingcall target="split_repository">
<property name="splitTargetDir" value="Filter"/>
<property name="splitFilterDir" value="src/DMS/Filter"/>
<property name="splitTargetRepo" value="[email protected]:rdohms/DMS-Filter.git"/>
</phingcall>
<phingcall target="split_repository">
<property name="splitTargetDir" value="Bundle/FilterBundle" />
<property name="splitFilterDir" value="src/DMS/Bundle/FilterBundle" />
<property name="splitTargetRepo" value="[email protected]:rdohms/DMSFilterBundle.git" />
</phingcall>
</target>
<!-- Twig Extensions -->
<target name="release_twigext" description="Releases a new version">
<propertyprompt propertyName="version" defaultValue="invalid-version"
promptText="Which version do you wish to tag? (do not include a 'v')" />
<phingcall target="split_twigext" />
<phingcall target="tag_release">
<property name="tagVersion" value="${version}"/>
<property name="repoDir" value="Bundle/TwigExtensionBundle" override="true"/>
</phingcall>
</target>
<target name="split_twigext" description="Does a Sub-Tree split for Twig Extensions Bundle (Lib + Package)">
<phingcall target="split_repository">
<property name="splitTargetDir" value="Bundle/TwigExtensionBundle" />
<property name="splitFilterDir" value="src/DMS/Bundle/TwigExtensionBundle" />
<property name="splitTargetRepo" value="[email protected]:rdohms/DMSTwigExtensionBundle.git" />
</phingcall>
</target>
<!-- Meetup Bundle -->
<target name="release_meetup" description="Releases a new version">
<propertyprompt propertyName="version" defaultValue="invalid-version"
promptText="Which version do you wish to tag? (do not include a 'v')" />
<phingcall target="split_meetup" />
<phingcall target="tag_release">
<property name="tagVersion" value="${version}"/>
<property name="repoDir" value="Bundle/MeetupApiBundle" override="true"/>
</phingcall>
</target>
<target name="split_meetup" description="Does a Sub-Tree split for Meetup Bundle">
<phingcall target="split_repository">
<property name="splitTargetDir" value="Bundle/MeetupApiBundle" />
<property name="splitFilterDir" value="src/DMS/Bundle/MeetupApiBundle" />
<property name="splitTargetRepo" value="[email protected]:rdohms/DMSMeetupApiBundle.git" />
</phingcall>
</target>
<!-- Laucher Bundle -->
<!-- TODO -->
<!-- Generic Tasks -->
<target name="split_repository" description="Does a sub-tree split of selected repository">
<property name="targetDir" value="${distributionDir}/${splitTargetDir}" override="true" />
<delete dir="${targetDir}" />
<exec command="git clone [email protected]:rdohms/DMS.git ${targetDir}" />
<exec command="git filter-branch --prune-empty --subdirectory-filter ${splitFilterDir} master" dir="${targetDir}" />
<exec command="git remote rm origin" dir="${targetDir}" />
<exec command="git remote add origin ${splitTargetRepo}" dir="${targetDir}" />
<exec command="git push origin master --force" dir="${targetDir}" />
</target>
<target name="tag_release" description="Creates new release tag in child repository">
<property name="targetDir" value="${distributionDir}/${repoDir}" override="true" />
<exec command="git tag -a v${tagVersion} -m 'Automated tag for release of v${tagVersion}' --force" dir="${targetDir}" />
<exec command="git push origin v${tagVersion} --force" dir="${targetDir}" />
</target>
</project>