зеркало из https://github.com/dotnet/razor.git
80 строки
3.5 KiB
XML
80 строки
3.5 KiB
XML
<Project>
|
|
<Target
|
|
Name="GenerateMPack"
|
|
AfterTargets="Build"
|
|
DependsOnTargets="_MPackWriteAddinInfo"
|
|
Condition="'$(IsMPackProject)'=='true' and '$(TargetFramework)'!='' and ('$(DotNetBuildFromSource)' != 'true' or '$(ExcludeFromSourceBuild)' != 'true')">
|
|
|
|
<!--
|
|
In our case the mpack archive requires the following:
|
|
1. An addin.info
|
|
2. An addin binary (Microsoft.VisualStudio.Mac.RazorAddin.dll)
|
|
a. _Manifest.addin.xml embedded
|
|
b. Addin assembly attributes for metadata
|
|
3. All language service binaries
|
|
-->
|
|
|
|
<PropertyGroup>
|
|
<MPackName>$(AddinName)_$(AddinVersion)</MPackName>
|
|
<MPackFileName>$(MPackName).mpack</MPackFileName>
|
|
<MPackOutputPath>$(ArtifactsMPackDir)$(MPackFileName)</MPackOutputPath>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<MPackFile Include="$(ArtifactsBinDir)$(TargetName)\$(Configuration)\$(TargetFramework)\$(TargetName).dll" />
|
|
<MPackFile Include="$(ArtifactsBinDir)$(TargetName)\$(Configuration)\$(TargetFramework)\$(TargetName).pdb" />
|
|
</ItemGroup>
|
|
|
|
<RemoveDir Directories="$(IntermediateOutputPath)MPack\" />
|
|
<MakeDir Directories="$(IntermediateOutputPath);$(IntermediateOutputPath)MPack\" />
|
|
<Copy SourceFiles="@(MPackFile)" DestinationFolder="$(IntermediateOutputPath)MPack\" />
|
|
|
|
<MakeDir Directories="$(ArtifactsMPackDir)" />
|
|
<ZipDirectory
|
|
SourceDirectory="$(IntermediateOutputPath)MPack\"
|
|
DestinationFile="$(MPackOutputPath)"
|
|
Overwrite="true" />
|
|
|
|
<ItemGroup>
|
|
<FileWrites Include="$(MPackOutputPath)" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Target Name="_MPackWriteAddinInfo">
|
|
<PropertyGroup>
|
|
<MPackManifest>$(AddinDirectory)Properties\_Manifest.addin.xml</MPackManifest>
|
|
<AddinInfoFilePath>$(IntermediateOutputPath)addin.info</AddinInfoFilePath>
|
|
</PropertyGroup>
|
|
|
|
<!-- We need to resolve the language service assemblies to generate an addin.info for the mpack -->
|
|
<XmlPeek XmlInputPath="$(MPackManifest)" Query="/ExtensionModel/Runtime/Import/@assembly">
|
|
<Output TaskParameter="Result" ItemName="MPackAssemblyNames" />
|
|
</XmlPeek>
|
|
|
|
<!-- We need to resolve the addin dependencies to generate an addin.info for the mpack -->
|
|
<XmlPeek XmlInputPath="$(MPackManifest)" Query="/ExtensionModel/Dependencies/Addin">
|
|
<Output TaskParameter="Result" ItemName="AddinDependencies" />
|
|
</XmlPeek>
|
|
|
|
<ItemGroup>
|
|
<AddinInfoLine Include="<Addin id="$(AddinId)" namespace="$(AddinNamespace)" version="$(AddinVersion)" name="$(AddinDetailedName)" author="$(Authors)" description="$(Description)" category="$(AddinCategory)">" />
|
|
<AddinInfoLine Include=" <Runtime>" />
|
|
<AddinInfoLine Include=" <Import assembly="%(MPackAssemblyNames.Identity)" />" />
|
|
<AddinInfoLine Include=" <Import assembly="$(AddinName).dll" />" />
|
|
<AddinInfoLine Include=" </Runtime>" />
|
|
<AddinInfoLine Include=" <Dependencies>" />
|
|
<AddinInfoLine Include=" %(AddinDependencies.Identity)" />
|
|
<AddinInfoLine Include=" </Dependencies>" />
|
|
<AddinInfoLine Include="</Addin>" />
|
|
</ItemGroup>
|
|
|
|
<WriteLinesToFile File="$(AddinInfoFilePath)" Lines="@(AddinInfoLine)" Overwrite="true" />
|
|
|
|
<ItemGroup>
|
|
<FileWrites Include="$(AddinInfoFilePath)" />
|
|
<MPackFile Include="$(AddinInfoFilePath)" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
</Project>
|