2020-06-13 02:38:58 +03:00
|
|
|
# Gradle
|
|
|
|
# Build your Java project and run tests with Gradle using a Gradle wrapper script.
|
|
|
|
# Add steps that analyze code, save build artifacts, deploy, and more:
|
|
|
|
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
|
2020-11-25 19:45:02 +03:00
|
|
|
trigger:
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- master
|
2020-06-19 22:37:30 +03:00
|
|
|
|
2020-11-25 19:45:02 +03:00
|
|
|
pr:
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- master
|
|
|
|
|
2020-06-02 22:05:48 +03:00
|
|
|
pool:
|
2020-06-13 02:38:58 +03:00
|
|
|
vmImage: 'macOS-10.14'
|
2020-06-02 22:05:48 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- task: Gradle@2
|
|
|
|
displayName: 'gradlew build'
|
|
|
|
|
|
|
|
- bash: |
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Install AVD files
|
|
|
|
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-27;google_apis;x86'
|
|
|
|
|
|
|
|
# Create emulator
|
|
|
|
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n xamarin_android_emulator -k 'system-images;android-27;google_apis;x86' --force
|
|
|
|
|
|
|
|
$ANDROID_HOME/emulator/emulator -list-avds
|
|
|
|
|
|
|
|
echo "Starting emulator"
|
|
|
|
|
|
|
|
# Start emulator in background
|
|
|
|
nohup $ANDROID_HOME/emulator/emulator -avd xamarin_android_emulator -no-snapshot > /dev/null 2>&1 &
|
|
|
|
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'
|
|
|
|
|
|
|
|
$ANDROID_HOME/platform-tools/adb devices
|
|
|
|
|
|
|
|
echo "Emulator started"
|
|
|
|
displayName: 'Starting emulator'
|
|
|
|
|
|
|
|
- task: Gradle@2
|
|
|
|
displayName: 'gradlew -Pcoverage jacocoCoverageReport'
|
|
|
|
inputs:
|
|
|
|
tasks: '-Pcoverage jacocoCoverageReport'
|
|
|
|
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: 'Publish Artifact: drop'
|
|
|
|
inputs:
|
2020-06-13 02:38:58 +03:00
|
|
|
PathtoPublish: 'sdk/build/outputs/aar/'
|
2020-06-02 22:05:48 +03:00
|
|
|
|
|
|
|
- task: PublishCodeCoverageResults@1
|
2020-06-13 02:38:58 +03:00
|
|
|
displayName: 'Publish code coverage from $(System.DefaultWorkingDirectory)/sdk/build/reports/jacoco/jacocoCoverageReport/jacocoCoverageReport.xml'
|
|
|
|
inputs:
|
|
|
|
summaryFileLocation: '$(System.DefaultWorkingDirectory)/sdk/build/reports/jacoco/jacocoCoverageReport/jacocoCoverageReport.xml'
|
|
|
|
reportDirectory: '$(System.DefaultWorkingDirectory)/sdk/build/reports/jacoco/jacocoCoverageReport/html'
|
|
|
|
|
|
|
|
- task: Gradle@2
|
|
|
|
displayName: 'gradlew lint'
|
2020-06-02 22:05:48 +03:00
|
|
|
inputs:
|
2020-06-13 02:38:58 +03:00
|
|
|
tasks: lint
|
2020-06-30 19:48:17 +03:00
|
|
|
publishJUnitResults: false
|
|
|
|
|
|
|
|
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
|
|
|
displayName: 'Component Detection'
|
|
|
|
inputs:
|
|
|
|
verbosity: Normal
|
2020-11-24 21:13:04 +03:00
|
|
|
failOnAlert: true
|