[msbuild] Just use the 'AppBundleDir' variable to find the app bundle in the CreateInstallerPackage task. Fixes #14751. (#14800)

The output directory might or might not be where the app bundle is: by default
it is, but if someone sets the PkgPackageDir variable to provide an alternate
directory for the pkg, then that won't be where we'll find the app bundle.

The good news is that we already have a property that tells us where the app
bundle is (the 'AppBundleDir' property), so just use that instead.

Also:

* Make sure that the output directory exists before we try to write to it.
* Only pass full paths to productbuild, which for some reason doesn't seem to
  like relative paths.

Fixes https://github.com/xamarin/xamarin-macios/issues/14751.
This commit is contained in:
Rolf Bjarne Kvinge 2022-04-22 07:59:27 +02:00 коммит произвёл GitHub
Родитель 7c754bd755
Коммит 2cffa7c74e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -95,7 +95,7 @@ namespace Xamarin.MacDev.Tasks
}
args.Add ("--component");
args.AddQuoted (Path.Combine (OutputDirectory, Path.GetFileName (AppBundleDir)));
args.AddQuoted (Path.GetFullPath (AppBundleDir));
args.Add ("/Applications");
if (EnablePackageSigning) {
@ -117,8 +117,11 @@ namespace Xamarin.MacDev.Tasks
string target = string.Format ("{0}{1}.pkg", Name, String.IsNullOrEmpty (projectVersion) ? "" : "-" + projectVersion);
PkgPackagePath = Path.Combine (OutputDirectory, target);
}
PkgPackagePath = Path.GetFullPath (PkgPackagePath);
args.AddQuoted (PkgPackagePath);
Directory.CreateDirectory (Path.GetDirectoryName (PkgPackagePath));
return args.ToString ();
}