-
Notifications
You must be signed in to change notification settings - Fork 20
/
audit.xml
79 lines (66 loc) · 2.34 KB
/
audit.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
<?xml version="1.0"?>
<!--
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Copyright Contributors to the Zowe Project.
-->
<project default="traverse" xmlns:if="ant:if" xmlns:unless="ant:unless">
<record name="build.log" loglevel="info"/>
<import file="common.xml"/>
<property name="traverseTarget" value="audit"/>
<condition property="isWindows">
<os family="windows"/>
</condition>
<condition property="isUnix">
<os family="unix"/>
</condition>
<condition property="isZos">
<os family="z/os"/>
</condition>
<target name="audit">
<mkdir dir="${build}/artifacts/audit"/>
<antcall target="generate_audit_report">
<param name="packagejson.Location" value="${pluginDir}/${plugin}"/>
</antcall>
<for param="subfolder">
<path>
<dirset dir="${pluginDir}/${plugin}" includes="*"/>
</path>
<sequential>
<antcall target="generate_audit_report">
<param name="packagejson.Location" value="@{subfolder}"/>
</antcall>
</sequential>
</for>
</target>
<target name="generate_audit_report" depends="package.jsonExists" if="package.jsonPresent">
<exec executable="cmd"
dir="${packagejson.Location}"
osfamily="windows"
resultproperty="rc"
searchpath="true"
output="${build}/artifacts/audit/${plugin_id}_audit.log">
<arg line="/c npm audit"/>
</exec>
<exec executable="npm"
dir="${packagejson.Location}"
osfamily="unix"
resultproperty="rc"
searchpath="true"
output="${build}/artifacts/audit/${plugin_id}_audit.log">
<arg line="audit"/>
</exec>
</target>
<target name="package.jsonExists">
<available file="${packagejson.Location}/package.json" property="package.jsonPresent"/>
</target>
</project>
<!--
This program and the accompanying materials are
made available under the terms of the Eclipse Public License v2.0 which accompanies
this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Copyright Contributors to the Zowe Project.
-->