Skip to content

get builds running on linux #271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/on-push-run-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: on-push-run-build
on: [push, pull_request]

env:
# Opt out of telemetry
DOTNET_CLI_TELEMETRY_OPTOUT: 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding DOTNET_NOLOGO: 1 to avoid the spam in the console.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know about this. I've included it. Thanks.

DOTNET_NOLOGO: 1

jobs:
build_linux:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'

- name: Build with dotnet
run: dotnet build --configuration Debug

- name: Run unit tests
run: dotnet test --no-build -c Debug

build_windows:

runs-on: windows-latest
steps:
- uses: actions/checkout@v2

- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'

- name: Build with dotnet
run: dotnet build --configuration Debug

- name: Run unit tests
run: dotnet test --no-build -c Debug
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*.sln.docstates
*.pidb
*.userprefs
*.idea

# Build results
[Dd]ebug/
Expand Down
21 changes: 0 additions & 21 deletions MethodDecorator.Fody.PnP.Tests/AssemblyExtensions.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;netcoreapp2.2</TargetFrameworks>
<TargetFramework>netcoreapp3.1</TargetFramework>
<DisableFody>true</DisableFody>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\MethodDecorator.Fody.Tests\AssemblyExtensions.cs" Link="AssemblyExtensions.cs" />
<Compile Include="..\MethodDecorator.Fody.Tests\Method.cs" Link="Method.cs" />
<Compile Include="..\MethodDecorator.Fody.Tests\StaticMembersDynamicWrapper.cs" Link="StaticMembersDynamicWrapper.cs" />
<Compile Include="..\MethodDecorator.Fody.Tests\TestsBase.cs" Link="TestsBase.cs" />

<PackageReference Include="FodyHelpers" Version="6.5.1" />
<PackageReference Include="Xunit" Version="2.4.1" />
<PackageReference Include="Verify.Xunit" Version="11.6.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;netcoreapp2.2</TargetFrameworks>
<TargetFramework>netcoreapp3.1</TargetFramework>
<DisableFody>true</DisableFody>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion MethodDecorator.Fody.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{40A4C9F0-C6C6-467D-B076-E9F0EBB4A7B4}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
README.md = README.md
readme.md = readme.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MethodDecorator.Fody.PnP.Tests", "MethodDecorator.Fody.PnP.Tests\MethodDecorator.Fody.PnP.Tests.csproj", "{8B02CB9B-FBF7-4D55-AB6E-12122472122C}"
Expand Down
6 changes: 5 additions & 1 deletion MethodDecorator/MethodDecorator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Authors>Simon Cropp, Matt Ellis, Alexey Suvorov, Andy Hoyle, Tony (@megafinz), and contributors</Authors>
<Description>Fody add-in to decorate arbitrary methods to run code before and after invocation.</Description>
<PackageTags>ILWeaving Fody AOP</PackageTags>
<NoWarn>CS1591;NU5228</NoWarn>
<NoWarn>CS1591;NU5228;NU5118</NoWarn>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't that hide an issue?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, so this warning is actually defined in Directory.Build.props. Because the project is set to treat all warnings as errors, when the weaving happens for the generated dll, it causes it to error out because the dll already exists.

What we want is it to ignore the warning and override the dll before packaging.

At least that's my understanding.

When I run the build in Rider or Command Line, it throws NU5118, if it's in Visual Studio on Windows it doesn't appear to throw as I believe it picks up the setting from Directory.Build.props

<PackageOutputPath>$(SolutionDir)nugets</PackageOutputPath>
<PackageIconUrl>https://raw.githubusercontent.com/Fody/MethodDecorator/master/package_icon.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/Fody/MethodDecorator</PackageProjectUrl>
Expand All @@ -16,4 +16,8 @@
<PackageReference Include="Fody" Version="6.5.1" PrivateAssets="none" />
<PackageReference Include="FodyPackaging" Version="6.5.1" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net452" Version="1.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
<DisableFody>true</DisableFody>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net452" Version="1.0.0" />
</ItemGroup>
</Project>
6 changes: 5 additions & 1 deletion TestAssemblies/SimpleTest.PnP/SimpleTest.PnP.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
<DisableFody>true</DisableFody>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\MethodDecorator\MethodDecorator.csproj"/>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net452" Version="1.0.0" />
</ItemGroup>
</Project>
6 changes: 5 additions & 1 deletion TestAssemblies/SimpleTest/SimpleTest.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
<DisableFody>true</DisableFody>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\AnotherAssemblyAttributeContainer\AnotherAssemblyAttributeContainer.csproj"/>
<ProjectReference Include="..\..\MethodDecorator\MethodDecorator.csproj"/>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net452" Version="1.0.0" />
</ItemGroup>
</Project>