forked from teocomi/BCFier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Release.proj
97 lines (80 loc) · 3.38 KB
/
Release.proj
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
<?xml version="1.0" encoding="utf-8" ?>
<Project DefaultTargets="BuildAll"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Release.proj:
Builds and obfuscates a release.
You can make msbuild build the release by running the following command:
msbuild Release.proj
-->
<!-- default to release build -->
<PropertyGroup Condition="!Exists('$(Configuration)')">
<Configuration>Release</Configuration>
</PropertyGroup>
<!-- paths for finding bits -->
<PropertyGroup>
<BasePath>$(MSBuildProjectDirectory)</BasePath>
<ExePath>$(BasePath)\Bcfier.Win\bin\$(Configuration)</ExePath>
<DllPath>$(BasePath)\\Bcfier\bin\$(Configuration)</DllPath>
<RevitPath>$(BasePath)\\Bcfier.Revit\bin\$(Configuration)</RevitPath>
</PropertyGroup>
<!-- obfuscator bits -->
<PropertyGroup>
<ObfuscatorExe Condition=" '$(OS)' == 'Windows_NT' ">C:\bitbucket\obfuscar\bin\Release\Obfuscar.Console.exe</ObfuscatorExe>
<ObfuscatorExe Condition=" '$(OS)' != 'Windows_NT' ">mono C:\bitbucket\obfuscar\bin\Release\Obfuscar.Console.exe</ObfuscatorExe>
<ObfuscatorProject>$(BasePath)\obfuscar.xml</ObfuscatorProject>
<ObfuscatorInput>$(BasePath)\Obfuscator_Input</ObfuscatorInput>
<ObfuscatorOutput>$(BasePath)\Obfuscator_Output</ObfuscatorOutput>
</PropertyGroup>
<ItemGroup>
<!-- main exes -->
<ObfuscatedFile Include="$(ExePath)\Teocomi.Bcfier.Win.exe" />
<ObfuscatedFile Include="$(DllPath)\Teocomi.Bcfier.dll" />
<ObfuscatedFile Include="$(RevitPath)\Teocomi.Bcfier.Revit.dll" />
</ItemGroup>
<ItemGroup>
<CompileSolution Include="$(BasePath)\BCFier.sln" />
<CompileObfuscar Include="C:\bitbucket\obfuscar\Obfuscar.sln" />
</ItemGroup>
<!-- clean, compile and package! -->
<Target Name="BuildAll" DependsOnTargets="Prepare;Clean;Compile;Obfuscate" />
<!-- clean outputs and temp obfuscation files -->
<Target Name="Clean">
<MSBuild Projects="@(CompileProject);@(CompileSolution)"
Properties="Configuration=$(Configuration)"
Targets="Clean" />
<RemoveDir Directories="Final" />
<RemoveDir Directories="$(ObfuscatorInput)" />
<RemoveDir Directories="$(ObfuscatorOutput)" />
</Target>
<!-- prepare -->
<Target Name="Prepare">
<Exec Command='C:\bitbucket\obfuscar\.nuget\NuGet.exe restore @(CompileObfuscar)' Condition=" '$(OS)' == 'Windows_NT' " />
<Exec Command='mono C:\bitbucket\obfuscar\.nuget\NuGet.exe restore @(CompileObfuscar)' Condition=" '$(OS)' != 'Windows_NT' " />
<MSBuild Projects="@(CompileObfuscar)"
Properties="Configuration=$(Configuration)" />
</Target>
<!-- compile -->
<Target Name="Compile">
<MSBuild Projects="@(CompileSolution)"
Properties="Configuration=$(Configuration)" />
</Target>
<!-- copies files that are to be obfuscated -->
<Target Name="CopyObfuscatedFiles"
DependsOnTargets="Compile">
<MakeDir Directories="$(ObfuscatorInput)" />
<!-- copy files that will be obfuscated to obfuscator input -->
<Copy SourceFiles="@(ObfuscatedFile)"
DestinationFolder="$(ObfuscatorInput)" />
</Target>
<!-- obfuscate -->
<Target Name="Obfuscate"
DependsOnTargets="CopyObfuscatedFiles">
<MakeDir Directories="$(ObfuscatorOutput)" />
<Exec Command='$(ObfuscatorExe) "$(ObfuscatorProject)"' />
<Copy SourceFiles="@(ObfuscatedFile->'$(ObfuscatorOutput)\%(filename)%(extension)')"
DestinationFolder="Final" />
<Copy SourceFiles="$(ObfuscatorOutput)\Mapping.txt"
DestinationFolder="Final" />
</Target>
</Project>