forked from chocolatey/choco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploymentBuilder.step
84 lines (74 loc) · 4.44 KB
/
deploymentBuilder.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
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
<?xml version="1.0" encoding="utf-8" ?>
<project name="DeploymentBuilder" default="go">
<!-- Project UppercuT - http://projectuppercut.org -->
<!-- DO NOT EDIT THIS FILE - This follows a convention to find configurations, apply environment specifics and save them - 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="dirs.deployment.templates" value="${dirs.current}${path.separator}${folder.deployment}${path.separator}templates" overwrite="false" />
<property name="dirs.deployment.templates.holding" value="${dirs.deployment}${path.separator}templateHolding" overwrite="false" />
<property name="dirs.src.deployment.settings.templates" value="${dirs.current}${path.separator}${folder.deployment}${path.separator}Settings" overwrite="false" />
<property name="dirs.deployment.settings.templates.holding" value="${dirs.deployment}${path.separator}settingsHolding" overwrite="false" />
<property name="dirs.deployment.settings.templates" value="${dirs.drop}${path.separator}${folder.deployment}${path.separator}Settings" overwrite="false" />
<property name="fail.build.on.error" value="false" />
<target name="go" depends="run_tasks" />
<!-- run_normal_tasks is called from run_tasks unless replace extension exists-->
<target name="run_normal_tasks"
depends="copy_templates, copy_settings_templates, set_file_attributes_to_normal, build_deployments, build_deployments_settings"
description="Deployment File Builder"
if="${run.deploymentbuilder and directory::exists(dirs.deployment.templates)}" />
<target name="copy_templates" if="${directory::exists(dirs.deployment.templates)}">
<copy todir="${dirs.deployment.templates.holding}">
<fileset basedir="${dirs.deployment.templates}">
<include name="**/**" />
</fileset>
</copy>
</target>
<target name="copy_settings_templates" if="${directory::exists(dirs.src.deployment.settings.templates)}">
<copy todir="${dirs.deployment.settings.templates.holding}">
<fileset basedir="${dirs.src.deployment.settings.templates}">
<include name="**/**" />
</fileset>
</copy>
</target>
<target name="set_file_attributes_to_normal">
<echo level="Warning" message="Removing read only attributes that some source control things put on files in '${dirs.deployment}'." />
<attrib normal="true">
<fileset basedir="${dirs.deployment}">
<include name="**/*" />
</fileset>
</attrib>
</target>
<target name="build_deployments" if="${directory::exists(dirs.deployment.templates.holding)}" >
<echo level="Warning" message="DeploymentBuilder: Building Templates in '${dirs.deployment}' with '*.bat' as the name." />
<!--loglevel level="Info" -->
<buildTemplateFiles
settingsFilesDirectory="${dirs.deployment.settings}"
templatesDirectory="${dirs.deployment.templates.holding}"
destinationDirectory="${dirs.deployment}"
templateExtension=".BAT"
keepExtension="true"
useEnvironmentSubdirectory="false"
/>
<!--/loglevel -->
<delete dir="${dirs.deployment.templates.holding}" />
</target>
<target name="build_deployments_settings" if="${directory::exists(dirs.deployment.settings.templates.holding)}" >
<echo level="Warning" message="DeploymentBuilder Part Deuce: Building Templates in '${dirs.deployment.settings.templates}' with '*.bat' as the name." />
<!--loglevel level="Info" -->
<buildTemplateFiles
settingsFilesDirectory="${dirs.deployment.settings}"
templatesDirectory="${dirs.deployment.settings.templates.holding}"
destinationDirectory="${dirs.deployment.settings.templates}"
templateExtension=".BAT"
keepExtension="true"
/>
<!--/loglevel -->
<delete dir="${dirs.deployment.settings.templates.holding}" />
</target>
</project>