This repository has been archived by the owner on Feb 16, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildcallbacks.xml
105 lines (90 loc) · 4.18 KB
/
buildcallbacks.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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="changeprompteditorarea_buildcallbacks">
<property name="changeprompteditorareaWebFragmentSrc"
value="${ext.changeprompteditorarea.path}/resources/web-fragment.xml"/>
<property name="changeprompteditorareaWebFragmentDestJar"
value="${ext.backoffice.path}/web/webroot/WEB-INF/lib/webfragmentExt_changeprompteditorarea.jar"/>
<!--this is very hacky and definitely NOT best practice, but there is no easy way to change/replace exiting widget definitions (yet)-->
<macrodef name="patch-editor-area-widgets">
<attribute name="widgets-xml"/>
<sequential>
<replaceregexp file="@{widgets-xml}"
flags="sg">
<regexp pattern='(?U)<(\s*?widget([^>]+?)widgetDefinitionId\s*?=\s*?"com.hybris.cockpitng.backoffice.defaultEditorArea"([^>]+?))>'/>
<substitution expression='
<!--START PATCH-->${line.separator}
<!-- \1 -->${line.separator}
<widget\2widgetDefinitionId="mpern.sap.commerce.backoffice.widgets.changeprompteditorarea"\3>${line.separator}
<!--END PATCH-->${line.separator}'/>
</replaceregexp>
</sequential>
</macrodef>
<macrodef name="patch-all-editor-areas">
<sequential>
<echo message="Patching backoffice config with custom editor area..."/>
<!--default backoffice-->
<patch-editor-area-widgets widgets-xml="${ext.backoffice.path}/resources/backoffice-widgets.xml"/>
<!--backoffice PCM (1808)-->
<patch-editor-area-widgets
widgets-xml="${ext.pcmbackoffice.path}/resources/pcmbackoffice-backoffice-widgets/pcmbackoffice-widgets-general.xml"/>
</sequential>
</macrodef>
<macrodef name="changeprompteditorarea_after_clean">
<sequential>
<changeprompteditorarea_remove_web_fragment/>
</sequential>
</macrodef>
<macrodef name="changeprompteditorarea_after_build">
<sequential>
<changeprompteditorarea_remove_web_fragment/>
<changeprompteditorarea_create_web_fragment/>
<patch-all-editor-areas/>
</sequential>
</macrodef>
<macrodef name="changeprompteditorarea_remove_web_fragment">
<sequential>
<if>
<available file="${changeprompteditorareaWebFragmentDestJar}"/>
<then>
<delete file="${changeprompteditorareaWebFragmentDestJar}"/>
</then>
</if>
</sequential>
</macrodef>
<macrodef name="changeprompteditorarea_create_web_fragment">
<sequential>
<if>
<available file="${changeprompteditorareaWebFragmentSrc}"/>
<then>
<sequential>
<jar destfile="${changeprompteditorareaWebFragmentDestJar}">
<metainf file="${changeprompteditorareaWebFragmentSrc}"/>
</jar>
</sequential>
</then>
</if>
</sequential>
</macrodef>
<patternset id="changeprompteditorarea.localization.pattern">
<!-- core and hmc -->
<include name="**/*locales*_en.properties"/>
<exclude name="**/hmc/web/webroot/WEB-INF/classes/**/*"/>
<exclude name="**/unittest/**/*"/>
<!-- cockpit (ng) -->
<include name="**/i3-label_en.properties"/>
<include name="**/labels_en.properties"/>
<!-- messages -->
<include name="**/*messages_en.properties"/>
<include name="**/*messages.properties"/>
<!-- frontend properties files in WEB-INF/messages folder -->
<include name="**/WEB-INF/messages/*_en.properties"/>
<!-- csv and impex -->
<include name="**/*_en.csv"/>
<include name="**/*_en.impex"/>
<include name="**/lang-en.properties"/>
<!-- email localizations from yacceleratorcore -->
<include name="resources/**/messages/*_en.properties"/>
<!-- include validation messages -->
<include name="resources/**/ValidationMessages.properties"/>
</patternset>
</project>