-
Notifications
You must be signed in to change notification settings - Fork 5
/
ApplyCredentials.msbuildproj
58 lines (56 loc) · 2.84 KB
/
ApplyCredentials.msbuildproj
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
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project=".packages\MSBuildTasks.1.5.0.235\tools\MSBuild.Community.Tasks.Targets" Condition=" Exists('.packages\MSBuildTasks.1.5.0.235\tools\MSBuild.Community.Tasks.Targets') " />
<PropertyGroup>
<OutputPath>bin</OutputPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="..\Satori.RTM.Credentials.props" Condition="Exists('..\Satori.RTM.Credentials.props')" />
<ItemGroup>
<SrcFiles Include="sources\**\*.cs" />
<SrcFiles Include="tests\**\*.cs" />
<SrcFiles Include="examples\**\*.cs" />
<SrcFiles Include="examples\**\*cs.tt" />
<SrcFiles Include="examples\**\*cs.t4" />
<SrcFiles Include="examples\**\*cs.out" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Target Name="Build" DependsOnTargets="Clean">
<Error Condition=" '$(Endpoint)' == '' OR $(Appkey) == '' " Text="RTM credentials are not specified" />
<FileUpdate Files="@(SrcFiles)" IgnoreCase="true"
Regex='(string endpoint = )\"YOUR_ENDPOINT\"'
ReplacementText='$1"$(Endpoint)"' />
<FileUpdate Files="@(SrcFiles)" IgnoreCase="true"
Regex='(string appkey = )\"YOUR_APPKeY\"'
ReplacementText='$1"$(Appkey)"' />
<FileUpdate Files="@(SrcFiles)" IgnoreCase="true"
Regex='(string role = )\"YOUR_ROLE\"'
ReplacementText='$1"$(AuthRoleName)"' />
<FileUpdate Files="@(SrcFiles)" IgnoreCase="true"
Regex='(string roleSecretKey = )\"YOUR_SECRET\"'
ReplacementText='$1"$(AuthRoleSecretKey)"' />
<FileUpdate Files="@(SrcFiles)" IgnoreCase="true"
Regex='(string restrictedChannel = )\"YOUR_CHANNEL\"'
ReplacementText='$1"$(AuthRestrictedChannel)"' />
</Target>
<Target Name="Clean">
<FileUpdate Files="@(SrcFiles)" IgnoreCase="true"
Regex='(string endpoint = )\"$(Endpoint)\"'
ReplacementText='$1"YOUR_ENDPOINT"' />
<FileUpdate Files="@(SrcFiles)" IgnoreCase="true"
Regex='(string appkey = )\"$(Appkey)\"'
ReplacementText='$1"YOUR_APPKeY"' />
<FileUpdate Files="@(SrcFiles)" IgnoreCase="true"
Regex='(string role = )\"$(AuthRoleName)\"'
ReplacementText='$1"YOUR_ROLE"' />
<FileUpdate Files="@(SrcFiles)" IgnoreCase="true"
Regex='(string roleSecretKey = )\"$(AuthRoleSecretKey)\"'
ReplacementText='$1"YOUR_SECRET"' />
<FileUpdate Files="@(SrcFiles)" IgnoreCase="true"
Regex='(string restrictedChannel = )\"$(AuthRestrictedChannel)\"'
ReplacementText='$1"YOUR_CHANNEL"' />
</Target>
</Project>