forked from phatboyg/Magnum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopen.build
116 lines (106 loc) · 6.63 KB
/
open.build
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
106
107
108
109
110
111
112
113
114
115
116
<?xml version="1.0" encoding="utf-8" ?>
<project name="Open" default="go">
<!-- Project UppercuT - http://projectuppercut.org -->
<!-- DO NOT EDIT THIS FILE - 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="file.current.no_extension" value="open" />
<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.separator}${path.to.toplevel}${path.separator}${folder.build_scripts_custom}" />
<property name="dirs.solution" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${path_to_solution}" />
<property name="solution.path" value="${path::get-full-path(dirs.solution)}${path.separator}${project.name}.sln" />
<property name="solution.path.full" value="${path::get-full-path(solution.path)}" />
<property name="app.visual_studio" value="${environment::get-folder-path('ProgramFiles')}\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe" />
<property name="app.monodevelop" value="monodevelop" />
<property name="file.uppercut.assembly" value="uppercut.tasks.dll" />
<property name="path.uppercut.assembly" value="${dirs.current}${path.separator}${file.uppercut.assembly}" />
<property name="allow.powershell.unrestricted" value="false" overwrite="false" />
<property name="file.custom.step.before" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.pre.build" />
<property name="file.custom.step.after" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.post.build" />
<property name="file.custom.step.replace" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.replace.build" />
<property name="is.replaced" value="false" />
<property name="fail.build.on.error" value="false" />
<target name="go" depends="load_uppercut_assemblies, allow_powershell_unrestricted, 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="custom_tasks_replace" if="${target::exists('custom_tasks_replace')}" />
<call target="run_normal_tasks" if="${not is.replaced}" />
<call target="custom_tasks_after" if="${target::exists('custom_tasks_after')}" />
</target>
<target name="run_normal_tasks"
depends="open_visual_studio"
description="Opening Visual Studio." />
<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="${fail.build.on.error}" />
<exec program="powershell.exe" if="${file::exists(file.custom.step.before + '.ps1')}" failonerror="${fail.build.on.error}">
<arg value="${path::get-full-path(file.custom.step.before + '.ps1')}" />
</exec>
<exec program="ruby.exe" if="${file::exists(file.custom.step.before + '.rb')}" failonerror="${fail.build.on.error}">
<arg value="${path::get-full-path(file.custom.step.before + '.rb')}" />
</exec>
</target>
<target name="custom_tasks_replace">
<echo message="Running custom tasks instead of normal tasks if ${file.custom.step.replace} exists." />
<property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace)}" />
<nant buildfile="${file.custom.step.replace}" inheritall="true" if="${file::exists(file.custom.step.replace)}" failonerror="${fail.build.on.error}" />
<property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.ps1')}" />
<exec program="powershell.exe" if="${file::exists(file.custom.step.replace + '.ps1')}" failonerror="${fail.build.on.error}" >
<arg value="${path::get-full-path(file.custom.step.replace + '.ps1')}" />
</exec>
<property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.rb')}" />
<exec program="ruby.exe" if="${file::exists(file.custom.step.replace + '.rb')}" failonerror="${fail.build.on.error}" >
<arg value="${path::get-full-path(file.custom.step.replace + '.rb')}" />
</exec>
</target>
<target name="open_visual_studio">
<if test="${platform::is-unix()}">
<echo message="Opening MonoDevelop with solution file ${solution.path.full}"/>
<exec
spawn="true"
program="${app.monodevelop}"
commandline="${solution.path.full}"
>
</exec>
</if>
<if test="${platform::is-windows()}">
<echo message="Opening visual studio with solution file ${solution.path.full}."/>
<exec
spawn="true"
basedir="${dirs.solution}"
program="${app.visual_studio}"
commandline="${solution.path.full}"
>
</exec>
</if>
</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="${fail.build.on.error}" />
<exec program="powershell.exe" if="${file::exists(file.custom.step.after + '.ps1')}" failonerror="${fail.build.on.error}" >
<arg value="${path::get-full-path(file.custom.step.after + '.ps1')}" />
</exec>
<exec program="ruby.exe" if="${file::exists(file.custom.step.after + '.rb')}" failonerror="${fail.build.on.error}" >
<arg value="${path::get-full-path(file.custom.step.after + '.rb')}" />
</exec>
</target>
<target name="load_uppercut_assemblies">
<loadtasks assembly="${path.uppercut.assembly}" if="${file::exists(path.uppercut.assembly)}" />
</target>
<target name="allow_powershell_unrestricted">
<!-- powershell 1.0 -->
<exec program="powershell.exe" if="${allow.powershell.unrestricted}" failonerror="false">
<arg value="set-executionpolicy unrestricted" />
</exec>
<!-- powershell 2.0 -->
<exec program="powershell.exe" if="${allow.powershell.unrestricted}" failonerror="false">
<arg value="set-executionpolicy unrestricted -force -scope CurrentUser" />
</exec>
</target>
</project>