Skip to content

Commit

Permalink
Merge pull request #13 from axodox/compatibility
Browse files Browse the repository at this point in the history
Switch to appveyor builds
  • Loading branch information
axodox authored Mar 15, 2017
2 parents 9f1e9a0 + aaae6fc commit f56254b
Show file tree
Hide file tree
Showing 9 changed files with 250 additions and 113 deletions.
207 changes: 135 additions & 72 deletions AxoCover/AxoCover.csproj

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions AxoCover/Models/TestAssemblyScanner.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
Expand All @@ -17,19 +16,19 @@ public string[] ScanAssemblyForTests(string assemblyPath)
try
{
var assembly = Assembly.LoadFrom(assemblyPath);
var testClasses = FilterByAttribute(assembly.ExportedTypes, nameof(TestClassAttribute))
var testClasses = FilterByAttribute(assembly.ExportedTypes, "TestClassAttribute")
.Where(p => !p.IsAbstract);

foreach (var testClass in testClasses)
{
var isClassIgnored = testClass.GetCustomAttributesData().Any(p => p.AttributeType.Name == nameof(IgnoreAttribute));
var testMethods = FilterByAttribute(testClass.GetMethods(), nameof(TestMethodAttribute));
var isClassIgnored = testClass.GetCustomAttributesData().Any(p => p.AttributeType.Name == "IgnoreAttribute");
var testMethods = FilterByAttribute(testClass.GetMethods(), "TestMethodAttribute");
var testClassName = testClass.FullName;

foreach (var testMethod in testMethods)
{
var testMethodName = testClassName + "." + testMethod.Name;
var isMethodIgnored = testMethod.GetCustomAttributesData().Any(p => p.AttributeType.Name == nameof(IgnoreAttribute));
var isMethodIgnored = testMethod.GetCustomAttributesData().Any(p => p.AttributeType.Name == "IgnoreAttribute");
if (isClassIgnored || isMethodIgnored)
{
testMethodName = IgnorePrefix + testMethodName;
Expand Down
9 changes: 9 additions & 0 deletions AxoCover/Resources.Designer.cs

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

3 changes: 3 additions & 0 deletions AxoCover/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -432,4 +432,7 @@
<data name="CoverByTestExcludeByTestAssemblyWarning" xml:space="preserve">
<value>Warning! Excluding test assemblies will prevent cover by test feature from working in those assemblies.</value>
</data>
<data name="AssemblyVersion" xml:space="preserve">
<value>Build version is {0}, please reference this in your feedback.</value>
</data>
</root>
9 changes: 9 additions & 0 deletions AxoCover/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Windows.Input;
using System.Windows.Media;
Expand All @@ -28,6 +29,14 @@ public PackageManifest Manifest
}
}

public string AssemblyVersion
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString(3);
}
}

public bool IsTelemetryEnabled
{
get
Expand Down
67 changes: 33 additions & 34 deletions AxoCover/Views/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,38 +51,36 @@

<!-- About -->
<Label Content="{x:Static res:Resources.About}" Style="{StaticResource Header}" Margin="-6,0"/>
<StackPanel>
<DockPanel>
<Image DockPanel.Dock="Right" Source="/AxoCover;component/Resources/icon.png" Stretch="Uniform" Margin="3,6,6,6" Width="64" VerticalAlignment="Top"/>
<StackPanel VerticalAlignment="Top" Margin="3">
<Label>
<TextBlock TextWrapping="Wrap">
<Run Text="{Binding Manifest.Name, Mode=OneTime}" FontWeight="Bold" FontSize="20px"/>
<Run Text="{Binding Manifest.Version, Mode=OneTime}" FontSize="16px"/>
<LineBreak/>
<Run Text="{Binding Manifest.Description, Mode=OneTime}"/>
</TextBlock>
</Label>
<StackPanel Margin="0,1.5">
<StackPanel.Resources>
<Style TargetType="controls:ActionButton">
<Setter Property="Icon" Value="/AxoCover;component/Resources/open.png"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="Margin" Value="0,1.5"/>
</Style>
</StackPanel.Resources>
<controls:ActionButton Text="{x:Static res:Resources.WebSite}"
Command="{Binding OpenWebSiteCommand}"/>
<controls:ActionButton Text="{x:Static res:Resources.ReleaseNotes}"
Command="{Binding OpenReleaseNotesDialogCommand}"/>
<controls:ActionButton Text="{x:Static res:Resources.SourceCode}"
Command="{Binding OpenSourceCodeCommand}"/>
<controls:ActionButton Text="{x:Static res:Resources.License}"
Command="{Binding OpenLicenseDialogCommand}"/>
</StackPanel>
</StackPanel>
</DockPanel>
</StackPanel>
<DockPanel>
<Image DockPanel.Dock="Right" Source="/AxoCover;component/Resources/icon.png" Stretch="Uniform" Margin="3,6,6,6" Width="64" VerticalAlignment="Top"/>
<StackPanel VerticalAlignment="Top" Margin="3">
<Label>
<TextBlock TextWrapping="Wrap">
<Run Text="{Binding Manifest.Name, Mode=OneTime}" FontWeight="Bold" FontSize="20px"/>
<Run Text="{Binding Manifest.Version, Mode=OneTime}" FontSize="16px"/>
<LineBreak/>
<Run Text="{Binding Manifest.Description, Mode=OneTime}"/>
</TextBlock>
</Label>
<StackPanel Margin="0,1.5">
<StackPanel.Resources>
<Style TargetType="controls:ActionButton">
<Setter Property="Icon" Value="/AxoCover;component/Resources/open.png"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="Margin" Value="0,1.5"/>
</Style>
</StackPanel.Resources>
<controls:ActionButton Text="{x:Static res:Resources.WebSite}"
Command="{Binding OpenWebSiteCommand}"/>
<controls:ActionButton Text="{x:Static res:Resources.ReleaseNotes}"
Command="{Binding OpenReleaseNotesDialogCommand}"/>
<controls:ActionButton Text="{x:Static res:Resources.SourceCode}"
Command="{Binding OpenSourceCodeCommand}"/>
<controls:ActionButton Text="{x:Static res:Resources.License}"
Command="{Binding OpenLicenseDialogCommand}"/>
</StackPanel>
</StackPanel>
</DockPanel>

<!-- Feedback settings -->
<Label Content="{x:Static res:Resources.Feedback}" Style="{StaticResource Header}"/>
Expand All @@ -94,12 +92,13 @@
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="Margin" Value="0,1.5"/>
</Style>
</StackPanel.Resources>
</StackPanel.Resources>
<controls:ActionButton Text="{x:Static res:Resources.OpenIssues}" Command="{Binding OpenIssuesCommand}"/>
<controls:ActionButton Text="{x:Static res:Resources.SendFeedback}" Command="{Binding SendFeedbackCommand}"/>
</StackPanel>
<TextBlock Text="{x:Static res:Resources.TelemetryDescription}" Style="{StaticResource Description}"/>
<CheckBox Content="{x:Static res:Resources.EnableTelemetry}" IsChecked="{Binding IsTelemetryEnabled}" Margin="3"/>
<CheckBox Content="{x:Static res:Resources.EnableTelemetry}" IsChecked="{Binding IsTelemetryEnabled}" Margin="3"/>
<TextBlock Text="{Binding AssemblyVersion, StringFormat={x:Static res:Resources.AssemblyVersion}}" Style="{StaticResource Description}"/>

<!-- Visualization settings -->
<Label Content="{x:Static res:Resources.VisualizationSettings}" Style="{StaticResource Header}"/>
Expand Down
30 changes: 30 additions & 0 deletions AxoCover/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,34 @@
<package id="Microsoft.Net.Compilers" version="1.3.2" targetFramework="net45" developmentDependency="true" />
<package id="Unity" version="4.0.1" targetFramework="net45" />
<package id="VsixUpdater" version="1.0.25" targetFramework="net45" />
<package id="VSSDK.CoreUtility" version="11.0.4" targetFramework="net45" />
<package id="VSSDK.CoreUtility.11" version="11.0.4" targetFramework="net45" />
<package id="VSSDK.DTE" version="7.0.4" targetFramework="net45" />
<package id="VSSDK.DTE.10" version="10.0.4" targetFramework="net45" />
<package id="VSSDK.DTE.8" version="8.0.4" targetFramework="net45" />
<package id="VSSDK.DTE.9" version="9.0.4" targetFramework="net45" />
<package id="VSSDK.GraphModel" version="11.0.4" targetFramework="net45" />
<package id="VSSDK.IDE" version="7.0.4" targetFramework="net45" />
<package id="VSSDK.IDE.10" version="10.0.4" targetFramework="net45" />
<package id="VSSDK.IDE.11" version="11.0.4" targetFramework="net45" />
<package id="VSSDK.IDE.8" version="8.0.4" targetFramework="net45" />
<package id="VSSDK.IDE.9" version="9.0.4" targetFramework="net45" />
<package id="VSSDK.OLE.Interop" version="7.0.4" targetFramework="net45" />
<package id="VSSDK.Shell.11" version="11.0.4" targetFramework="net45" />
<package id="VSSDK.Shell.Immutable.10" version="10.0.4" targetFramework="net45" />
<package id="VSSDK.Shell.Immutable.11" version="11.0.4" targetFramework="net45" />
<package id="VSSDK.Shell.Interop" version="7.0.4" targetFramework="net45" />
<package id="VSSDK.Shell.Interop.10" version="10.0.4" targetFramework="net45" />
<package id="VSSDK.Shell.Interop.11" version="11.0.4" targetFramework="net45" />
<package id="VSSDK.Shell.Interop.8" version="8.0.4" targetFramework="net45" />
<package id="VSSDK.Shell.Interop.9" version="9.0.4" targetFramework="net45" />
<package id="VSSDK.Text" version="11.0.4" targetFramework="net45" />
<package id="VSSDK.Text.11" version="11.0.4" targetFramework="net45" />
<package id="VSSDK.TextManager.Interop" version="7.0.4" targetFramework="net45" />
<package id="VSSDK.TextManager.Interop.8" version="8.0.4" targetFramework="net45" />
<package id="VSSDK.VSLangProj" version="7.0.4" targetFramework="net45" />
<package id="VSSDK.VSLangProj.10" version="10.0.4" targetFramework="net45" />
<package id="VSSDK.VSLangProj.11" version="11.0.4" targetFramework="net45" />
<package id="VSSDK.VSLangProj.8" version="8.0.4" targetFramework="net45" />
<package id="VSSDK.VSLangProj.9" version="9.0.4" targetFramework="net45" />
</packages>
2 changes: 1 addition & 1 deletion AxoCover/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="26901782-38e1-48d4-94e9-557d44db052e" Version="1.0.70.0" Language="en-US" Publisher="Péter Major" />
<Identity Id="26901782-38e1-48d4-94e9-557d44db052e" Version="1.0.71.0" Language="en-US" Publisher="Péter Major" />
<DisplayName>AxoCover</DisplayName>
<Description xml:space="preserve">Nice and free .Net code coverage support for Visual Studio with OpenCover.</Description>
<MoreInfo>https://marketplace.visualstudio.com/items?itemName=axodox1.AxoCover</MoreInfo>
Expand Down
25 changes: 25 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 1.0.{build}
skip_tags: true
configuration: Release
platform: Any CPU
assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: '{version}'
assembly_file_version: '{version}'
assembly_informational_version: '{version}'
before_build:
- cmd: nuget restore
build:
project: AxoCover.sln
verbosity: minimal
artifacts:
- path: AxoCover\bin\Release\AxoCover.vsix
name: AxoCover.vsix
deploy:
- provider: GitHub
tag: ${appveyor_repo_branch}-${appveyor_build_version}
auth_token:
secure: Vak3FzsaGXTJb/S0Ee3fPOWlHPNi52kz2e7WCLhwAa6pNe4jfKjl5rNEFfcnecI8
artifact: AxoCover.vsix
prerelease: false

0 comments on commit f56254b

Please sign in to comment.