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 Reference Assembly Packages. #8274

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

dellis1972
Copy link
Contributor

@dellis1972 dellis1972 commented Apr 11, 2024

When building Library projects or Content Pipeline it would be better if we referenced a reference
assembly version of the MonoGame.Framework.dll.

We used to have a Portable library which was generated before the upgrade to .net 6.

This commit adds two new Packages

MonoGame.Framework.ReferenceAssembly
MonoGame.Framework.Content.Pipeline.ReferenceAssembly

These are generated using the ProduceReferenceAssembly on the DesktopGL and Content.Pipeline projects.

The main reason for adding these packages is to avoid confusion. Having a new user use the DesktopGL package for a library project made them think they needed to separate project or config for the WindowsDX package. Having reference assemblies for both the framework and Content extensions makes it more obvious that these references will not be used.

Also enabled the Android build on Linux as that is now supported by dotnet.

When building Library projects or Content Pipeline
it would be better if we referenced a reference
assembly version of the MonoGame.Framework.dll.

We used to have a Portable library which was generated
before the upgrade to .net 6.

This commit adds two new Packages

MonoGame.Framework.Ref
MonoGame.Framework.Content.Pipeline.Ref

These contain generated reference assemblies from
the `jetbrains.refasmer.clitool` [1]. This tool processes
an assembly, stripping out everything but the API and
adding a `ReferenceAssembly` attribute.

[1] https://github.com/JetBrains/Refasmer/
@@ -19,7 +19,7 @@ public BuildContext(ICakeContext context) : base(context)
{
var repositoryUrl = context.Argument("build-repository", DefaultRepositoryUrl);
var buildConfiguration = context.Argument("build-configuration", "Release");
BuildOutput = context.Argument("build-output", "artifacts");
BuildOutput = context.Argument("build-output", "Artifacts");
Copy link
Member

Choose a reason for hiding this comment

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

Let the artifacts folder be called with a starting small letter was intentional on my part, I wanted to slowly resort the repo into:

  • artifacts
  • build
  • src
  • tests

etc. instead of our current setup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to change this because it was inconsistent across the repo. I'll have to update all the references to use lowercase if that is the intention, Not sure how this worked with mixed case on Linux in the first place.

Copy link
Member

Choose a reason for hiding this comment

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

Oh yea, I forgot we use the artifacts folder for the build output as well.

I guess I'll try to fix it up tomorrow in a separate PR.

@harry-cpp
Copy link
Member

We used to have a Portable library which was generated before the upgrade to .net 6.

We dropped it as DesktopGL was able to serve as a reference assembly, so didn't see a reason to keep a dedicated package for it.

Also can't you just use ProduceReferenceAssembly / ProducyOnlyReferenceAssembly to generate it instead of the jetbrains tool? (I haven't used these compiler flags before, just know that they exist).

@dellis1972
Copy link
Contributor Author

oops, I commited some code which got the android build working on linux also doh

@dellis1972 dellis1972 marked this pull request as ready for review April 24, 2024 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants