Skip to content
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

add Akka.Analyzers install canary #103

Draft
wants to merge 18 commits into
base: dev
Choose a base branch
from
Draft
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
14 changes: 13 additions & 1 deletion .github/workflows/pr_validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,16 @@ jobs:
fi

- name: "dotnet pack"
run: dotnet pack -c Release
run: dotnet pack -c Release -o ./bin/nuget

- name: "Install Akka.Analyzers into .NET Framework Canary"
if: matrix.os == 'windows-latest'
shell: pwsh
working-directory: ./test/Akka.Analyzers.NetFxInstallCanary
run: |
# Install Akka.Analyzers package
dotnet add package Akka.Analyzers
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the issue - we need to replace these dotnet SDK calls with pre-SDK ones, such as using the NuGet PowerShell scripts. That might be a pain in the butt, but it's necessary if we want to support #106


# Restore and build the project
dotnet restore
dotnet build
23 changes: 23 additions & 0 deletions localTest.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Store the original working directory
$originalDir = Get-Location

try {
dotnet pack -c Release -o ./bin/nuget

cd ./test/Akka.Analyzers.NetFxInstallCanary

# Install Akka.Analyzers package
# package source mapping should force it to happen using local dir
dotnet add package Akka.Analyzers

# Restore and build the project
dotnet restore
dotnet build
}
catch {
Write-Error "An error occurred: $_"
}
finally {
# Return to the original directory
Set-Location $originalDir
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{13B048E3-D496-4F5E-BFF8-2305462171D1}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Akka.Analyzers.NetFxInstallCanary</RootNamespace>
<AssemblyName>Akka.Analyzers.NetFxInstallCanary</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</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>
5 changes: 5 additions & 0 deletions test/Akka.Analyzers.NetFxInstallCanary/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>

</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
</PropertyGroup>
</Project>
9 changes: 9 additions & 0 deletions test/Akka.Analyzers.NetFxInstallCanary/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Akka.Analyzers.NetFxInstallCanary
{
internal class Program
{
public static void Main(string[] args)
{
}
}
}
35 changes: 35 additions & 0 deletions test/Akka.Analyzers.NetFxInstallCanary/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;

// 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("Akka.Analyzers.NetFxInstallCanary")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Akka.Analyzers.NetFxInstallCanary")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("13B048E3-D496-4F5E-BFF8-2305462171D1")]

// 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")]
5 changes: 5 additions & 0 deletions test/Akka.Analyzers.NetFxInstallCanary/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# NET Framework Install Canary

This is a basic C# project running on .NET Framework 4.8. In our Windows build pipeline we are going to attempt to install Akka.Analyzers from its NuGet output. This install will fail until https://github.com/akkadotnet/akka.net/issues/7307 is resolved.

Do not modify this project or do anything else with it.
17 changes: 17 additions & 0 deletions test/Akka.Analyzers.NetFxInstallCanary/nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>

<packageSourceMapping>
<packageSource key="nuget">
<package pattern="*" />
</packageSource>
<packageSource key="local">
<package pattern="Akka.Analyzers" />
</packageSource>
</packageSourceMapping>
</configuration>