Skip to content

Commit

Permalink
Add .props and .targets to reduce duplication in project files (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdabros committed Jan 21, 2024
1 parent bbc0f8e commit 658e05f
Show file tree
Hide file tree
Showing 40 changed files with 171 additions and 498 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ on:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
inputs:
version:
description: 'Release version to tag and create'
required: false
# workflow_dispatch:
# inputs:
# version:
# description: 'Release version to tag and create'
# required: false

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
Expand Down
28 changes: 23 additions & 5 deletions SharpLearning.sln
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,34 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpLearning.Neural.Test",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpLearning.InputOutput", "src\SharpLearning.InputOutput\SharpLearning.InputOutput.csproj", "{D283D41E-AA14-44C5-AFB0-EBE6B34F3B7D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{55C8F585-6918-4373-A349-EDF167D77FBB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpLearning.XGBoost", "src\SharpLearning.XGBoost\SharpLearning.XGBoost.csproj", "{6637B36B-35E2-4FDB-8166-6472307D45BA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpLearning.XGBoost.Test", "src\SharpLearning.XGBoost.Test\SharpLearning.XGBoost.Test.csproj", "{FFD79827-ED40-47EB-9CB8-2E683DEA3606}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ci", "ci", "{45CBAF1D-3116-41E9-A374-231B544B3A9E}"
ProjectSection(SolutionItems) = preProject
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{D83436F7-2EE6-4D59-ACC3-355C973BCDAF}"
ProjectSection(SolutionItems) = preProject
.gitattributes = .gitattributes
.gitignore = .gitignore
CONTRIBUTING.md = CONTRIBUTING.md
src\Directory.Build.props = src\Directory.Build.props
global.json = global.json
LICENSE = LICENSE
README.md = README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpLearning.XGBoost", "src\SharpLearning.XGBoost\SharpLearning.XGBoost.csproj", "{6637B36B-35E2-4FDB-8166-6472307D45BA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpLearning.XGBoost.Test", "src\SharpLearning.XGBoost.Test\SharpLearning.XGBoost.Test.csproj", "{FFD79827-ED40-47EB-9CB8-2E683DEA3606}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{2204FA16-973A-48CF-A9FD-94FA72424BA4}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
OutputBuildProject.props = OutputBuildProject.props
OutputBuildProps.props = OutputBuildProps.props
OutputBuildTargets.props = OutputBuildTargets.props
SourceLink.GitHub.props = SourceLink.GitHub.props
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
4 changes: 0 additions & 4 deletions all.ps1

This file was deleted.

2 changes: 0 additions & 2 deletions build.cmd

This file was deleted.

9 changes: 0 additions & 9 deletions clean.ps1

This file was deleted.

22 changes: 0 additions & 22 deletions restore.ps1

This file was deleted.

49 changes: 41 additions & 8 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,46 @@
<Project>
<PropertyGroup>
<Version>0.31.8.0</Version>
<AssemblyVersion>0.31.8.0</AssemblyVersion>
<FileVersion>0.31.8.0</FileVersion>
<NeutralLanguage>en</NeutralLanguage>
<Authors>Mads Dabros</Authors>
<Copyright>Copyright © Mads Dabros 2014</Copyright>
<PackageLicenseUrl>https://github.com/mdabros/SharpLearning/blob/master/LICENSE.md</PackageLicenseUrl>
<PropertyGroup>
<AssemblyVersion>0.31.0</AssemblyVersion>
<FileVersion>0.31.9</FileVersion>
<InformationalVersion>$(FileVersion)</InformationalVersion>
<PackageVersion>$(InformationalVersion)</PackageVersion>
<!--https://github.com/dotnet/sourcelink/blob/main/docs/README.md#includesourcerevisionininformationalversion-->
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>

<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/mdabros/SharpLearning</PackageProjectUrl>
<RepositoryUrl>https://github.com/mdabros/SharpLearning</RepositoryUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>

<NeutralLanguage>en</NeutralLanguage>
<Authors>mdabros</Authors>
<Copyright>Copyright © mdabros 2024</Copyright>
<NeutralLanguage>en</NeutralLanguage>

<LibraryTargetFramework>netstandard2.0</LibraryTargetFramework>
<TestTargetFramework>net8</TestTargetFramework>

<LangVersion>12.0</LangVersion>
<Deterministic>true</Deterministic>
<DebugType>portable</DebugType>

<PublishRelease>true</PublishRelease>
<PackRelease>true</PackRelease>

<GenerateDocumentationFile>true</GenerateDocumentationFile>

<!--Disabled for now-->
<!--<AnalysisLevel>latest</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>-->
<NoWarn>CS1591</NoWarn>

</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)\OutputBuildProps.props" />

<Import Project="$(MSBuildThisFileDirectory)\SourceLink.Github.props" />

</Project>
3 changes: 3 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)\OutputBuildTargets.props" />
</Project>
11 changes: 11 additions & 0 deletions src/OutputBuildProject.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project>
<PropertyGroup>
<OutDirSpecified>$(BaseOutDir)_$(TargetFramework)</OutDirSpecified>
<OutDirSpecified Condition="$(RuntimeIdentifier) != ''">$(OutDirSpecified)_$(RuntimeIdentifier)</OutDirSpecified>
<OutDir>$(OutDirSpecified)\</OutDir>
<TargetDir>$(OutDir)</TargetDir>
<PublishDir>$(BasePublishDir)$(ProjectBuildDirectoryName)</PublishDir>
<PublishDir Condition="$(TargetFramework) != ''">$(PublishDir)_$(TargetFramework)</PublishDir>
<PublishDir Condition="$(RuntimeIdentifier) != ''">$(PublishDir)_$(RuntimeIdentifier)</PublishDir>
</PropertyGroup>
</Project>
20 changes: 20 additions & 0 deletions src/OutputBuildProps.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project>
<PropertyGroup Label="OutputBuildProps">
<Platform Condition="$(Platform) == ''">AnyCPU</Platform>
<Configuration Condition="$(Configuration) == ''">Debug</Configuration>

<!-- Custom properties -->
<BuildDir>$(MSBuildThisFileDirectory)..\build\</BuildDir>
<ProjectBuildDirectoryName>$(MSBuildProjectName)_$(Platform)_$(Configuration)</ProjectBuildDirectoryName>
<OutputPathWithoutEndSlash>$(BuildDir)$(ProjectBuildDirectoryName)</OutputPathWithoutEndSlash>
<BaseOutDir>$(OutputPathWithoutEndSlash)</BaseOutDir>
<BasePublishDir>$(MSBuildThisFileDirectory)..\publish\</BasePublishDir>

<!-- MSBuild defined properties redefined -->
<BaseIntermediateOutputPath>$(BuildDir)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
<BaseOutputPath>$(BuildDir)bin\$(MSBuildProjectName)\</BaseOutputPath>
<PackageOutputPath>$(BaseOutDir)</PackageOutputPath>

<BeforeTargetFrameworkInferenceTargets>$(MSBuildThisFileDirectory)OutputBuildProject.props</BeforeTargetFrameworkInferenceTargets>
</PropertyGroup>
</Project>
2 changes: 2 additions & 0 deletions src/OutputBuildTargets.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net8</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\..\BuildTest\Release\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\..\BuildTest\Debug\</OutputPath>
<TargetFramework>$(TestTargetFramework)</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
18 changes: 2 additions & 16 deletions src/SharpLearning.AdaBoost/SharpLearning.AdaBoost.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<TargetFrameworks>$(LibraryTargetFramework)</TargetFrameworks>
<PackageId>SharpLearning.AdaBoost</PackageId>
<Description>Provides learning algorithms and models for AdaBoost regression and classification.</Description>
<PackageTags>adaboost machinelearning classification regression machine learning</PackageTags>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>..\..\Build\Release\netstandard2.0\SharpLearning.AdaBoost.xml</DocumentationFile>
<OutputPath>..\..\Build\Release\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\..\Build\Debug\</OutputPath>
<PackageTags>ada-boost machine-learning classification regression machine learning</PackageTags>
</PropertyGroup>

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

<PropertyGroup>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<TargetFrameworks>$(LibraryTargetFramework)</TargetFrameworks>
<PackageId>SharpLearning.Common.Interfaces</PackageId>
<Description>Provides common interfaces for SharpLearning.</Description>
<Copyright>Copyright © Mads Dabros 2014</Copyright>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>..\..\Build\Release\netstandard2.0\SharpLearning.Common.Interfaces.xml</DocumentationFile>
<OutputPath>..\..\Build\Release\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\..\Build\Debug\</OutputPath>
<DocumentationFile></DocumentationFile>
</PropertyGroup>

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

<PropertyGroup>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net8</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\..\BuildTest\Release\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\..\BuildTest\Debug\</OutputPath>
<TargetFramework>$(TestTargetFramework)</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

Expand All @@ -30,8 +15,4 @@
<ProjectReference Include="..\SharpLearning.Containers\SharpLearning.Containers.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>

</Project>
20 changes: 1 addition & 19 deletions src/SharpLearning.Containers/SharpLearning.Containers.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<TargetFrameworks>$(LibraryTargetFramework)</TargetFrameworks>
<PackageId>SharpLearning.Containers</PackageId>
<Description>Provides containers and base extension methods for SharpLearning.</Description>
<Copyright>Copyright © Mads Dabros 2014</Copyright>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>..\..\Build\Release\netstandard2.0\SharpLearning.Containers.xml</DocumentationFile>
<OutputPath>..\..\Build\Release\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>1701;1702;1705</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\..\Build\Debug\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>1701;1702;1705</NoWarn>
</PropertyGroup>

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

<PropertyGroup>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>net8</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\..\BuildTest\Release\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\..\BuildTest\Debug\</OutputPath>
<TargetFramework>$(TestTargetFramework)</TargetFramework>
</PropertyGroup>

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

<PropertyGroup>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<TargetFrameworks>$(LibraryTargetFramework)</TargetFrameworks>
<PackageId>SharpLearning.CrossValidation</PackageId>
<Description>Provides cross-validation, training/test set samplers and learning curves for SharpLearning.</Description>
<PackageTags>crossvalidation cross validation sampling learningcurves machine learning</PackageTags>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>..\..\Build\Release\netstandard2.0\SharpLearning.CrossValidation.xml</DocumentationFile>
<OutputPath>..\..\Build\Release\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\..\Build\Debug\</OutputPath>
<PackageTags>cross-validation sampling learning-curves machine learning</PackageTags>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 658e05f

Please sign in to comment.