Set of Gradle plugins to build Xamarin mobile application (iOS/Android) and librairies from cli.
- xamarin-application-plugin : Build ios/android Application
- xamarin-library-plugin : Build/Package/Deploy Nuget Library
- xamarin-test-plugin : Build and run nunit test
This plugin provides the ability to build iOS and Android Xamarin Applications with gradle.
- buildIOS : build iOS application
- buildAndroid : build Android Application
plugins {
id "com.betomorrow.xamarin.application" version "0.2.0"
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.betomorrow.gradle:xamarin-application-plugin:0.2.0"
}
}
apply plugin: "com.betomorrow.xamarin.application"
This plugin provides the ability to build PCL Libraries and Nuget Packages
- build : build library with xbuild
- package : create nuget package
- install : install package locally
- deploy : deploy package on nuget server like (NugetServer, Sonatype Nexus, ...)
plugins {
id "com.betomorrow.xamarin.library" version "0.2.0"
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.betomorrow.gradle:xamarin-library-plugin:0.2.0"
}
}
apply plugin: "com.betomorrow.xamarin.library"
version = "1.0.0-SNAPSHOT"
publish {
remote {
url = "http://my/custom/repository"
apiKey = "myNugetApiKey"
}
}
nuspec {
description "Sample for nuspec package plugin"
packages {
"SampleLib" {
packageId = "Xam.SampleLib"
dependencies {
dependency "Xamarin.Forms:[1.4.3,)" // <Name>:<Version Restriction>
// [...]
}
assemblies {
target {
dest "lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10"
includes "SampleLib"
}
// [...]
}
}
}
}
deploy {
remote {
url = "http://fake.url" // remote repository url
apiKey = "12345789" // nuget apiKey
}
}
This plugin provides the ability to build and run NUnit test
- compileTest : build test with xbuild
- test : run nunit-console
plugins {
id "com.betomorrow.xamarin.nunit" version "0.2.0"
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.betomorrow.gradle:xamarin-nunit-plugin:0.2.0"
}
}
apply plugin: "com.betomorrow.xamarin.nunit"
nunit {
assemblies = "path/to/assemblies.Test.dll" // (optional) array or string, full path of test assemblies
projects = "CrossLib.Test" // (optional) By default, use "${project.name}.Test"
format = "nunit2" // Result test format
}
See following projects for more working samples