5

How do I send parameters to a custom command in Xamarin.iOS?

I want to run a custom command on Xamarin in Before Build and I want to send a parameter. The parameter can be set on plist or another place inside the project.

Any tips on how to do this?

Jason
  • 86,222
  • 15
  • 131
  • 146
Daniel Benedykt
  • 6,496
  • 12
  • 51
  • 73

1 Answers1

0

I know this is an old question, but since it never was answered and got a few upvotes, I thought I'd take a stab.

Here is an example from another SO question/answer about setting build date in BeforeBuild with a custom task in the csproj file:

<PropertyGroup>
    <AttribCommand>chmod a+w $(MSBuildProjectDirectory)/BuildMetadata.cs</AttribCommand>
</PropertyGroup>
<UsingTask AssemblyFile="$(BuildExtensionsPath)\Foo.Framework.BuildExtensions.dll" TaskName="Foo.Framework.BuildExtensions.BuildDateTask" />
<Target Name="BeforeBuild">
    <Exec Command="$(AttribCommand)" />
    <BuildDateTask FilePath="$(MSBuildProjectDirectory)\BuildMetadata.cs" />
</Target>

Apologies if I misunderstood what was intended by "custom build command".

Community
  • 1
  • 1
Mark Larter
  • 2,343
  • 1
  • 27
  • 34