Merge pull request #700 from Frassle/stylecop

Conditional stylecop activation
This commit is contained in:
Jarl Gullberg 2017-12-30 14:40:20 +01:00 committed by GitHub
commit 21bd3e2cff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 37 additions and 83 deletions

19
build/StyleCop.props Normal file
View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<BuildWithStyleCop Condition=" '$(BuildWithStyleCop)' == ''">true</BuildWithStyleCop>
</PropertyGroup>
<PropertyGroup Condition="$(BuildWithStyleCop)">
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup Condition="$(BuildWithStyleCop)">
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll">
<Paket>True</Paket>
</Analyzer>
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.dll">
<Paket>True</Paket>
</Analyzer>
</ItemGroup>
</Project>

View file

@ -41,8 +41,6 @@
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<BaseAddress>285212672</BaseAddress> <BaseAddress>285212672</BaseAddress>
@ -275,12 +273,5 @@
<ItemGroup> <ItemGroup>
<Folder Include="Specifications\Docs\" /> <Folder Include="Specifications\Docs\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <Import Project="..\..\build\StyleCop.props" />
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll">
<Paket>True</Paket>
</Analyzer>
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.dll">
<Paket>True</Paket>
</Analyzer>
</ItemGroup>
</Project> </Project>

View file

@ -40,8 +40,6 @@
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<BaseAddress>285212672</BaseAddress> <BaseAddress>285212672</BaseAddress>
@ -157,14 +155,7 @@
</ItemGroup> </ItemGroup>
</When> </When>
</Choose> </Choose>
<ItemGroup> <Import Project="..\..\build\StyleCop.props" />
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll">
<Paket>True</Paket>
</Analyzer>
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.dll">
<Paket>True</Paket>
</Analyzer>
</ItemGroup>
<Choose> <Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v1.2')"> <When Condition="$(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v1.2')">
<ItemGroup> <ItemGroup>

View file

@ -14,8 +14,6 @@
<ProductVersion>12.0.0</ProductVersion> <ProductVersion>12.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -202,14 +200,7 @@
</ItemGroup> </ItemGroup>
</When> </When>
</Choose> </Choose>
<ItemGroup> <Import Project="..\..\build\StyleCop.props" />
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll">
<Paket>True</Paket>
</Analyzer>
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.dll">
<Paket>True</Paket>
</Analyzer>
</ItemGroup>
<Choose> <Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v1.2')"> <When Condition="$(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v1.2')">
<ItemGroup> <ItemGroup>

View file

@ -333,7 +333,7 @@ namespace OpenTK.Platform.MacOS
** Context functions ** Context functions
*/ */
[DllImport(agl)] internal static extern AGLContext aglCreateContext(AGLPixelFormat pix, AGLContext share); [DllImport(agl)] internal static extern AGLContext aglCreateContext(AGLPixelFormat pix, AGLContext share);
[DllImport(agl,EntryPoint="aglDestroyContext")] [DllImport(agl, EntryPoint="aglDestroyContext")]
private static extern byte _aglDestroyContext(AGLContext ctx); private static extern byte _aglDestroyContext(AGLContext ctx);
internal static bool aglDestroyContext(AGLContext context) internal static bool aglDestroyContext(AGLContext context)
{ {
@ -348,7 +348,7 @@ namespace OpenTK.Platform.MacOS
** Current state functions ** Current state functions
*/ */
[DllImport(agl,EntryPoint="aglSetCurrentContext")] [DllImport(agl, EntryPoint="aglSetCurrentContext")]
private static extern byte _aglSetCurrentContext(AGLContext ctx); private static extern byte _aglSetCurrentContext(AGLContext ctx);
internal static bool aglSetCurrentContext(IntPtr context) internal static bool aglSetCurrentContext(IntPtr context)
{ {
@ -370,7 +370,7 @@ namespace OpenTK.Platform.MacOS
/* /*
** Drawable Functions ** Drawable Functions
*/ */
[DllImport(agl,EntryPoint="aglSetDrawable")] [DllImport(agl, EntryPoint="aglSetDrawable")]
private static extern byte _aglSetDrawable(AGLContext ctx, AGLDrawable draw); private static extern byte _aglSetDrawable(AGLContext ctx, AGLDrawable draw);
internal static void aglSetDrawable(AGLContext ctx, AGLDrawable draw) internal static void aglSetDrawable(AGLContext ctx, AGLDrawable draw)
@ -458,8 +458,8 @@ namespace OpenTK.Platform.MacOS
/* /*
** Error functions ** Error functions
*/ */
[DllImport(agl,EntryPoint="aglGetError")] internal static extern AglError GetError(); [DllImport(agl, EntryPoint="aglGetError")] internal static extern AglError GetError();
[DllImport(agl,EntryPoint="aglErrorString")] [DllImport(agl, EntryPoint="aglErrorString")]
private static extern IntPtr _aglErrorString(AglError code); private static extern IntPtr _aglErrorString(AglError code);
internal static string ErrorString(AglError code) internal static string ErrorString(AglError code)
{ {
@ -476,7 +476,7 @@ namespace OpenTK.Platform.MacOS
** Surface texture function ** Surface texture function
*/ */
[DllImport(agl)] [DllImport(agl)]
private static extern void aglSurfaceTexture (AGLContext context, GLenum target, GLenum internalformat, AGLContext surfacecontext) ; private static extern void aglSurfaceTexture (AGLContext context, GLenum target, GLenum internalformat, AGLContext surfacecontext);
/* /*
** PBuffer functions ** PBuffer functions
@ -494,15 +494,15 @@ namespace OpenTK.Platform.MacOS
** Pbuffer Drawable Functions ** Pbuffer Drawable Functions
*/ */
[DllImport(agl)] [DllImport(agl)]
private static extern byte aglSetPBuffer (AGLContext ctx, AGLPbuffer pbuffer, int face, int level, int screen) ; private static extern byte aglSetPBuffer (AGLContext ctx, AGLPbuffer pbuffer, int face, int level, int screen);
[DllImport(agl)] [DllImport(agl)]
private static extern byte aglGetPBuffer (AGLContext ctx, AGLPbuffer *pbuffer, int *face, int *level, int *screen) ; private static extern byte aglGetPBuffer (AGLContext ctx, AGLPbuffer *pbuffer, int *face, int *level, int *screen);
/* /*
** CGL functions ** CGL functions
*/ */
[DllImport(agl)] [DllImport(agl)]
private static extern byte aglGetCGLContext(AGLContext ctx, void **cgl_ctx) ; private static extern byte aglGetCGLContext(AGLContext ctx, void **cgl_ctx);
[DllImport(agl)] [DllImport(agl)]
private static extern byte aglGetCGLPixelFormat(AGLPixelFormat pix, void **cgl_pix); private static extern byte aglGetCGLPixelFormat(AGLPixelFormat pix, void **cgl_pix);

View file

@ -127,7 +127,7 @@ namespace OpenTK.Platform.MacOS
dummyContext = new GraphicsContext(Context, dummyContext = new GraphicsContext(Context,
GetAddress, GetAddress,
delegate() delegate
{ {
return new ContextHandle(Agl.aglGetCurrentContext()); return new ContextHandle(Agl.aglGetCurrentContext());
}); });

View file

@ -41,7 +41,6 @@
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
@ -57,7 +56,6 @@
<RegisterForComInterop>False</RegisterForComInterop> <RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks> <RemoveIntegerChecks>False</RemoveIntegerChecks>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
<DebugType>full</DebugType> <DebugType>full</DebugType>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@ -73,7 +71,6 @@
<RegisterForComInterop>False</RegisterForComInterop> <RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks> <RemoveIntegerChecks>False</RemoveIntegerChecks>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
@ -169,6 +166,7 @@
</AdditionalFiles> </AdditionalFiles>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\build\StyleCop.props" />
<PropertyGroup> <PropertyGroup>
<PreBuildEvent> <PreBuildEvent>
</PreBuildEvent> </PreBuildEvent>

View file

@ -43,8 +43,6 @@
<TargetFrameworkProfile /> <TargetFrameworkProfile />
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<LangVersion>7</LangVersion> <LangVersion>7</LangVersion>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
@ -163,12 +161,5 @@
</When> </When>
</Choose> </Choose>
<Import Project="..\..\packages\gtk-sharp3\build\gtk-sharp3.targets" Condition="Exists('..\..\packages\gtk-sharp3\build\gtk-sharp3.targets')" Label="Paket" /> <Import Project="..\..\packages\gtk-sharp3\build\gtk-sharp3.targets" Condition="Exists('..\..\packages\gtk-sharp3\build\gtk-sharp3.targets')" Label="Paket" />
<ItemGroup> <Import Project="..\..\build\StyleCop.props" />
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll">
<Paket>True</Paket>
</Analyzer>
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.dll">
<Paket>True</Paket>
</Analyzer>
</ItemGroup>
</Project> </Project>

View file

@ -16,8 +16,6 @@
<AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk> <AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk>
<AssemblyName>OpenTK</AssemblyName> <AssemblyName>OpenTK</AssemblyName>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -269,12 +267,5 @@
<Exec WorkingDirectory="$(SolutionDir)src/Generator.Rewrite/bin/Debug/" Command="mono ./Rewrite.exe $(SolutionDir)src/OpenTK/bin/Debug/Android/OpenTK.dll $(SolutionDir)OpenTK.snk -debug" Condition="$(OS) != 'Windows_NT' and $(Configuration) == 'Debug'" /> <Exec WorkingDirectory="$(SolutionDir)src/Generator.Rewrite/bin/Debug/" Command="mono ./Rewrite.exe $(SolutionDir)src/OpenTK/bin/Debug/Android/OpenTK.dll $(SolutionDir)OpenTK.snk -debug" Condition="$(OS) != 'Windows_NT' and $(Configuration) == 'Debug'" />
<Exec WorkingDirectory="$(SolutionDir)src/Generator.Rewrite/bin/Release" Command="mono ./Rewrite.exe $(SolutionDir)src/OpenTK/bin/Release/Android/OpenTK.dll $(SolutionDir)OpenTK.snk" Condition="$(OS) != 'Windows_NT' and $(Configuration) == 'Release'" /> <Exec WorkingDirectory="$(SolutionDir)src/Generator.Rewrite/bin/Release" Command="mono ./Rewrite.exe $(SolutionDir)src/OpenTK/bin/Release/Android/OpenTK.dll $(SolutionDir)OpenTK.snk" Condition="$(OS) != 'Windows_NT' and $(Configuration) == 'Release'" />
</Target> </Target>
<ItemGroup> <Import Project="..\..\build\StyleCop.props" />
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll">
<Paket>True</Paket>
</Analyzer>
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.dll">
<Paket>True</Paket>
</Analyzer>
</ItemGroup>
</Project> </Project>

View file

@ -41,8 +41,6 @@
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
@ -825,12 +823,5 @@
</Properties> </Properties>
</MonoDevelop> </MonoDevelop>
</ProjectExtensions> </ProjectExtensions>
<ItemGroup> <Import Project="..\..\build\StyleCop.props" />
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll">
<Paket>True</Paket>
</Analyzer>
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.dll">
<Paket>True</Paket>
</Analyzer>
</ItemGroup>
</Project> </Project>

View file

@ -12,8 +12,6 @@
<ProductVersion>8.0.30703</ProductVersion> <ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -252,12 +250,5 @@
<Exec WorkingDirectory="$(SolutionDir)src/Generator.Rewrite/bin/Debug/" Command="mono ./Rewrite.exe $(SolutionDir)src/OpenTK/bin/Debug/iOS/OpenTK.dll $(SolutionDir)OpenTK.snk -dllimport -debug" Condition="$(OS) != 'Windows_NT' and $(Configuration) == 'Debug'" /> <Exec WorkingDirectory="$(SolutionDir)src/Generator.Rewrite/bin/Debug/" Command="mono ./Rewrite.exe $(SolutionDir)src/OpenTK/bin/Debug/iOS/OpenTK.dll $(SolutionDir)OpenTK.snk -dllimport -debug" Condition="$(OS) != 'Windows_NT' and $(Configuration) == 'Debug'" />
<Exec WorkingDirectory="$(SolutionDir)src/Generator.Rewrite/bin/Release" Command="mono ./Rewrite.exe $(SolutionDir)src/OpenTK/bin/Release/iOS/OpenTK.dll $(SolutionDir)OpenTK.snk -dllimport" Condition="$(OS) != 'Windows_NT' and $(Configuration) == 'Release'" /> <Exec WorkingDirectory="$(SolutionDir)src/Generator.Rewrite/bin/Release" Command="mono ./Rewrite.exe $(SolutionDir)src/OpenTK/bin/Release/iOS/OpenTK.dll $(SolutionDir)OpenTK.snk -dllimport" Condition="$(OS) != 'Windows_NT' and $(Configuration) == 'Release'" />
</Target> </Target>
<ItemGroup> <Import Project="..\..\build\StyleCop.props" />
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll">
<Paket>True</Paket>
</Analyzer>
<Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.dll">
<Paket>True</Paket>
</Analyzer>
</ItemGroup>
</Project> </Project>