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

Basic NuGet package investigation #420

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
44 changes: 42 additions & 2 deletions FNA.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net7.0</TargetFrameworks>
<Platforms>x64</Platforms>
<TargetFrameworks>net40;netstandard2.0;net7.0</TargetFrameworks>
Copy link
Member

Choose a reason for hiding this comment

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

I believe this will break due to the reasons listed here: #355 (comment)

Copy link
Author

Choose a reason for hiding this comment

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

It seems to work fine for me... maybe it was a fluke? SDL2# is set up the same way https://github.com/flibitijibibo/SDL2-CS/blob/master/SDL2-CS.Core.csproj#L3

Choose a reason for hiding this comment

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

VS 2022 and OmniSharp are forcing our hand here, since Intellisense has a very bad time when referencing projects that target both Framework and Core.

@flibitijibibo Is there any way to repro the issue you saw? I'd be curious to follow up the root cause issue of this

</PropertyGroup>
<PropertyGroup>
<EnableDefaultItems>false</EnableDefaultItems>
Expand All @@ -10,6 +9,30 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup>
<IsPackable>true</IsPackable>
<Version>23.07</Version>
<Description>Accuracy-focused XNA4 reimplementation for open platforms</Description>
<Copyright>Copyright (c) 2009-2023</Copyright>
<Authors>flibitijibibo</Authors>
<PackageProjectUrl>https://fna-xna.github.io/</PackageProjectUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>FNA.png</PackageIcon>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
</PropertyGroup>
<PropertyGroup>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>

Choose a reason for hiding this comment

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

Another way to use the source is using the GitHub source link:

<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />

see documentation. This does a package reference to the project though, but it's how you can point to the GitHub code directly.

Copy link
Author

@reflectronic reflectronic Sep 20, 2023

Choose a reason for hiding this comment

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

I have been using the .NET 8 SDK, which imports SourceLink automatically. You're right, though, that the package is needed for earlier SDKs, and the GitHub Actions images probably won't have .NET 8 for a while.

All EmbedUntrackedSources does here is embed AssemblyInfo.g.cs (and probably some other equally meaningless files), I can probably remove it...

Choose a reason for hiding this comment

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

That's pretty cool! I wasn't sure if .NET 8 SDK pulled the GitHub Source Link but that does seem to be the case. EmbedUntrackedSources is probably okay here.

the GitHub Actions images probably won't have .NET 8 for a while

I think we can just specify the .NET 8 SDK in the GitHub Actions (8.0.x should pull the RC1 version).

</PropertyGroup>
<ItemGroup>
<None Include="App.config" Pack="true" PackagePath="contentFiles\FNA.dll.config" />
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="nuget\FNA.props" Pack="true" PackagePath="buildTransitive\FNA.props" />
<None Include="nuget\FNA.png" Pack="true" PackagePath="\"/>
<None Include="nuget\NuGetLicense.txt" Pack="true" PackagePath="\LICENSE.txt"/>
</ItemGroup>
<PropertyGroup>
<FNASettingsPropsFilePath>$(SolutionDir)FNA.Settings.props</FNASettingsPropsFilePath>
</PropertyGroup>
Expand Down Expand Up @@ -367,4 +390,21 @@
<LogicalName>Microsoft.Xna.Framework.Graphics.Effect.Resources.YUVToRGBAEffect.fxb</LogicalName>
</EmbeddedResource>
</ItemGroup>
<Target Name="DownloadExpandAndPackFNALibs" BeforeTargets="DispatchToInnerBuilds" Condition="'$(PackFNALibs)' == true">
<PropertyGroup>
<FNALibsRoot>$(BaseIntermediateOutputPath)fnalibs\</FNALibsRoot>
</PropertyGroup>
<DownloadFile SourceUrl="https://fna.flibitijibibo.com/archive/fnalibs.tar.bz2" DestinationFolder="$(BaseIntermediateOutputPath)">
<Output TaskParameter="DownloadedFile" PropertyName="FNALibsArchive" />
</DownloadFile>
<MakeDir Directories="$(FNALibsRoot)" />
<Exec Command="bsdtar -xjf $(FNALibsArchive) -C $(FNALibsRoot)" />
<ItemGroup>
<None Include="$(FNALibsRoot)x64\*.*" Pack="true" PackagePath="runtimes\win-x64\native" />
<None Include="$(FNALibsRoot)x86\*.*" Pack="true" PackagePath="runtimes\win-x86\native" />
<None Include="$(FNALibsRoot)osx\*.*" Pack="true" PackagePath="runtimes\osx-x64\native" />
<None Include="$(FNALibsRoot)lib64\*.*" Pack="true" PackagePath="runtimes\linux-x64\native" />
<None Include="$(FNALibsRoot)libaarch64\*.*" Pack="true" PackagePath="runtimes\linux-arm64\native" />
</ItemGroup>
</Target>
</Project>
26 changes: 13 additions & 13 deletions README → README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
This is FNA, an XNA4 reimplementation that focuses solely on developing a fully
accurate XNA4 runtime for the desktop.

Project Website: https://fna-xna.github.io/

License
-------
FNA is released under the Microsoft Public License. See LICENSE for details.

FNA uses LzxDecoder.cs, released under a dual MSPL/LGPL license.
See lzxdecoder.LICENSE for details.

FNA uses code from the Mono.Xna project, released under the MIT license.
See monoxna.LICENSE for details.
Project Website: <https://fna-xna.github.io/>

Documentation
-------------
Documentation for FNA can be found on the FNA wiki:

https://github.com/FNA-XNA/FNA/wiki
<https://github.com/FNA-XNA/FNA/wiki>

Found an issue?
---------------
Issues and patches can be reported via GitHub:

https://github.com/FNA-XNA/FNA/issues
<https://github.com/FNA-XNA/FNA/issues>

License
-------
FNA is released under the Microsoft Public License. See LICENSE for details.

FNA uses LzxDecoder.cs, released under a dual MSPL/LGPL license.
See lzxdecoder.LICENSE for details.

FNA uses code from the Mono.Xna project, released under the MIT license.
See monoxna.LICENSE for details.
Binary file added nuget/FNA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions nuget/FNA.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\contentFiles\FNA.dll.config" Condition="'$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe'">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
<TargetPath>%(Filename)%(Extension)</TargetPath>
</None>
</ItemGroup>
</Project>
7 changes: 7 additions & 0 deletions nuget/NuGetLicense.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FNA is released under the Microsoft Public License.

FNA uses LzxDecoder.cs, released under a dual MSPL/LGPL license.

FNA uses code from the Mono.Xna project, released under the MIT license.

Full license information can be found at https://fna-xna.github.io/license/.