Skip to content

Restore and update nuspec file for OxyPlot.Xamarin.Forms #125

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

Merged
merged 9 commits into from
Dec 1, 2022

Conversation

janusw
Copy link
Member

@janusw janusw commented Nov 12, 2022

All nuspec files were removed in 8a3e9f2, but in particular the nuspec file for OxyPlot.Xamarin.Forms is necessary to build a proper nuget package AFAICS (in VS one can build a nupkg from a single project, but the code for OxyPlot.Xamarin.Forms is distributed over multiple projects).

I have restored the nuspec from the last existing version, and updated it a bit in an attempt to generate a package based on OxyPlot.Core version 2.0, which can also be used on all major platforms (Android, iOS, Mac, UWP).

I had to fix some of the file paths in the nuspec. I removed the dependency on the 'native' Xamarin packages, and instead added the corresponding files to the nuspec directly. And I also added the files for Mac, which were still missing.

@objorke
Copy link
Member

objorke commented Nov 13, 2022

Can the project be updated to Xamarin.Form 5.0? It currently depends on a version from 2018...

@objorke
Copy link
Member

objorke commented Nov 13, 2022

Can you also include the GitHub action to build these packages?

@janusw
Copy link
Member Author

janusw commented Nov 13, 2022

Can the project be updated to Xamarin.Form 5.0? It currently depends on a version from 2018...

Yes, a couple of dependencies need to be updated. I can look into this soon, but it would be good to have a working packaging process (and CI) first, which makes it easier to detect problems when updating.

@janusw
Copy link
Member Author

janusw commented Nov 13, 2022

Can you also include the GitHub action to build these packages?

I was playing a bit with AppVeyor, but couldn't really get it to work. Yes, will look into GHA.

@VisualMelon
Copy link

@janusw there are examples for the various CI providers in the core repo, e.g.

@janusw
Copy link
Member Author

janusw commented Nov 16, 2022

Can you also include the GitHub action to build these packages?

Done, see 89fb229. Unfortunately it does not seem to be triggered here (GHA is only run if the config is on the main branch AFAIK), but I have tested it in my fork, and you can see the results of the build there:
https://github.com/janusw/oxyplot-xamarin/actions/runs/3477628462
After some small fixes for the Mac projects, the build runs through fine. Only the packaging currently fails due to the version number (I'm using git describe to generate this):

Error NU5010: Version string specified for package reference 'v1.0.0-53-g9f48948' is invalid.

I think only the v in front in the problem (not compatible with SemVer2). I've seen similar version codes work well in other projects. Can be fixed by setting a new tag in the repo (e.g. something like 2.0.0-beta.1).

@janusw
Copy link
Member Author

janusw commented Nov 18, 2022

After some small fixes for the Mac projects, the build runs through fine. Only the packaging currently fails due to the version number (I'm using git describe to generate this):

I fixed this now by removing the git describe and putting a fixed version in the nuspec.

Further I removed the UWP parts from the nuspec, since it's not covered by the sln.

With these changes, the GHA build runs through successfully now, as you can see here (on my fork):
https://github.com/janusw/oxyplot-xamarin/actions/runs/3496330390
And it also spits out a nupkg as an artifact:
https://github.com/janusw/oxyplot-xamarin/suites/9380983287/artifacts/442160543

@janusw
Copy link
Member Author

janusw commented Nov 21, 2022

@objorke @VisualMelon Is the current state here ok to be merged to the main branch (so that the GHA builds will become active)? Or is there anything else you'd like to have fixed first?

I plan to add some functional fixes (in a separate PR) once the CI is up and running (e.g. a small fix for iOS, Android seems to be working well already).

@VisualMelon
Copy link

I'm not familiar with Xamarin, but nothing looks iffy to me (though the hint-paths look unfortunate). I have some hardware issues at the moment, but intending to catch up on some OxyPlot business this weekend when hopefully they'll be resolved, so happy to merge this then if there are no other objections.

Can I check whether you've tested this on Mac/Windows? (Looks like you're testing with Mac locally, and the CI is windows, so should be OK for the time being)

@janusw
Copy link
Member Author

janusw commented Nov 21, 2022

I'm not familiar with Xamarin, but nothing looks iffy to me (though the hint-paths look unfortunate).

Which hint paths do you mean? I think the only ones I'm touching are those for Xamarin.Mac (because it was not found in the Windows build). I copied that trick from another project (and verified via GHA that it works).

I have some hardware issues at the moment, but intending to catch up on some OxyPlot business this weekend when hopefully they'll be resolved, so happy to merge this then if there are no other objections.

Sounds awesome! Good luck with your HW ;)

Can I check whether you've tested this on Mac/Windows? (Looks like you're testing with Mac locally, and the CI is windows, so should be OK for the time being)

Yes, I have made sure that it builds on Mac (locally on my MacBook) and Windows (via GHA). I could even add a Mac-based build in GHA, but I don't actually think it's necessary (I managed to get the Mac parts building on Windows, but the UWP parts cannot be built on Mac).

I also did some runtime tests of the nupkg with Xamarin.Mac already, but (as on iOS) they were not fully successful yet. I don't think this is related to the packaging, though. I will open separate issues/PRs for these problems.

janusw and others added 7 commits November 24, 2022 23:27
* reference final OxyPlot.Core version 2.0.0
* fix paths
* add native Xamarin dlls
* add Mac files
* in OxyPlot.Xamarin.Mac, OxyPlot.Xamarin.Forms.Platform.MacOS, SimpleDemo.MacOS
* GHA showed this error:
  warning MSB3245: Could not resolve this reference. Could not locate the assembly "Xamarin.Mac". Check to make sure the assembly exists on disk.
* and set a fixed version string in the nuspec
* this should fix the error:
  Error NU5010: Version string specified for package reference 'v1.0.0-53-g9f48948' is invalid.
* so that it is build via GitHub Actions as well
* also: update the target platform version of the UWP project,
  so that I can build it locally on my dev machine
* the project.json has been removed automatically by VS
  (and the dependencies added to the csproj directly)
@janusw
Copy link
Member Author

janusw commented Nov 25, 2022

Ok, I made some further modifications here, in order to also build the UWP parts together with everything else via GHA (and to include UWP support in the nuspec as well, in addition to Android, iOS and Mac).

@janusw
Copy link
Member Author

janusw commented Nov 25, 2022

As before, the build logs and generated nupkg can be admired in my fork: https://github.com/janusw/oxyplot-xamarin/actions/runs/3546578398

@janusw
Copy link
Member Author

janusw commented Nov 29, 2022

By now I have also done some runtime tests of the generated nupkg on Windows and verified that it works flawlessly with a Xamarin.UWP application.

@janusw
Copy link
Member Author

janusw commented Nov 30, 2022

@objorke @VisualMelon If none of you is comfortable reviewing Xamarin stuff, I can offer to step up as a maintainer for this project and handle things on my own, if you are willing to give me the necessary permissions. I am (co-)maintaining 2-3 other Xamarin-related projects already, and I have quite some experience with packaging and CI (which is mainly what is needed here, I guess).

Some things that I would like to do as a follow-up once this PR is merged:

  • update some packages (Xamarin.Forms etc)
  • update the OxPlot version from 2.0 to 2.1
  • fix some problems (the only platform where I really have trouble is MacOS; Android, iOS and UWP work great)
  • eventually update to .NET 6/7 and MAUI at some point

However, I try to be careful no to break anything that has been working, and thus would like to have a working CI (with auto-generated packages) first, before going any further.

If you don't like this proposal and have no time for reviewing either, I can also just fork this project for my own purposes (which I'd like to avoid) or rather just move to another plotting lib (or even roll my own) and let this project die for good. What do you think? 🤷‍♂️

@janusw
Copy link
Member Author

janusw commented Nov 30, 2022

@objorke Since your thumb is up, could you add me to the oxyplot org and give me write permissions for the oxyplot-xamarin repo, please?

@objorke
Copy link
Member

objorke commented Nov 30, 2022

yes, just waiting for a thumbs up from @VisualMelon ! I think you should be part of the "developers" team, we don't need a team just for Xamarin.

@janusw
Copy link
Member Author

janusw commented Nov 30, 2022

yes, just waiting for a thumbs up from @VisualMelon !

Ok, sure.

I think you should be part of the "developers" team, we don't need a team just for Xamarin.

Sounds good. I think permissions for the different repositories can be set up independently anyway. It would be great if I could get write permissions for oxyplot-xamarin, but I certainly don't need (or want) that for the others.

@VisualMelon
Copy link

@objorke all OK by me!

@janusw sorry I didn't get back to you last weekend

@janusw
Copy link
Member Author

janusw commented Dec 1, 2022

@objorke all OK by me!

Thanks guys, you are awesome! 👍

@janusw sorry I didn't get back to you last weekend

Nevermind, hope you got your HW fixed 😉

@objorke
Copy link
Member

objorke commented Dec 1, 2022

@janusw, you are invited! We are looking forwards to see pipelines running and packages published again!

@janusw
Copy link
Member Author

janusw commented Dec 1, 2022

@janusw, you are invited!

Already accepted, thanks :)

We are looking forwards to see pipelines running and packages published again!

Will merge this PR soon, then set a beta-1 tag and move on with the other things mentioned above ...

@janusw janusw merged commit d747500 into oxyplot:develop Dec 1, 2022
@janusw janusw deleted the nuspec branch December 1, 2022 13:28
This was referenced Dec 2, 2022
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.

3 participants