forked from chocolatey/choco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversionBuilder.step
88 lines (77 loc) · 5.16 KB
/
versionBuilder.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
85
86
87
88
<?xml version="1.0" encoding="utf-8" ?>
<project name="VersionBuilder" default="go">
<!-- Project UppercuT - http://projectuppercut.org -->
<!-- DO NOT EDIT THIS FILE - This creates the assembly file to be used by the rest of the application - 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 -->
<target name="go" depends="run_tasks" />
<!-- run_normal_tasks is called from run_tasks unless replace extension exists-->
<target name="run_normal_tasks"
depends="error_check, determine_language, generate_key_file, generate_assembly_info"
description="Generating Assembly File." />
<target name="error_check">
<fail message="You must fill out the project.name, repository.path, and company.name settings in the ${build.config.settings} file. Please do that and retry the build."
if="${project.name=='__SOLUTION_NAME_WITHOUT_SLN_EXTENSION__' or company.name=='__COMPANY_NAME__'}" />
</target>
<target name="generate_key_file" description="Generates a .snk using the sn.exe tool if none exists and strong naming is specified" if="${sign.project_with_key}">
<echo level="Warning" message="Generating a strong name key (${path.key.name.private}) using ${app.strongname} if the key file doesn't already exist." />
<exec
program="${app.strongname}"
commandline="-k ${path.key.name.private}"
if="${file::exists(app.strongname) and not file::exists(path.key.name.private)}"
/>
<exec
program="${app.strongname}"
commandline="-p ${path.key.name.private} ${path.key.name.public}"
if="${file::exists(app.strongname)}"
/>
</target>
<target name="determine_language">
<if test="${language.short=='vb'}">
<property name="language.long" value="VB" />
</if>
</target>
<target name="generate_assembly_info" description="Generate assembly info">
<property name="version.assembly" value="${version.major}.${version.minor}.${version.build}.${version.revision}" />
<property name="version.assembly" value="${version.major}.${version.minor}.${version.patch}.${version.fix}" if="${version.use_semanticversioning}" />
<echo level="Warning" message="Generating SolutionVersion.${language.short} with assembly version ${version.assembly}." />
<property name="version.file" value="${version.major}.${version.minor}.${version.build}.${version.revision}" />
<property name="version.file" value="${version.major}.${version.minor}.${version.patch}.${version.fix}" if="${version.use_semanticversioning}" />
<property name="version.product" value="${version.hash}" />
<property name="version.product" value="${version.hash}" if="${version.use_semanticversioning}" />
<!-- remove TFS read only if there -->
<attrib file="${path.file.sharedassembly}" normal="true" if="${file::exists(path.file.sharedassembly)}" />
<asminfo output="${path.file.sharedassembly}" language="${language.long}">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
<import namespace="System.Runtime.InteropServices" />
<import namespace="System.Runtime.CompilerServices" />
<import namespace="System.Security" />
</imports>
<attributes>
<attribute type="ComVisibleAttribute" value="false" />
<attribute type="CLSCompliantAttribute" value="${assembly.clscompliant}" />
<attribute type="AssemblyCompanyAttribute" value="${company.name}" />
<attribute type="AssemblyVersionAttribute" value="${version.assembly}" />
<attribute type="AssemblyFileVersionAttribute" value="${version.file}" />
<attribute type="AssemblyInformationalVersionAttribute" value="${version.product}" />
<attribute type="AssemblyTitleAttribute" value="${project.name}" />
<attribute type="AssemblyProductAttribute" value="${project.name}" />
<attribute type="AssemblyDescriptionAttribute" value="${assembly.description}" />
<attribute type="AssemblyTrademarkAttribute" value="${project.name} - ${company.name}" />
<attribute type="AssemblyCopyrightAttribute" value="${assembly.copyright}" />
<attribute type="AllowPartiallyTrustedCallers" if="${allow.partially_trusted_callers}" asis="true" />
<attribute type="AssemblyKeyFileAttribute" value="${path::get-full-path(path.key.name.private)}" if="${sign.project_with_key}" />
<!--attribute type="SuppressIldasmAttribute" value="true" if="${run.obfuscator}" /-->
<attribute type="ObfuscateAssemblyAttribute" value="false" if="${run.obfuscator}" />
</attributes>
</asminfo>
</target>
</project>