Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
Updating the Nuclei.Build project to .Net standard 1.3
Browse files Browse the repository at this point in the history
references #7
  • Loading branch information
pvandervelde committed Jun 7, 2019
1 parent c87a530 commit 81e4c6b
Show file tree
Hide file tree
Showing 8 changed files with 240 additions and 134 deletions.
7 changes: 5 additions & 2 deletions src/nuclei.build/AssemblyBuildInformationAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

using System;
using System.Diagnostics.CodeAnalysis;
using Nuclei.Build.Properties;

namespace Nuclei.Build
{
Expand Down Expand Up @@ -34,12 +35,14 @@ public AssemblyBuildInformationAttribute(int buildNumber, string versionControlI
{
if (versionControlInformation == null)
{
throw new ArgumentNullException("versionControlInformation", "The version control information string should not be null");
throw new ArgumentNullException(nameof(versionControlInformation));
}

if (string.IsNullOrWhiteSpace(versionControlInformation))
{
throw new ArgumentException("The version control information string should not be an empty string.", "versionControlInformation");
throw new ArgumentException(
Resources.Exceptions_Messages_ParameterShouldNotBeAnEmptyString,
nameof(versionControlInformation));
}

BuildNumber = buildNumber;
Expand Down
7 changes: 5 additions & 2 deletions src/nuclei.build/AssemblyBuildTimeAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using Nuclei.Build.Properties;

namespace Nuclei.Build
{
Expand Down Expand Up @@ -38,12 +39,14 @@ public AssemblyBuildTimeAttribute(string buildTime)
{
if (buildTime == null)
{
throw new ArgumentNullException("buildTime", "The build time string should not be null");
throw new ArgumentNullException(nameof(buildTime));
}

if (string.IsNullOrWhiteSpace(buildTime))
{
throw new ArgumentException("The build time string should not be an empty string.", "buildTime");
throw new ArgumentException(
Resources.Exceptions_Messages_ParameterShouldNotBeAnEmptyString,
nameof(buildTime));
}

BuildTime = DateTimeOffset.ParseExact(buildTime, "o", CultureInfo.InvariantCulture);
Expand Down
105 changes: 33 additions & 72 deletions src/nuclei.build/Nuclei.Build.csproj
Original file line number Diff line number Diff line change
@@ -1,86 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<SolutionDir Condition="'$(SolutionDir)' == '' or '$(SolutionDir)' == '*undefined*'">$(MSBuildProjectDirectory)\..</SolutionDir>
</PropertyGroup>
<PropertyGroup>
<SolutionDir Condition="'$(SolutionDir)' == '' or '$(SolutionDir)' == '*undefined*'">$(MSBuildProjectDirectory)\..</SolutionDir>
<ProjectGuid>{AEA39FA0-9B45-4FDF-B94C-543E410F480C}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Nuclei.Build</RootNamespace>
<AssemblyName>Nuclei.Build</AssemblyName>
<!-- VS information -->
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<!-- Configuration -->
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<!-- Project directories -->
<AppDesignerFolder>Properties</AppDesignerFolder>
<OutputPath>$(SolutionDir)\..\build\bin\$(Platform)\$(Configuration)\</OutputPath>
<IntermediateOutputPath>$(SolutionDir)\..\build\temp\bin\obj\$(AssemblyName)\$(Platform)\$(Configuration)\</IntermediateOutputPath>
<!-- Build configuration -->
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<TargetFramework>netstandard1.3</TargetFramework>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<RestorePackages>true</RestorePackages>
<CodeAnalysisRuleSet>..\default.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>TRACE;DEBUG;CODE_ANALYSIS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE;CODE_ANALYSIS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Deploy|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>

<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.0.0</Version>
<Authors>P. van der Velde</Authors>
<Company>Company</Company>
<PackageId>Nuclei.Build</PackageId>
<Description>Provides attributes that can be applied to assemblies to provide build related information.</Description>
<Copyright>Mine</Copyright>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/thenucleus/nuclei.build</PackageProjectUrl>
<RepositoryUrl>https://github.com/thenucleus/nuclei.build</RepositoryUrl>
</PropertyGroup>
<Import Project="$(SolutionDir)/base.props" />
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)/../base.props" />
<ItemGroup>
<None Include="$(SOFTWARE_SIGNING_KEY_PATH)">
<Link>Properties\App.snk</Link>
</None>
<AdditionalFiles Include="..\stylecop.json" />
<None Include="nuclei.build.nuspec" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyBuildTimeAttribute.cs" />
<Compile Include="AssemblyBuildInformationAttribute.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.3" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
28 changes: 1 addition & 27 deletions src/nuclei.build/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,10 @@
using System.Runtime.InteropServices;
using Nuclei.Build;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Nuclei.Build")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyProduct("Nuclei.Build")]

[assembly: AssemblyCompany("")]
[assembly: AssemblyCopyright("Copyright © 2013")]

[assembly: AssemblyCulture("")]

// Resources
[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.MainAssembly)]
[assembly: NeutralResourcesLanguage("en-US")]

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
Expand All @@ -40,22 +30,6 @@
// Indicate that the assembly is CLS compliant.
[assembly: CLSCompliant(true)]

[assembly: AssemblyConfiguration("Release")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]

// The time the assembly was build
[assembly: AssemblyBuildTime(buildTime: "1900-01-01T00:00:00.0000000+00:00")]

Expand Down
73 changes: 73 additions & 0 deletions src/nuclei.build/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 81e4c6b

Please sign in to comment.