1 Star 0 Fork 0

摩月流云/MaterialDesignInXamlToolkit

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
.github
.nuget
.paket
MahMaterialDragablzMashUp
MainDemo.Uwp
MainDemo.Wpf
MaterialDesignColors.Wpf.Tests
MaterialDesignColors.Wpf
MaterialDesignThemes.MahApps
MaterialDesignThemes.Uwp
MaterialDesignThemes.Wpf.Tests
MaterialDesignThemes.Wpf
mdresgen
paket-files
web
.editorconfig
.gitattributes
.gitignore
Code
LICENSE
MaterialDesignColors.nuspec
MaterialDesignThemes.MahApps.nuspec
MaterialDesignThemes.nuspec
MaterialDesignToolkit.ResourceGeneration.sln
MaterialDesignToolkit.Uwp.sln
MaterialDesignToolkit.Wpf.sln
MaterialDesignToolkit.Wpf.sln.vsext.disable
README.md
Versioning.targets
appveyor.yml
paket.dependencies
paket.lock
Clone or Download
Versioning.targets 3.81 KB
Copy Edit Raw Blame History
Kevin B authored 6 years ago . Build clean up (#1172)
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Based on http://www.lionhack.com/2014/02/13/msbuild-override-assembly-version/ -->
<!-- Defining custom Targets to execute before project compilation starts. -->
<PropertyGroup>
<CompileDependsOn>
CommonBuildDefineModifiedAssemblyVersion;
$(CompileDependsOn);
</CompileDependsOn>
<MDIXVersion>$(MDIXVersion)</MDIXVersion>
</PropertyGroup>
<!--
Creates modified version of AssemblyInfo.cs, replaces [AssemblyVersion] attribute with the one specifying actual build version (from MSBuild properties), and includes that file instead of the original AssemblyInfo.cs in the compilation.
Works with both, .cs and .vb version of the AssemblyInfo file, meaning it supports C# and VB.Net projects simultaneously.
-->
<Target Name="CommonBuildDefineModifiedAssemblyVersion" Condition="'$(MDIXVersion)' != ''">
<!-- Find AssemblyInfo.cs or AssemblyInfo.vb in the "Compile" Items. Remove it from "Compile" Items because we will use a modified version instead. -->
<ItemGroup>
<OriginalAssemblyInfo Include="@(Compile)" Condition="%(Filename) == 'AssemblyInfo' And (%(Extension) == '.vb' Or %(Extension) == '.cs')" />
<Compile Remove="**/AssemblyInfo.vb" />
<Compile Remove="**/AssemblyInfo.cs" />
</ItemGroup>
<!-- Copy the original AssemblyInfo.cs/.vb to obj\ folder, i.e. $(IntermediateOutputPath). The copied filepath is saved into @(ModifiedAssemblyInfo) Item. -->
<Copy SourceFiles="@(OriginalAssemblyInfo)"
DestinationFiles="@(OriginalAssemblyInfo->'$(IntermediateOutputPath)%(Identity)')">
<Output TaskParameter="DestinationFiles" ItemName="ModifiedAssemblyInfo"/>
</Copy>
<!-- Replace the version bit (in AssemblyVersion and AssemblyFileVersion attributes) using regular expression. Use the defined property: $(VersionAssembly). -->
<Message Text="Setting AssemblyVersion to $(MDIXVersion)" />
<RegexUpdateFile Files="@(ModifiedAssemblyInfo)"
Regex="Version\(&quot;(\d+)\.(\d+)(\.(\d+)\.(\d+|\*)|\.\d+|\.\*)&quot;\)"
ReplacementText="Version(&quot;$(MDIXVersion)&quot;)" />
<!-- Include the modified AssemblyInfo.cs/.vb file in "Compile" items (instead of the original). -->
<ItemGroup>
<Compile Include="@(ModifiedAssemblyInfo)" />
</ItemGroup>
</Target>
<UsingTask TaskName="RegexUpdateFile" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<Files ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
<Regex ParameterType="System.String" Required="true" />
<ReplacementText ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Text.RegularExpressions" />
<Using Namespace="Microsoft.Build.Framework" />
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
var rx = new System.Text.RegularExpressions.Regex(this.Regex);
for (int i = 0; i < Files.Length; ++i)
{
var path = Files[i].GetMetadata("FullPath");
if (!File.Exists(path)) continue;
var txt = File.ReadAllText(path);
txt = rx.Replace(txt, this.ReplacementText);
File.WriteAllText(path, txt);
}
return true;
}
catch (Exception ex) {
Log.LogErrorFromException(ex);
return false;
}
]]>
</Code>
</Task>
</UsingTask>
</Project>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/Jobc/MaterialDesignInXamlToolkit.git
git@gitee.com:Jobc/MaterialDesignInXamlToolkit.git
Jobc
MaterialDesignInXamlToolkit
MaterialDesignInXamlToolkit
master

Search