xamarin-macios/msbuild
Emanuel Fernandez Dell'Oca c391c6dbdd [xcode11][publishing] Added conditional behavior to CreateIpa and its dependencies (#6753)
* [publishing] Added conditional behavior to CreateIpa and its dependencies

The targets execution needs to change based on the 'IsAppDistribution' property value, which will be set from the IDE.
According to the value of this property, some dependencies should be run or should be skipped.
The strategy adopted is to use the BeforeTargets value because doing this way we will force the conditionals over '$(IsAppDistribution)' to be evaluated each time a target is attempted to be run.
The most intuitive way of doing it is by directly add DependsOnTargets and conditions on the PropertyGroup items, but doing this will not work because the IDE usually runs the targets when the MSBuild project is already loaded, which means that the properties have already been evaluated so they will not be evaluated again, which causes conditional values to be out of date.
The only way of making it work in these cases is by forcing the conditional evaluations of each target execution attempt, and that is accomplished by adding the conditions directly on the Target 'Condition' property.

* [publishing] Simplified targets by using DependsOn + conditions in existent targets

- Using BeforeTargets on `_BeforeCreateIpaForDistribution` made that target run even if `CreateIpa` was skipped because its condition was false, which is wrong. Instead of including that condition into `_BeforeCreateIpaForDistribution` it seems more reasonable to move it to the `CreateIpa` DependsOnTargets property group to avoid maintaining the same condition on both targets in future changes that could lead to errors.
- Removed `_BeforeCreateIpaForBuild` since it was an unnecessary extensibility point and made the `CreateIpa` dependencies more complicated.
- We still need `_BeforeCreateIpaForDistribution` and `_BeforeCreateIpaForDistributionDependsOn` as extensibility point for the publishing workflow on VS.
- Simplified the previous approach by removing unnecessary targets and dependencies when the only thing needed was just the following condition on existent targets: `'$(IsAppDistribution)' != 'true'`. For instance, removed `_BeforeCodeSignForBuild` and included the mentioned condition into `_CreateAppBundle`. The purpose of `_BeforeCodeSignForBuild` was just skipping `_CreateAppBundle` for distribution builds, but it made the targets more complicated to understand and maintain.
- Same thing applies to `_BeforeCollectFrameworksForBuild` and `_BeforeCodesignNativeLibrariesForBuildDependsOn` which were just skipping the `_CompileToNative` target for distribution builds.
2019-08-16 11:00:20 +02:00
..
Xamarin.Mac.Tasks [vsts-938452] Clean up file names and indentations 2019-08-07 16:09:58 -04:00
Xamarin.Mac.Tasks.Core [vsts-938452] Clean up file names and indentations 2019-08-07 16:09:58 -04:00
Xamarin.MacDev.Tasks [msbuild] Update xbuild assembly references to msbuild ones 2018-05-22 13:26:55 -04:00
Xamarin.MacDev.Tasks.Core [vsts-938452] Add ALToolTaskBase.cs to Xamarin.MacDev.Tasks.Core.csproj 2019-08-07 16:10:32 -04:00
Xamarin.ObjcBinding.Tasks [msbuild] Remove support for XI/Classic. (#976) 2016-10-13 10:47:46 +02:00
Xamarin.Shared [d16-2] Bump VSMac to 8.1.0.2742 to fix msbuild issues (#6279) (#6361) 2019-06-19 17:28:01 +02:00
Xamarin.iOS.Tasks [vsts-938452] Clean up file names and indentations 2019-08-07 16:09:58 -04:00
Xamarin.iOS.Tasks.Core [xcode11][publishing] Added conditional behavior to CreateIpa and its dependencies (#6753) 2019-08-16 11:00:20 +02:00
tests [xcode11] Fix several issues to make the mtouch tests pass. Fixes #6259. (#6332) 2019-06-19 07:20:02 +02:00
.editorconfig Provide .editorconfig support for easier contributor formatting 2016-06-13 00:43:37 -03:00
.gitignore [builds] Improve mono/llvm dependencies. (#1948) 2017-03-31 20:23:38 +02:00
Makefile [xm][msbuild] Fix full profile FrameworkList file (#5674) 2019-02-27 12:38:38 -05:00
Xamarin.MacDev.Tasks.sln [msbuild] Added support for building CoreML models (#2714) 2017-11-28 11:16:44 -05:00