Skip to content

Commit

Permalink
Merge pull request #15 from dotnet-campus/t/walterlv/buildTransitive
Browse files Browse the repository at this point in the history
使源生成器的参数可在传递项目中生效
  • Loading branch information
lindexi authored Aug 14, 2024
2 parents 87cb9d1 + c43be67 commit dce0c0d
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 21 deletions.
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@
<PackageProjectUrl>https://github.com/dotnet-campus/dotnetCampus.Logger</PackageProjectUrl>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)src\dotnetCampus.Logger\Properties\Package\buildTransitive\Package.props" />

</Project>
5 changes: 5 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>

<Import Project="$(MSBuildThisFileDirectory)src\dotnetCampus.Logger\Properties\Package\buildTransitive\Package.targets" />

</Project>
2 changes: 1 addition & 1 deletion build/Version.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>0.1.0-alpha01</Version>
<Version>9999.0.0-localbuild</Version>
</PropertyGroup>
</Project>
1 change: 1 addition & 0 deletions dotnetCampus.Logger.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{AFB0DF31
build\Version.props = build\Version.props
.gitattributes = .gitattributes
.gitignore = .gitignore
Directory.Build.targets = Directory.Build.targets
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoggerSample.MainApp", "samples\LoggerSample.MainApp\LoggerSample.MainApp.csproj", "{C282F00B-0C42-491F-AC0D-967407E1C418}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\src\dotnetCampus.Logger\Properties\Package\build\Package.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -11,6 +9,4 @@
<ProjectReference Include="..\..\src\dotnetCampus.Logger\dotnetCampus.Logger.csproj" />
</ItemGroup>

<Import Project="..\..\src\dotnetCampus.Logger\Properties\Package\build\Package.targets" />

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\src\dotnetCampus.Logger\Properties\Package\build\Package.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -12,6 +10,4 @@
<ProjectReference Include="..\..\src\dotnetCampus.Logger.Analyzer\dotnetCampus.Logger.Analyzer.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

<Import Project="..\..\src\dotnetCampus.Logger\Properties\Package\build\Package.targets" />

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\src\dotnetCampus.Logger\Properties\Package\build\Package.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -12,6 +10,4 @@
<ProjectReference Include="..\..\src\dotnetCampus.Logger.Analyzer\dotnetCampus.Logger.Analyzer.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

<Import Project="..\..\src\dotnetCampus.Logger\Properties\Package\build\Package.targets" />

</Project>
4 changes: 0 additions & 4 deletions samples/LoggerSample.MainApp/LoggerSample.MainApp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\src\dotnetCampus.Logger\Properties\Package\build\Package.props" />

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
Expand All @@ -16,6 +14,4 @@
<ProjectReference Include="..\LoggerSample.LoggerIndependentProject\LoggerSample.LoggerIndependentProject.csproj" />
</ItemGroup>

<Import Project="..\..\src\dotnetCampus.Logger\Properties\Package\build\Package.targets" />

</Project>
11 changes: 7 additions & 4 deletions src/dotnetCampus.Logger/dotnetCampus.Logger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
<!-- Project Information -->
<PropertyGroup>
<RootNamespace>dotnetCampus.Logging</RootNamespace>
<Deterministic>true</Deterministic>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -44,8 +47,8 @@
<!-- 生成 NuGet 包。 -->
<Target Name="_IncludeAllDependencies" BeforeTargets="_GetPackageFiles">
<ItemGroup>
<None Include="Properties\Package\build\Package.props" Pack="True" PackagePath="build\$(PackageId).props" />
<None Include="Properties\Package\build\Package.targets" Pack="True" PackagePath="build\$(PackageId).targets" />
<None Include="Properties\Package\buildTransitive\Package.props" Pack="True" PackagePath="buildTransitive\$(PackageId).props" />
<None Include="Properties\Package\buildTransitive\Package.targets" Pack="True" PackagePath="buildTransitive\$(PackageId).targets" />
<None Include="..\..\artifacts\bin\dotnetCampus.Logger.Analyzer\$(Configuration)\**\*.dll" Pack="True" PackagePath="analyzers\dotnet\cs" />
</ItemGroup>
</Target>
Expand Down

0 comments on commit dce0c0d

Please sign in to comment.