Skip to content

Surbhidhingra/cake-xamarin-sample

 
 

Repository files navigation

Cake Xamarin sample

A simple example of using Cake to build Xamarin.Android and Xamarin.iOS projects. Plus, the script runs xUnit tests, and StyleCop.

What the script does:

  1. Clean the solution and artifacts folder.
  2. Restore NuGet packages and Xamarin Components.
  3. Build Android project.
  4. Build iOS project.
  5. Run StyleCop.
  6. Run xUnit tests.
  7. Write the xUnit tests result and StyleCop output to the artifacts folder.

What's part of the solution:

  • Cake.Xamarin.Sample.Shared => A Portable Class Library (PCL) with shared code between Xamarin.Android and Xamarin.iOS.
  • Cake.Xamarin.Sample.Tests => A PCL with tests over shared code PCL.
  • Cake.Xamarin.Sample.Android => A Android project that uses the shared code PCL.
  • Cake.Xamarin.Sample.iOS => A iOS project that uses the shared code PCL.

Requirements

  1. xbuild (Linux and OS X) or msbuild (Windows) installed.
  2. .NET Core, .NET 4.5 or Mono installed.
  3. Terminal or Powershell.

How to run it

  1. Clone the repo and open terminal inside it.
  2. Run ./build.sh in OS X or .\build.ps1 on Windows.
  3. Get the outputs on the artifacts folder.

Aditional notes

  • To use a specific Xamarin account to restore Xamarin Components: ./build.sh -ScriptArgs -xamarin_username="youremail@example.com" -xamarin_password="password".
  • To run a specific Task like build only android or ios: ./build.sh -t Build-Android or ./build.sh -t Build-iOS.

About

A simple example of using Cake to build Xamarin.Android and Xamarin.iOS projects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 57.6%
  • PowerShell 28.6%
  • Shell 13.8%