Open TimLariviere opened 4 years ago
Same for my project, looks like paket does not properly processes content inside the build folder of nuget package. Ios project does not build for now
What even is xcode10? Do we have similar?
@forki ,it is xamarin forms magic. If we look inside xamarin.forms 4.5 nuget package,we find xcode 11 and xcode10 folder inside 'build' folder. Files there are very important to build an ios app. Honestly,i do not know,why xamarin team took such decision.
вс, 19 апр. 2020 г., 16:43 Steffen Forkmann notifications@github.com:
What even is xcode10? Do we have similar?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/fsprojects/Paket/issues/3816#issuecomment-616138003, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEKNDOW6BQLARMVY63HCIIDRNL5Y3ANCNFSM4LUHCVSQ .
I noticed that an assembly named Xamarin.Forms.Platform.iOS
(containing iOS-specific code - same with macOS) which was previously under lib\Xamarin.iOS10
has been removed and replaced by 2 other ones under build\XCode10
and build\XCode11
.
I'm guessing the Xamarin.Forms team had to provide dlls specifically compatible with the XCode version you have installed on your mac.
Like @vshapenko, some of my iOS projects managed by Paket failed to build once updated by Paket.
They were missing links to Xamarin.Forms.props
and Xamarin.Forms.targets
, for some reasons.
Those files are at the root of the build
directory.
Once I added the links manually, the projects built correctly.
The targets
file automatically chooses the appropriate XCode10/11 dll, so I don't think it really concerns Paket.
Can you please describe the workaround in detail? Thx
Timothé Larivière notifications@github.com schrieb am So., 19. Apr. 2020, 16:02:
I noticed that an assembly named Xamarin.Forms.Platform.iOS (containing iOS-specific code - same with macOS) which was previously under lib\Xamarin.iOS10 has been removed and replaced by 2 other ones under build\XCode10 and build\XCode11.
I'm guessing the Xamarin.Forms team had to provide dlls specifically compatible with the XCode version you have installed on your mac.
Like @vshapenko https://github.com/vshapenko, some of my iOS projects managed by Paket failed to build once updated by Paket. They were missing links to Xamarin.Forms.props and Xamarin.Forms.targets, for some reasons. Those files are at the root of the build directory. Once I added the links manually, the projects built correctly.
The targets file automatically chooses the appropriate XCode10/11 dll, so I don't think it really concerns Paket.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fsprojects/Paket/issues/3816#issuecomment-616142031, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOANF6H77CS4IS3K6IEFDRNL76ZANCNFSM4LUHCVSQ .
@forki , does paket process .props and .targets files from 'build' folder?
Workaround of the build issue once upgrading to Xamarin.Forms 4.5.0.396 or newer:
After running paket install
, Paket should have removed the reference to Xamarin.Forms.Platform.iOS.dll
inside the iOS fsproj file.
To be able to continue building your iOS (or macOS) project, you'll need to do the following:
<Project>
start tag
<Import Project="..\packages\Xamarin.Forms\build\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms\build\Xamarin.Forms.props')" />
</Project>
end tag
<Import Project="..\packages\Xamarin.Forms\build\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms\build\Xamarin.Forms.targets')" />
For reference, see this commit: https://github.com/TimLariviere/FabulousPlanets/commit/e5e8b6e39f9343896d91fc427decd9b0d94a61e1#diff-b5787cbb1a1fa09cbd9f445d240677dc
Ok, after some deep dive into paket sources, i think i can identify the problem: InstallModel.fs, part there we parse build folder. According to nuspec : https://docs.microsoft.com/ru-ru/nuget/create-packages/creating-a-package#include-msbuild-props-and-targets-in-a-package props and targets files from build folder should be included in project. However, paket just scans subfolders for dll with proper tfm, and it works not in 100% cases, as we can see.
Please try with 6.0.0-alpha025
@forki I'm still having the issue with the following paket.dependencies
.
version 6.0.0-alpha025
framework xamarinios
source https://www.nuget.org/api/v2
nuget Xamarin.Forms ~> 4.5.0
timothelariviere@Timothes-MacBook-Pro FabulousPlanets % mono .paket/paket.exe install
Paket version 6.0.0-alpha025
Resolving packages for group Main:
- Xamarin.Forms 4.5.0.657+219-sha.3d0108ce6-azdo.3648568
Locked version resolution written to /Users/timothelariviere/Git/GitHub/FabulousPlanets/paket.lock
Installing into projects:
- Creating model and downloading packages.
Could not detect any platforms from 'XCODE10' in '/Users/timothelariviere/Git/GitHub/FabulousPlanets/packages/Xamarin.Forms/build/XCODE10/Xamarin.Forms.Platform.iOS.dll', please tell the package authors
Could not detect any platforms from 'XCODE11' in '/Users/timothelariviere/Git/GitHub/FabulousPlanets/packages/Xamarin.Forms/build/XCODE11/Xamarin.Forms.Platform.iOS.dll', please tell the package authors
- Installing for projects
- FabulousPlanets.Android/paket.references -> FabulousPlanets.Android/FabulousPlanets.Android.fsproj
- FabulousPlanets.iOS/paket.references -> FabulousPlanets.iOS/FabulousPlanets.iOS.fsproj
- FabulousPlanets/paket.references -> FabulousPlanets/FabulousPlanets.fsproj
F# project /Users/timothelariviere/Git/GitHub/FabulousPlanets/FabulousPlanets/FabulousPlanets.fsproj does not reference FSharp.Core.
Performance:
- Resolver: 4 seconds (1 runs)
- Runtime: 115 milliseconds
- Blocked (retrieving package details): 504 milliseconds (1 times)
- Blocked (retrieving package versions): 3 seconds (1 times)
- Disk IO: 671 milliseconds
- Average Request Time: 1 second
- Number of Requests: 3
- Runtime: 5 seconds
Paket omitted 10 warnings similar to the ones above. You can see them in verbose mode.
can you please upload a zip with a small sample?
I created it with the default Xamarin iOS template and added Xamarin.Forms 4.5.0 via paket install
(magic mode).
If you remove paket.lock
and run paket install
(mono paket.exe install
on macOS), you'll see the warnings and also #3831 (the Xamarin.Forms.targets/props is not imported in the csproj by Paket).
Ok. to clearify the problem little bit: According to nuget spec here, build folder is suited for storing build and props targets for different tfms(or global ones):
Files in the root \build folder are considered suitable for all target frameworks. To provide framework-specific files, first place them within appropriate subfolders, such as the following: \build \netstandard1.4 \Contoso.Utility.UsefulStuff.props \Contoso.Utility.UsefulStuff.targets \net462 \Contoso.Utility.UsefulStuff.props \Contoso.Utility.UsefulStuff.targets
So, the proper algorithm would be following:
Sorry for being some rude, but i have problems with clean and proper description of issues.
ok I pushed another fix. It's no longer complaining.
But which props and targets file from the sample should it import exactly?
@forki I confirm that the warnings disappeared with 6.0.0-alpha027.
For the props/targets, Xamarin.Forms requires to import both build\Xamarin.Forms.props
and build\Xamarin.Forms.targets
(inside Xamarin.Forms NuGet package) in order to compile.
It's these files that import the dlls from the XCODE10/XCODE11 folders.
Note that build\Xamarin.Forms.DefaultItems.props
is imported by build\Xamarin.Forms.props
, same with targets.
So I guess a props/targets file inside the build
folder with the same name as the package is meant to be imported by default?
@forki , if we look into the srtucture of directory build, we will see the following:
We need to put
MSBuild .props and .targets files for cross-framework targeting can be placed in the \buildMultiTargeting folder. During package installation, NuGet adds the corresponding <Import> elements to the project file with the condition, that the target framework is not set (the MSBuild property $(TargetFramework) must be empty).
P.S.S https://docs.microsoft.com/en-us/nuget/create-packages/creating-a-package#from-a-convention-based-working-directory is more detailed and full information about possible folder names and their behaviour.
Description
Starting v4.5.0, Xamarin.Forms added 2 new folders in their NuGet packages, under the folder
build
, namedXCODE10
andXCODE11
.When installing this package with Paket, the following warnings appear:
Repro steps
Add a reference to
Xamarin.Forms 4.5.0.495
Run
paket install
Warnings about
XCODE10
andXCODE11
should appear (see example above)Expected behavior
I'm not exactly sure what these warnings mean, but I would expect no warning at all.
Actual behavior
Warnings are appearing.
Known workarounds
No workaround known.