Skip to content

Commit

Permalink
Updated build scripts/ruleset to latest from core Autofac.
Browse files Browse the repository at this point in the history
  • Loading branch information
tillig committed Aug 16, 2017
1 parent ffaa80a commit 46078f6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
6 changes: 6 additions & 0 deletions build/Analyzers.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
<RuleSet Name="Autofac Analyzer Rules" Description="Analyzer rules for Autofac assemblies." ToolsVersion="14.0">
<!-- https://github.com/dotnet/roslyn/blob/master/docs/compilers/Rule%20Set%20Format.md -->
<IncludeAll Action="Warning" />
<Rules AnalyzerId="Microsoft.Usage" RuleNamespace="Microsoft.Usage">
<!-- Implement serialization constructors - false positive when building .NET Core -->
<Rule Id="CA2229" Action="None" />
<!-- Mark ISerializable types with SerializableAttribute - false positive when building .NET Core -->
<Rule Id="CA2237" Action="None" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<!-- Prefix local calls with this -->
<Rule Id="SA1101" Action="None" />
Expand Down
2 changes: 1 addition & 1 deletion build/Autofac.Build.psd1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
RootModule = '.\Autofac.Build.psm1'
ModuleVersion = '0.1.0'
ModuleVersion = '0.2.0'
GUID = '55d3f738-f48f-4497-9b2c-ecd90ec1f978'
Author = 'Autofac Contributors'
CompanyName = 'Autofac'
Expand Down
29 changes: 24 additions & 5 deletions build/Autofac.Build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ function Invoke-DotNetPack
$PackagesPath,

[Parameter(Mandatory=$True, ValueFromPipeline=$False)]
[ValidateNotNull()]
[System.IO.DirectoryInfo]
$VersionSuffix
[AllowEmptyString()]
[string]
$VersionSuffix = ""
)
Begin
{
Expand All @@ -157,8 +157,27 @@ function Invoke-DotNetPack
{
foreach($Project in $ProjectDirectory)
{
& dotnet build ("""" + $Project.FullName + """") --configuration Release --version-suffix $VersionSuffix
& dotnet pack ("""" + $Project.FullName + """") --configuration Release --version-suffix $VersionSuffix --include-symbols --output $PackagesPath
if ($VersionSuffix -eq "")
{
& dotnet build ("""" + $Project.FullName + """") --configuration Release
}
else
{
& dotnet build ("""" + $Project.FullName + """") --configuration Release --version-suffix $VersionSuffix
}
if ($LASTEXITCODE -ne 0)
{
exit 1
}

if ($VersionSuffix -eq "")
{
& dotnet pack ("""" + $Project.FullName + """") --configuration Release --include-symbols --output $PackagesPath
}
else
{
& dotnet pack ("""" + $Project.FullName + """") --configuration Release --version-suffix $VersionSuffix --include-symbols --output $PackagesPath
}
if ($LASTEXITCODE -ne 0)
{
exit 1
Expand Down

0 comments on commit 46078f6

Please sign in to comment.