Skip to content

Commit

Permalink
refactor: remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Jun 5, 2024
1 parent f94f993 commit fa00d67
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 68 deletions.
62 changes: 0 additions & 62 deletions src/Directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -75,66 +75,4 @@
<SourceRoot Include="$(MSBuildThisFileDirectory)/" />
</ItemGroup>

<!--
Fix for .NET Core 3.0, see https://github.com/dotnet/core-sdk/issues/192, it
uses obj/release instead of [outputdirectory]
-->
<!-- <PropertyGroup Condition=" '$(DotNetPackIntermediateOutputPath)' != '' ">
<IntermediateOutputPath>$(DotNetPackIntermediateOutputPath)</IntermediateOutputPath>
</PropertyGroup> -->

<!--
// This task disable doc warnings in the auto-generated XamlTypeInfo.g.cs file,
// and also hides the public class from intellisense.
-->
<UsingTask TaskName="XamlTypeInfoBuildTask" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<InputFilename ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Using Namespace="System" />
<Using Namespace="Microsoft.Build.Framework" />
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="Fragment" Language="cs">
<![CDATA[
//Note: If this task returns 'false' it will break the shared project manager project picker and intellisense.
//so we always return true.
try {
Log.LogMessage(MessageImportance.Normal, "XamlTypeInfoBuildTask: InputFilename = " + InputFilename);
if (!System.IO.File.Exists(InputFilename))
{
return true;
}
string code = System.IO.File.ReadAllText(InputFilename);
if (code.StartsWith("#pragma warning disable 1591")) //Already modified
return true;
int idx = code.IndexOf("[global::System.CodeDom.Compiler.GeneratedCodeAttribute");
if (idx < 0)
{
return true;
}
string insert = "[global::System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]\n ";
code = "#pragma warning disable 1591\n" + code.Substring(0, idx) + insert + code.Substring(idx) +
"#pragma warning restore 1591\n";
System.IO.File.WriteAllText(InputFilename, code);
Log.LogMessage(MessageImportance.Normal, "XamlTypeInfoBuildTask: File now modified");
return true;
}
catch (Exception ex) {
ex = new Exception("XamlTypeInfoBuildTask: " + ex.Message, ex);
Log.LogErrorFromException(ex);
return false;
}
]]>
</Code>
</Task>
</UsingTask>
<Target Name="XamlTypeInfoBuildTask"
Condition=" $(TargetFramework.StartsWith('uap')) and '$(DesignTimeBuild)' != 'true' "
AfterTargets="MarkupCompilePass2"
BeforeTargets="CoreCompile">
<XamlTypeInfoBuildTask InputFilename="$(IntermediateOutputPath)\XamlTypeInfo.g.cs" />
</Target>

</Project>
6 changes: 0 additions & 6 deletions src/Directory.build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@
<RepositoryType>git</RepositoryType>
</PropertyGroup>

<!-- Workaround. Remove once we're on 3.1.300+
https://github.com/dotnet/sourcelink/issues/572 -->
<!-- <PropertyGroup>
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
</PropertyGroup> -->

<ItemGroup>
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)"/>
</ItemGroup>
Expand Down

0 comments on commit fa00d67

Please sign in to comment.