forked from MassTransit/MassTransit
/
policyChecks.step
54 lines (47 loc) · 3.58 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?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="file.current.no_extension" value="policyChecks" />
<property name="dirs.current" value="${directory::get-parent-directory(project::get-buildfile-path())}" />
<property name="path.to.toplevel" value=".." />
<property name="folder.build_scripts" value="build" overwrite="false" />
<property name="folder.build_scripts_custom" value="build.custom" overwrite="false" />
<property name="dirs.build_scripts_custom" value="${dirs.current}\${path.to.toplevel}\${folder.build_scripts_custom}" />
<property name="folder.documentation" value="docs" overwrite="false" />
<property name="dirs.docs" value="${path::get-full-path(dirs.current)}\${path.to.toplevel}\${folder.documentation}" />
<property name="project.name" value="__SOLUTION_NAME_WITHOUT_SLN_EXTENSION__" overwrite="false" />
<property name="file.installation_document" value="${dirs.docs}\Installation\Install.docx" overwrite="false" />
<property name="fail.if_no_installation_document" value="false" overwrite="false" />
<property name="file.custom.step.before" value="${dirs.build_scripts_custom}\${file.current.no_extension}.pre.step" />
<property name="file.custom.step.after" value="${dirs.build_scripts_custom}\${file.current.no_extension}.post.step" />
<property name="file.custom.step.replace" value="${dirs.build_scripts_custom}\${file.current.no_extension}.replace.step" />
<target name="go" depends="run_tasks" />
<target name="run_tasks">
<echo message="Running ${project::get-name()} tasks." />
<call target="prepare" if="${target::exists('prepare')}" />
<call target="custom_tasks_before" if="${target::exists('custom_tasks_before')}" />
<call target="run_normal_tasks" if="${not file::exists(file.custom.step.replace)}" />
<echo message="Running custom tasks instead of normal tasks if ${file.custom.step.replace} exists." />
<nant buildfile="${file.custom.step.replace}" inheritall="true" if="${file::exists(file.custom.step.replace)}" />
<call target="custom_tasks_after" if="${target::exists('custom_tasks_after')}" />
</target>
<target name="run_normal_tasks"
depends="install_document_policy"
description="Enforcing active rules/policies." />
<target name="custom_tasks_before">
<echo message="Running custom tasks if ${file.custom.step.before} exists." />
<nant buildfile="${file.custom.step.before}" inheritall="true" if="${file::exists(file.custom.step.before)}" failonerror="false" />
</target>
<target name="install_document_policy">
<echo 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>
<target name="custom_tasks_after">
<echo message="Running custom tasks if ${file.custom.step.after} exists." />
<nant buildfile="${file.custom.step.after}" inheritall="true" if="${file::exists(file.custom.step.after)}" failonerror="false" />
</target>
</project>