Skip to content

Commit

Permalink
Azure blob egress extension archives (#3580)
Browse files Browse the repository at this point in the history
  • Loading branch information
jander-msft authored Feb 9, 2023
1 parent 4100cc6 commit 86e789a
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 0 deletions.
1 change: 1 addition & 0 deletions eng/AfterSolutionBuild.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project>
<!-- Import ProjectToPublish items; all projects that would participate in publishing should be listed here. -->
<Import Project="$(MSBuildThisFileDirectory)AzureBlobStorageProjectToPublish.props" />
<Import Project="$(MSBuildThisFileDirectory)DotnetMonitorProjectToPublish.props" />

<!-- Only publish projects after build if opt-in -->
Expand Down
12 changes: 12 additions & 0 deletions eng/AzureBlobStorageProjectToPublish.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project>
<PropertyGroup>
<AzureBlobStoragePublishTargetFramework>$(LatestTargetFramework)</AzureBlobStoragePublishTargetFramework>
<AzureBlobStoragePublishTargetFramework Condition="'$(TargetFramework)' != ''">$(TargetFramework)</AzureBlobStoragePublishTargetFramework>
<AzureBlobStoragePublishPath>$(ArtifactsDir)pub\dotnet-monitor-egress-azureblobstorage\$(Configuration)\$(AzureBlobStoragePublishTargetFramework)\$(PackageRid)\</AzureBlobStoragePublishPath>
</PropertyGroup>
<ItemGroup>
<ProjectToPublish Include="$(RepoRoot)src\Extensions\AzureBlobStorage\AzureBlobStorage.csproj">
<AdditionalProperties>TargetFramework=$(AzureBlobStoragePublishTargetFramework);RuntimeIdentifier=$(PackageRid);PublishDir=$(AzureBlobStoragePublishPath)</AdditionalProperties>
</ProjectToPublish>
</ItemGroup>
</Project>
6 changes: 6 additions & 0 deletions eng/Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)Common.props" />
<ItemGroup Condition="'$(CreateArchives)' == 'true'">
<ProjectToBuild Include="$(RepoRoot)src\archives\pkgs\AzureBlobStorage\AzureBlobStorage-archive.proj">
<AdditionalProperties>TargetFramework=$(LatestTargetFramework);RuntimeIdentifier=$(PackageRid)</AdditionalProperties>
</ProjectToBuild>
<ProjectToBuild Include="$(RepoRoot)src\archives\symbols\AzureBlobStorage\AzureBlobStorage-symbols.proj">
<AdditionalProperties>TargetFramework=$(LatestTargetFramework);RuntimeIdentifier=$(PackageRid)</AdditionalProperties>
</ProjectToBuild>
<ProjectToBuild Include="$(RepoRoot)src\archives\pkgs\dotnet-monitor\dotnet-monitor-archive.proj">
<AdditionalProperties>TargetFramework=$(LatestTargetFramework);RuntimeIdentifier=$(PackageRid)</AdditionalProperties>
</ProjectToBuild>
Expand Down
13 changes: 13 additions & 0 deletions src/archives/AzureBlobStorage.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project>
<!-- Import ProjectToPublish items -->
<Import Project="$(RepositoryEngineeringDir)AzureBlobStorageProjectToPublish.props" />
<PropertyGroup>
<ArchiveContentRootPath>$(AzureBlobStoragePublishPath)</ArchiveContentRootPath>
</PropertyGroup>
<!-- These items are included in addition to those from publishing the AzureBlobStorage project. -->
<ItemGroup>
<FileToArchive Include="$(RepoRoot)LICENSE.TXT" />
</ItemGroup>
<!-- Import archive creation from published project -->
<Import Project="$(MSBuildThisFileDirectory)PublishedProjectArchive.targets" />
</Project>
21 changes: 21 additions & 0 deletions src/archives/pkgs/AzureBlobStorage/AzureBlobStorage-archive.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.Build.NoTargets">
<!-- Create dotnet-monitor-egress-azureblobstorage product archive (RID and TFM specific) -->
<PropertyGroup>
<ArchiveName>dotnet-monitor-egress-azureblobstorage</ArchiveName>
<TargetFrameworks>$(ToolTargetFrameworks)</TargetFrameworks>
<RuntimeIdentifiers>$(DefaultRuntimeIdentifiers)</RuntimeIdentifiers>
<IsShipping>true</IsShipping>
</PropertyGroup>
<Import Project="$(RepositoryArchivesDir)AzureBlobStorage.props" />
<PropertyGroup>
<PublishToDiskDependsOn>$(PublishToDiskDependsOn);UpdateFilesToArchive</PublishToDiskDependsOn>
</PropertyGroup>
<Target Name="UpdateFilesToArchive">
<ItemGroup>
<!-- Check extension so as to not mark 'dotnet-monitor-egress-azureblobstorage.dll' as executable. -->
<FileToArchive Condition="'%(Filename)%(Extension)' == 'dotnet-monitor-egress-azureblobstorage'">
<MarkExecutable>true</MarkExecutable>
</FileToArchive>
</ItemGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.Build.NoTargets">
<!-- Create dotnet-monitor-egress-azureblobstorage archive symbols package (RID and TFM specific). -->
<PropertyGroup>
<PackageId>azure-blob-egress-archive.$(RuntimeIdentifier)</PackageId>
<!--
Only include TargetFrameworks if a single TFM is not specified, otherwise nuget pack will include all TFMs in the same package.
Specify all TFMs to restore the project for all of them, but only build the symbols package for a single TFM.
-->
<TargetFrameworks Condition="'$(TargetFramework)' == ''">$(ToolTargetFrameworks)</TargetFrameworks>
<RuntimeIdentifiers>$(DefaultRuntimeIdentifiers)</RuntimeIdentifiers>
<Description>Symbols for the dotnet-monitor-egress-azureblobstorage $(RuntimeIdentifier) archive.</Description>
</PropertyGroup>
<Import Project="$(RepositoryArchivesDir)AzureBlobStorage.props" />
</Project>

0 comments on commit 86e789a

Please sign in to comment.