forked from chocolatey/choco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpolicyChecks.step
31 lines (25 loc) · 1.89 KB
/
policyChecks.step
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
<?xml version="1.0" encoding="utf-8" ?>
<project name="PolicyEnforcer" default="go">
<!-- Project UppercuT - http://projectuppercut.org -->
<!-- DO NOT EDIT THIS FILE - Add custom tasks in BuildTasks.Custom folder with file by the same name - find out more at http://uppercut.pbwiki.com -->
<property name="build.config.settings" value="__NONE__" overwrite="false" />
<include buildfile="${build.config.settings}" if="${file::exists(build.config.settings)}" />
<property name="path.separator" value="${string::trim(path::combine(' ', ' '))}" />
<property name="dirs.current.file" value="${directory::get-parent-directory(project::get-buildfile-path())}" />
<include buildfile="${dirs.current.file}${path.separator}default.build.settings" />
<property name="build.step.name" value="${project::get-name()}" />
<property name="build.step.path" value="${project::get-buildfile-path()}" />
<!-- build step customizations below this -->
<property name="file.installation_document" value="${dirs.docs}${path.separator}Installation${path.separator}Install.docx" overwrite="false" />
<property name="fail.if_no_installation_document" value="false" overwrite="false" />
<target name="go" depends="run_tasks" if="${run.policychecks}" />
<!-- run_normal_tasks is called from run_tasks unless replace extension exists-->
<target name="run_normal_tasks"
depends="install_document_policy"
description="Enforcing active rules/policies." />
<target name="install_document_policy">
<echo level="Warning" message="Checking for the existence of ${path::get-full-path(file.installation_document)}. Do we fail the build if it is missing? ${fail.if_no_installation_document}" />
<fail message="You must provide an installation document as a matter of policy."
if="${fail.if_no_installation_document == 'true' and not file::exists(file.installation_document)}" />
</target>
</project>