Skip to content

tafilz/xamarin-android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xamarin-android

Build Xamarin.Forms and Xamarin.Android projects in a docker container

For this docker image i used the following pages as references:

Included packages

Android SDK

Before using this container, you should agree with Android SDK License Agreement

Installed Android SDK Platform Tools (selected by tag):

  • API Level 26
  • API Level 27
  • API Level 28
  • API Level 29
  • API Level 30
  • API Level 31
  • API Level 32
  • API Level 33
  • Select tag <level>-ndkto include the ndk-bundle

.NET Core

Using dotnet-sdk-6.0 from https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb

Mono

Using preview-focal repo from mono-project.com

Xamarin Android OSS Linux

Using the latest artifact from here.

Paths

  • Xamarin: /xamarin/bin/Release/bin
  • Android SDK: /usr/lib/android-sdk
  • Android NDK: /usr/lib/android-sdk/ndk-bundle
  • Android CMD Tools: usr/lib/android-sdk/cmdline-tools/tools/bin

Example .gitlab.ci

stages:
  - build

build-android:
  image: tafilz/xamarin-android:29
  stage: build
  only:
    - master
  artifacts:
    paths:
      - publish_android/*.apk
    script:
      - export BUILD_DATE=$(date +%Y%m%d%H%M%S)
      - msbuild src/<solution_file_name>.sln /p:AndroidSdkDirectory=/usr/lib/android-sdk /p:Configuration="Release" /p:Platform="Any CPU" /restore
      - msbuild src/<android_project_directory>/<android_project_file_name>.csproj /p:AndroidSdkDirectory=/usr/lib/android-sdk /p:Configuration="Release" /p:Platform="Any CPU" /t:PackageForAndroid /p:OutputPath="../../publish_android/"
      - msbuild src/<android_project_directory>/<android_project_file_name>.csproj /p:AndroidSdkDirectory=/usr/lib/android-sdk /p:Configuration="Release" /p:Platform="Any CPU" /t:SignAndroidPackage /p:OutputPath="../../publish_android/"

About

Build xamarin-android projects in a docker container

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published