{"id":44961,"date":"2019-08-14T10:30:51","date_gmt":"2019-08-14T17:30:51","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/xamarin\/?p=44961"},"modified":"2019-08-30T08:27:14","modified_gmt":"2019-08-30T15:27:14","slug":"boots-xamarin-ci","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/xamarin\/boots-xamarin-ci\/","title":{"rendered":"Introducing Boots: Streamline Xamarin Continuous Integration"},"content":{"rendered":"<p>Many Xamarin developers take advantage of <a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/devops\/\">Azure DevOps<\/a> or <a href=\"https:\/\/appcenter.ms\">Visual Studio App Center<\/a> to build and release their mobile applications. Each environment has its own installation of Mono, Xamarin, and everything you would need to build your Xamarin project.<\/p>\n<p>However, each offering has some drawbacks:<\/p>\n<ul>\n<li>Azure DevOps currently has a single, fixed installation of Mono and Xamarin.<\/li>\n<li>App Center has a dropdown for selecting a specific version of Xamarin, but not always the latest release.<\/li>\n<\/ul>\n<p>In both cases, developers will have to wait for updates to make it Azure DevOps or App Center. The latest Xamarin builds don&#8217;t currently arrive the same day as they are on the Visual Studio release channels, and there is not a way to install <em>preview<\/em> builds of Xamarin.<\/p>\n<h3>Introducing Boots<\/h3>\n<p><img decoding=\"async\" src=\"http:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2019\/08\/Boots-icon.png\" alt=\"Boots Icon PNG for blog\" width=\"150\" height=\"150\" class=\"alignright size-full wp-image-45090\" \/>Internally we use a tool that can install specific builds of Mono, Xamarin, etc. on CI systems. It has been extremely valuable to pin builds to a specific version of Mono, Xamarin.Android, and Xamarin.iOS. We wanted\u00a0<em>all\u00a0<\/em>Xamarin developers to be able to do this, and so <a href=\"https:\/\/github.com\/jonathanpeppers\/boots\">Boots<\/a> was born.<\/p>\n<p><a href=\"https:\/\/github.com\/jonathanpeppers\/boots\">Boots<\/a> is a <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/core\/tools\/global-tools\">.NET Global Tool<\/a> for installing .vsix or .pkg files. To use it:<\/p>\n<pre class=\"lang:default decode:true \">dotnet tool install --global boots\r\nboots https:\/\/url\/to\/your\/package<\/pre>\n<p><a href=\"https:\/\/github.com\/jonathanpeppers\/boots\">Boots<\/a> currently supports Windows &amp; Mac OSX, therefore:<\/p>\n<ul>\n<li>On Windows &#8211; assumes the file is a\u00a0<code>.vsix<\/code>\u00a0and installs it into all instances of Visual Studio via\u00a0<code>VSIXInstaller.exe<\/code>.<\/li>\n<li>On Mac OSX &#8211; assumes the file is a\u00a0<code>.pkg<\/code>\u00a0and installs it<\/li>\n<\/ul>\n<p>So for example, to install Mono, Xamarin.Android, and Xamarin.iOS on Mac OSX:<\/p>\n<pre class=\"lang:default decode:true \">boots https:\/\/download.mono-project.com\/archive\/6.0.0\/macos-10-universal\/MonoFramework-MDK-6.0.0.313.macos10.xamarin.universal.pkg\r\nboots https:\/\/aka.ms\/xamarin-android-commercial-d16-2-macos\r\nboots https:\/\/bosstoragemirror.blob.core.windows.net\/wrench\/jenkins\/xcode10.3\/72cb587a39c12dfaa20cd5a0b1eb60a908ff88a6\/1\/package\/xamarin.ios-12.14.0.113.pkg<\/pre>\n<p>Or install Xamarin.Android on Windows:<\/p>\n<pre class=\"lang:default decode:true \">boots https:\/\/aka.ms\/xamarin-android-commercial-d16-2-windows<\/pre>\n<p>Unfortunately, finding URLs for each of these builds is in a different place for each product.<\/p>\n<p>URLs sourced from:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.mono-project.com\/download\/stable\/#download-mac\" rel=\"nofollow\">Mono Downloads<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/xamarin\/xamarin-android\">Xamarin.Android README<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/xamarin\/xamarin-macios\/commits\/d16-2\">Xamarin.iOS Github Status<\/a><\/li>\n<\/ul>\n<h3>Azure DevOps<\/h3>\n<p>On Azure DevOps, simply add this YAML to your existing build definition:<\/p>\n<pre class=\"lang:yaml decode:true \">variables:\r\n  DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true\r\nsteps:\r\n- script: |\r\n    dotnet tool install --global boots\r\n    boots https:\/\/aka.ms\/xamarin-android-commercial-d16-2-windows<\/pre>\n<p><code>DOTNET_SKIP_FIRST_TIME_EXPERIENCE<\/code>\u00a0is optional, but will speed up the first\u00a0<code>dotnet<\/code>\u00a0command.<\/p>\n<p>To make things even simpler, we&#8217;ve published a <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=pjcollins.azp-utilities-boots\" rel=\"nofollow\">Boots Extension from the VS Marketplace<\/a>. This makes it easy to use from the build definition UI as well as from YAML:<\/p>\n<pre class=\"lang:yaml decode:true \">steps:\r\n- task: Boots@1\r\n  displayName: Install Xamarin.Android\r\n  inputs:\r\n    uri: https:\/\/aka.ms\/xamarin-android-commercial-d16-2-windows<\/pre>\n<h3>App Center<\/h3>\n<p>App Center currently has an option to run a script during different points in your app&#8217;s build process. For example, placing a <code>appcenter-post-clone.sh<\/code> in the same directory as your project can install a newer Mono and Xamarin.Android than currently available:<\/p>\n<pre class=\"lang:sh decode:true\">#!\/usr\/bin\/env bash\r\n# App Center custom build scripts: https:\/\/aka.ms\/docs\/build\/custom\/scripts\r\n\r\nexport DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true\r\n\r\ndotnet tool install --global boots\r\n\r\n# Workaround instead of restarting shell\r\n# see: https:\/\/github.com\/dotnet\/cli\/issues\/9114#issuecomment-494226139\r\nexport PATH=\"$PATH:~\/.dotnet\/tools\"\r\nexport DOTNET_ROOT=\"$(dirname \"$(readlink \"$(command -v dotnet)\")\")\"\r\n\r\nboots https:\/\/download.mono-project.com\/archive\/6.0.0\/macos-10-universal\/MonoFramework-MDK-6.0.0.313.macos10.xamarin.universal.pkg\r\nboots https:\/\/aka.ms\/xamarin-android-commercial-d16-2-macos<\/pre>\n<p>See the\u00a0<a href=\"https:\/\/aka.ms\/docs\/build\/custom\/scripts\" rel=\"nofollow\">App Center docs<\/a>\u00a0for further detail about custom build scripts.<\/p>\n<h3>Boots with Cake<\/h3>\n<p>You can use\u00a0<code>Boots<\/code>\u00a0from a\u00a0<a href=\"https:\/\/cakebuild.net\/\" rel=\"nofollow\">Cake<\/a> script:<\/p>\n<pre class=\"lang:c# decode:true\">#addin nuget:?package=Cake.Boots\r\n\r\nTask(\"Boots\")\r\n    .Does(async () =&gt;\r\n    {\r\n        var platform = IsRunningOnWindows() ? \"windows\" : \"macos\";\r\n        await Boots ($\"https:\/\/aka.ms\/xamarin-android-commercial-d16-2-{platform}\");\r\n    });<\/pre>\n<p>This will be helpful if you are already using Cake, and it gives you the flexibility to write custom build logic in C#!<\/p>\n<h3>Other CI Systems<\/h3>\n<p><a href=\"https:\/\/github.com\/jonathanpeppers\/boots\">Boots<\/a> has been tested, and appears to work fine on:<\/p>\n<ul>\n<li><a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/devops\/\" rel=\"nofollow\">Azure DevOps<\/a><\/li>\n<li><a href=\"https:\/\/appcenter.ms\/\" rel=\"nofollow\">App Center<\/a><\/li>\n<li><a href=\"https:\/\/www.appveyor.com\/\" rel=\"nofollow\">AppVeyor<\/a><\/li>\n<li><a href=\"https:\/\/www.bitrise.io\/\" rel=\"nofollow\">Bitrise<\/a><\/li>\n<li><a href=\"https:\/\/travis-ci.org\/\" rel=\"nofollow\">Travis CI<\/a><\/li>\n<\/ul>\n<p>Any build environment that can be configured to run .NET Core 2.1, can run <a href=\"https:\/\/github.com\/jonathanpeppers\/boots\">Boots<\/a> . If you have success on other CI systems, let us know!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introducing Boots: a .NET Global Tool for installing .vsix or .pkg files and specific builds of Mono, Xamarin, etc. on CI systems. <\/p>\n","protected":false},"author":1345,"featured_media":45090,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[313,2,291],"tags":[5,5108,1219,27],"class_list":["post-44961","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","category-developers","category-xamarin-platform","tag-android","tag-build","tag-continuous-integration","tag-xamarin"],"acf":[],"blog_post_summary":"<p>Introducing Boots: a .NET Global Tool for installing .vsix or .pkg files and specific builds of Mono, Xamarin, etc. on CI systems. <\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/44961","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/users\/1345"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/comments?post=44961"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/44961\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media\/45090"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media?parent=44961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/categories?post=44961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/tags?post=44961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}