Skip to content

Commit

Permalink
Common settings (microsoft#3610)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-nash authored Jun 18, 2024
1 parent bb0bfb8 commit 41e8505
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 130 deletions.
31 changes: 19 additions & 12 deletions packages/http-client-csharp/generator/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,20 @@
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<RepoEngPath>$(MSBuildThisFileDirectory)../eng</RepoEngPath>
<IsTestProject Condition="$(MSBuildProjectName.EndsWith('.Tests'))">true</IsTestProject>
<IsPerfProject Condition="$(MSBuildProjectName.EndsWith('.Perf'))">true</IsPerfProject>
<IsSrcProject Condition="'$(IsTestProject)' != 'true' and '$(IsPerfProject)' != 'true'">true</IsSrcProject>
<CentralPackagesFile>$(MSBuildThisFileDirectory)Packages.Data.props</CentralPackagesFile>
<ShouldUseCentralVersions Condition="'$(ShouldUseCentralVersions)' == ''">true</ShouldUseCentralVersions>
</PropertyGroup>

<PropertyGroup Condition="'$(IsTestProject)' != 'true'">
<PackageIcon>packageIcon.png</PackageIcon>
<PackageIconPath>$(RepoEngPath)/images/$(PackageIcon)</PackageIconPath>
</PropertyGroup>

<!-- Setup default project properties -->
<PropertyGroup>
<Nullable>enable</Nullable>
<TargetFramework>net8.0</TargetFramework>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
<PlatformName Condition="'$(PlatformName)' == ''">$(Platform)</PlatformName>
</PropertyGroup>

<!-- Setup common output paths -->
<PropertyGroup>
<!-- Setup common output paths -->
<ArtifactsDir Condition="'$(ArtifactsDir)' == ''">$(RepoRoot)artifacts\</ArtifactsDir>
<ArtifactsObjDir>$(ArtifactsDir)obj\</ArtifactsObjDir>
<ArtifactsBinDir>$(ArtifactsDir)bin\</ArtifactsBinDir>
Expand All @@ -43,13 +39,24 @@

<PackageOutputPath>$(ArtifactsPackagesDir)</PackageOutputPath>
<CodeAnalysisRuleSet>$(RepoEngPath)\CodeAnalysis.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<PropertyGroup>
<DelaySign>false</DelaySign>
<PublicSign>false</PublicSign>
<ImportDefaultReferences>false</ImportDefaultReferences>
<LangVersion>12.0</LangVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(IsSrcProject)' == 'true'">
<PackageIcon>packageIcon.png</PackageIcon>
<PackageIconPath>$(RepoEngPath)/images/$(PackageIcon)</PackageIconPath>
</PropertyGroup>

<PropertyGroup Condition="'$(IsPerfProject)' == 'true'">
<OutputType>Exe</OutputType>
</PropertyGroup>

<PropertyGroup Condition="'$(IsTestProject)' == 'true'">
<IsPackable>false</IsPackable>
</PropertyGroup>

</Project>
19 changes: 17 additions & 2 deletions packages/http-client-csharp/generator/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(CentralPackagesFile)" Condition="'$(ShouldUseCentralVersions)' == 'true'" />

<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" Condition="'$(IsTestProject)' != 'true'">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -9,9 +9,24 @@
<Visible>false</Visible>
</AdditionalFiles>
</ItemGroup>

<!-- Add Package Icon to Non-test Packages -->
<ItemGroup Condition="'$(IsTestProject)' != 'true'">
<ItemGroup Condition="'$(IsSrcProject)' == 'true'">
<None Include="$(PackageIconPath)" Pack="true" PackagePath=""/>
</ItemGroup>

<ItemGroup Condition="'$(IsPerfProject)' == 'true'">
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" />
</ItemGroup>

<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
</ItemGroup>

<Import Project="$(CentralPackagesFile)" Condition="'$(ShouldUseCentralVersions)' == 'true'" />

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

<PropertyGroup>
<PackageId>Microsoft.Generator.CSharp.ClientModel</PackageId>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>1.0.0-beta.1</Version>
</PropertyGroup>

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

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\src\Microsoft.Generator.CSharp.ClientModel.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>1.0.0-beta.1</Version>
</PropertyGroup>

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

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\src\Microsoft.Generator.CSharp.Input.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PackageId>Microsoft.Generator.CSharp.Input</PackageId>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>1.0.0-beta.1</Version>
</PropertyGroup>

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

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\src\Microsoft.Generator.CSharp.Input.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
readme.md = readme.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestProjects.Local.Tests", "TestProjects\Local\TestProjects.Local.Tests.csproj", "{BFE39EDA-ADA1-4F60-A47C-ADE88C67B3B7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Generator.CSharp.ClientModel.Tests", "Microsoft.Generator.CSharp.ClientModel\test\Microsoft.Generator.CSharp.ClientModel.Tests.csproj", "{D30EC838-B0A0-44CD-A361-239FF256A176}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Generator.CSharp.Input.Tests.Perf", "Microsoft.Generator.CSharp.Input\perf\Microsoft.Generator.CSharp.Input.Tests.Perf.csproj", "{DF2E7916-D0C4-47CA-876A-5B78A3A3FD77}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Generator.CSharp.Tests.Perf", "Microsoft.Generator.CSharp\perf\Microsoft.Generator.CSharp.Tests.Perf.csproj", "{8AE5D726-610C-4A72-B2A9-5C53C423C485}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestProjects.Local.Tests", "TestProjects\ProjFiles\TestProjects.Local.Tests.csproj", "{3AEDFB67-39E3-4BB7-976E-F44F59402034}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -58,10 +58,6 @@ Global
{043B51D2-52CB-4521-BF9A-9D3A45E8998D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{043B51D2-52CB-4521-BF9A-9D3A45E8998D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{043B51D2-52CB-4521-BF9A-9D3A45E8998D}.Release|Any CPU.Build.0 = Release|Any CPU
{BFE39EDA-ADA1-4F60-A47C-ADE88C67B3B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BFE39EDA-ADA1-4F60-A47C-ADE88C67B3B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BFE39EDA-ADA1-4F60-A47C-ADE88C67B3B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BFE39EDA-ADA1-4F60-A47C-ADE88C67B3B7}.Release|Any CPU.Build.0 = Release|Any CPU
{D30EC838-B0A0-44CD-A361-239FF256A176}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D30EC838-B0A0-44CD-A361-239FF256A176}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D30EC838-B0A0-44CD-A361-239FF256A176}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -74,6 +70,10 @@ Global
{8AE5D726-610C-4A72-B2A9-5C53C423C485}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8AE5D726-610C-4A72-B2A9-5C53C423C485}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8AE5D726-610C-4A72-B2A9-5C53C423C485}.Release|Any CPU.Build.0 = Release|Any CPU
{3AEDFB67-39E3-4BB7-976E-F44F59402034}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3AEDFB67-39E3-4BB7-976E-F44F59402034}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3AEDFB67-39E3-4BB7-976E-F44F59402034}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3AEDFB67-39E3-4BB7-976E-F44F59402034}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Microsoft.Generator.CSharp.ClientModel\src\Microsoft.Generator.CSharp.ClientModel.csproj" />
<ProjectReference Include="..\src\Microsoft.Generator.CSharp.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PackageId>Microsoft.Generator.CSharp</PackageId>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>1.0.0-beta.1</Version>
</PropertyGroup>

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

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\src\Microsoft.Generator.CSharp.csproj" />
<Compile Include="../../TestProjects/Local/Unbranded-TypeSpec/src/Generated/Internal/**/*.cs" Exclude="../../TestProjects/Local/Unbranded-TypeSpec/src/Generated/Internal/ModelSerializationExtensions.cs" Link="Generated/Helpers/%(RecursiveDir)/%(Filename)%(Extension)" />
Expand Down
10 changes: 1 addition & 9 deletions packages/http-client-csharp/generator/Packages.Data.props
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Test only dependencies. -->
<ItemGroup Condition="$(MSBuildProjectName.EndsWith('.Tests'))">
<ItemGroup>
<PackageReference Update="Moq" Version="[4.20.70]" />
<PackageReference Update="NUnit" Version="3.13.2" />
<PackageReference Update="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0" />
</ItemGroup>

<ItemGroup Condition="$(MSBuildProjectName.EndsWith('.Perf'))">
<PackageReference Update="BenchmarkDotNet" Version="0.13.4" />
<PackageReference Update="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.4" />
</ItemGroup>

<!-- All csproj dependencies. -->
<ItemGroup>
<PackageReference Update="CommandLineParser" Version="2.9.1" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
<PackageReference Update="Microsoft.Build" Version="17.9.5" />
Expand Down

This file was deleted.

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

<ItemGroup>
<PackageReference Include="System.Memory.Data" />
<PackageReference Include="System.ClientModel" />
</ItemGroup>

<ItemGroup>
<None Remove="./**/*.*" />
</ItemGroup>

<ItemGroup>
<Compile Include="../Local/**/*.cs" Exclude="../Local/**/Properties/**/*.cs" Link="Projects/%(RecursiveDir)/%(Filename)%(Extension)" />
</ItemGroup>

</Project>

0 comments on commit 41e8505

Please sign in to comment.