Граф коммитов

210 Коммитов

Автор SHA1 Сообщение Дата
Jeffrey Stedfast 25c687f14f
Remove SQLite.cs (not used anymore) (#126) 2024-08-09 13:31:47 -04:00
Jeffrey Stedfast 7be3e79de4
Update NUnit to 4.x (and the tests) (#125) 2024-08-09 12:48:27 -04:00
Jeffrey Stedfast bd3d13362b
Updated to use Xcode 16's new provisioning profiles directory (#124)
* Updated to use Xcode 16's new provisioning profiles directory

Starting with Xcode 16, the location of cached provisioning profiles
has moved from "~/Library/MobileDevice/Provisioning Profiles" to
"~/Library/Developer/Xcode/UserData/Provisioning Profiles"

Fixes https://github.com/xamarin/xamarin-macios/issues/20771

* Support loading profisioning profiles from both locations

* Fixed the unit tests

* Auto-format source code

---------

Co-authored-by: GitHub Actions Autoformatter <autoformat@example.com>
2024-08-09 12:24:26 -04:00
Emanuel Fernandez Dell'Oca 94c2c8c988 Stop targeting net472
As the Pair to Mac agents in VS are being migrated to target .NET 8, we no longer need to target .NET Framework 4.7.2.
2024-06-11 14:56:42 -04:00
Rolf Bjarne Kvinge 4cb9dc2632
[Xamarin.MacDev] Use Stream.ReadExactly instead of Stream.Read when we can. (#121)
Fixes these warnings:

    Xamarin.MacDev/PListObject.cs(1353,7): warning CA2022: Avoid inexact read with 'System.IO.Stream.Read(byte[], int, int)' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2022)
    Xamarin.MacDev/PListObject.cs(1357,7): warning CA2022: Avoid inexact read with 'System.IO.Stream.Read(byte[], int, int)' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2022)
    Xamarin.MacDev/PListObject.cs(1343,6): warning CA2022: Avoid inexact read with 'System.IO.Stream.Read(byte[], int, int)' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2022)
    Xamarin.MacDev/PListObject.cs(1421,6): warning CA2022: Avoid inexact read with 'System.IO.Stream.Read(byte[], int, int)' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2022)
2024-04-22 19:07:25 +02:00
Jeffrey Stedfast e707772e17
Use RandomNumberGenerator instead of System.Random (#120)
* Use RandomNumberGenerator instead of System.Random

Needed for an internal assessment task.

* Auto-format source code

---------

Co-authored-by: GitHub Actions Autoformatter <autoformat@example.com>
2024-04-09 11:29:02 -04:00
Manuel de la Pena d1ed5a2dbb
Merge pull request #117 from xamarin/fix-api-scan 2024-01-12 08:43:36 -05:00
Manuel de la Pena Saenz 07af9c6d26 [APIScan] Remove not needed API that APIScan does not like. 2024-01-11 21:22:15 -05:00
Rolf Bjarne Kvinge 3a8921860d
[Xamarin.MacDev] Fix computing DTSDKBuild. Fixes #xamarin/xamarin-macios@19733. (#116)
We were accidentally getting the ProductBuildVersion value (which is used for
DTSDKBuild) from the system, not from the SDK used during the build.

This happened because we were trying to Path.Combine two rooted paths - in
which case Path.Combine returns the second path, without combining anything.

The fix is to compute the path of the plist where the ProductBuildVersion
value is located correctly.

Fixing the Path.Combine issue also revealed that the first path passed to
Path.Combine was wrong, so that got fixed too.

And finally make sure we don't Path.Combine two rooted paths anywhere else -
in all other cases we're supposed to just use the second path without
prepending the first, so just remove the Path.Combine call completely in those
cases.

Fixes https://github.com/xamarin/xamarin-macios/issues/19733.
2024-01-03 19:28:33 +01:00
Rolf Bjarne Kvinge b454d454a6
[Xamarin.MacDev] Move compatibility nullability attributes to their own file. (#115) 2023-04-20 13:14:25 +02:00
Rolf Bjarne Kvinge bab25f535f
[Xamarin.MacDev] Add a few convenience overloads to IAppleSdk. (#114) 2023-04-18 15:09:00 +02:00
Jeffrey Stedfast 920e87e5f3
Update UnitTests.csproj
Updated UnitTests to also target net472
2023-04-03 11:37:18 -04:00
Jeffrey Stedfast ccc9bd4de8
Update Xamarin.MacDev.csproj
Target net472 instead of net461 (which is no longer supported)
2023-04-03 11:36:32 -04:00
Rolf Bjarne Kvinge 74c95ee1c3
[Xamarin.MacDev] Always fetch the DTSDKBuild variable. (#112)
Xcode adds this value to the Info.plist for all builds, so we should also get it
always so that our build can do the same as Xcode.
2023-02-10 13:35:19 +01:00
Rolf Bjarne Kvinge 14d53612d4
Enable nullability in PListObject.cs (#111) 2022-12-14 21:49:16 +01:00
Rolf Bjarne Kvinge ac2647b643
Fix build by always including the System.Diagnostics.CodeAnalysis namespace. (#110)
This way we find the NotNullWhen attribute declared at the bottom of this file.
2022-12-01 17:22:25 +01:00
Rolf Bjarne Kvinge 8f2b596951
Fix nullability issues in MacCatalystSupport (#109) 2022-12-01 14:21:33 +01:00
Rolf Bjarne Kvinge 33502e15ba
Add better diagnostics when failing to find provisioning profiles. (#108) 2022-11-08 18:33:54 +01:00
Rolf Bjarne Kvinge b0b5f8b540
Use Environment.SpecialFolder.UserProfile, not SpecialFolder.Personal. (#107)
Context: dotnet/runtime#68610
Context: https://github.com/xamarin/xamarin-android-tools/commit/0be567a9

In Mono and .NET prior to .NET 8, the
[`System.Environment.SpecialFolder`][0]`.Personal` enum value would refer to
`$HOME` on Unix platforms.

This will be changing in .NET 8, such that
`Environment.SpecialFolder.Personal` will instead refer to
`$XDG_DOCUMENTS_DIR` (if set) or `$HOME/Documents`.  This is for "semantic
compatibility" with .NET on Windows.

Replace usage of `Environment.SpecialFolder.Personal` with
`Environment.SpecialFolder.UserProfile`, so that our code continues to work as
expected under .NET 8.

[0]: https://docs.microsoft.com/en-us/dotnet/api/system.environment.specialfolder?view=net-6.0
2022-11-08 18:33:42 +01:00
Rolf Bjarne Kvinge f4d43c168b
Autoformat code (#106)
Co-authored-by: GitHub Actions Autoformatter <autoformat@example.com>
2022-11-03 22:05:14 +01:00
Rolf Bjarne Kvinge 5e7f841b6f
Add the autoformat actions to autoformat the code in this repo. (#105) 2022-11-03 21:53:19 +01:00
Juan Diego Herrera 7e8233fc97 Add Extended Version info to XamMac
Having an easy way to access the SDK's is convenient since this information is retrieved by the IDE.
2022-11-03 12:44:35 -07:00
James Parsons 627737bf83
Only build Xamarin.MacDev for net461 on Windows due to strongnamer issue (#103)
## Problem

There is an issue when building the project Xamarin.MacDev from XamarinVS in the IDE (as a submodule):
![image](https://user-images.githubusercontent.com/59936622/197078319-7e9af6c5-f65c-4c08-acd2-2acbccd95594.png)

This is a known issue with the strongnamer package:

[Add support for multiple frameworks at same time · Issue #58 · dsplaisted/strongnamer (github.com)](https://github.com/dsplaisted/strongnamer/issues/58)

## Solution

The solution as suggested by @rolfbjarne and @mauroa is to only build XamarinMacDev for net461 on Windows. It is still necessary to build for netstandard2.0 on Mac.

![image](https://user-images.githubusercontent.com/59936622/197078516-dc2c2f21-8b31-4d85-8e3a-0a16cc4608f2.png)
2022-10-21 08:29:05 +02:00
Rolf Bjarne Kvinge c2f4eb2587
Autoformat the code according to the editorconfig file. (#102)
This was done like this:

    dotnet format Xamarin.MacDev.sln
2022-10-06 16:48:40 +02:00
Rolf Bjarne Kvinge 3a74eeeae4
Add an .editorconfig file (#101)
This is the same .editorconfig we have in xamarin/xamarin-macios.
2022-10-06 13:51:53 +02:00
Kunyi Li 383151b3cb
Added new entitlements for Xcode14 (#100) 2022-08-30 15:12:51 -04:00
Stefani Moore 3eb4dcd4b4
Adding new extension methods to ManifestExtensions class (#99) 2022-08-12 12:51:26 -07:00
Jeffrey Stedfast b03589d046
Add PList accessors for NSAssetColorName and XSAssetColorAssets (#98) 2022-08-08 13:02:56 -04:00
Stefani Moore 3a1ba5d6b6 Adding support for MacCatalyst versions 2022-08-03 10:48:05 -04:00
Stefani Moore 177a071ca1 Adding MacCatalyst option to GetPlatformKey() 2022-08-02 16:28:30 -04:00
Stefani Moore 9cd39f129b
Add MacCatlystOptmizedForMac option to ToDeviceFamily() (#95) 2022-08-01 12:47:12 -07:00
Juan Marcelo Tondato 81075eb9b6 Ensure netstandard20 TF is first in the list of TFs in order to do not break xamarin extension build on VSMAC IDE 2022-07-05 11:12:16 -03:00
Jeffrey Stedfast a80614502c Added tests for long.MaxValue 2022-06-28 16:30:43 -04:00
Jeffrey Stedfast f4d88bc580
Fixed plist integer serialization/deserialization (#93)
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1563608
2022-06-28 16:09:50 -04:00
Rolf Bjarne Kvinge 0717ac3c24
Add a new device type for Mac Catalyst. (#92) 2022-04-05 21:00:55 +02:00
Mauro Agnoletti ed2a6046ca Remove net451 target framework from Xamarin.MacDev.csproj
VS projects are now compatible with .NET 4.6.1 so we don't need MacDev.csproj to target 4.5.1 anymore
2021-12-09 16:23:05 -05:00
Rolf Bjarne Kvinge 9e6e29f2a4
[Xamarin.MacDev] Return valid iOS/macOS versions when converting betweeen iOS and macOS versions for Mac Catalyst. (#90)
This allows us to construct better error messages.
2021-09-17 17:20:08 +02:00
emaf 41d91e0de0 Makes TryGetSystemXcode public for VSM
Partial fix for https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1287695

By making this method public we can use it from VSM to understand where the Xcode path is coming from and provide a better experience for the customers.
2021-03-03 20:43:31 -03:00
Rolf Bjarne Kvinge 1e738e9f7f
[Xamarin.MacDev] Extract the code to convert between Mac Catalyst versions to a separate file. (#89)
This way the code can be included as source in the mtouch/mmp/dotnet-linker projets in xamarin-macios.
2021-02-15 14:21:10 +01:00
Rolf Bjarne Kvinge a3bb12c542
[Xamarin.MacDev] Add methods to map between iOS and macOS versions for Mac Catalyst. (#88) 2021-02-11 16:30:38 +01:00
Rolf Bjarne Kvinge 02d6d05be3
[Xamarin.MacDev] Add an AppleSdkVersion struct which replaces IPhoneSdkVersion and MacOSXSdkVersion. (#87)
This reduces code duplication and makes it possible to simplify logic in a few places.
2021-02-11 16:00:28 +01:00
Rolf Bjarne Kvinge e7ec7ef510
[Xamarin.MacDev] Fail gracefully if trying to grab a PList entry from a file that doesn't exist. (#86)
We run into this code path on Mac Catalyst.
2021-02-11 08:30:02 +01:00
Rolf Bjarne Kvinge fae0237704
[Xamarin.MacDev] Add GetAppleDTSettings and GetSdkSettings to the IAppleSdk interface. (#85)
And make the MacOSXSdk and AppleSdk classes implement these new methods,
without changing any of the public API in these classes.

This makes it easier to share code between Xamarin.iOS and Xamarin.Mac, since
the IAppleSdk interface can be used in shared code, while the separate classes
can't.
2021-01-11 14:10:06 +01:00
Rolf Bjarne Kvinge f665e3a0fc
Use what's returned by 'xcode-select -p' as the configured Xcode if none is specified in Visual Studio's settings. (#84)
Use what's returned by 'xcode-select -p' as the configured Xcode if none is
specified in Visual Studio's settings. It looks like this was the intention in
the code, but the code that calls 'xcode-select -p' would never execute,
because we'd only run into it if GetConfiguredSdkLocation returned null/empty,
which it never did because it returned the default location
'/Applications/Xcode.app' if nothing was configured in VSfM. With this change,
GetConfiguredSdkLocation will try to get the system's Xcode location
('xcode-select -p') before returning /Applications/Xcode.app.

Also remove /Developer as a default location, Xcode hasn't been there in many,
many years.

Now the order is:

1. Settings in Visual Studio's Preferences.
2. System's Xcode (xcode-select --print-path).
3. /Applications/Xcode.app

This avoids strange problems if the system's Xcode is not
/Applications/Xcode.app and there's no Xcode configured in Visual Studio's
settings.

Ref: https://github.com/xamarin/xamarin-macios/issues/10003
2020-10-29 20:59:14 +01:00
Manuel de la Pena c490a36fe6
[Xcode12] Bring xcode 12 changes. 2020-09-24 09:43:45 -04:00
Manuel de la Pena ef85617bd2 Merge branch 'd16-8' into main-xcode12 2020-09-24 09:30:54 -04:00
Joaquin Jares fed032b789
Merge pull request #82 from xamarin/dev/joj/policheck
Updating comment for policheck
2020-09-23 14:35:26 -03:00
Joaquin Jares ffad12eef4
Updating comment for policheck
This is referenced on AB#1188585 and AB#1198008
2020-09-23 14:33:57 -03:00
Alex Soto e244776a5a
Merge pull request #81 from xamarin/xcode12
Merge Xcode12 into d16-8
2020-09-18 12:55:29 -04:00
emaf d20cfa6018 [xcode12] Adds Accent Color manifest keys
XSAccentColorAssets will be used as custom key for storing the path to the asset, and NSAccentColorName is the Apple key that contains the name of the asset that will be used as accent color by the OS
2020-08-31 10:41:19 -03:00