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:
|
2021-03-26 01:21:35 +03:00
|
|
|
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
|
2021-03-26 22:00:30 +03:00
|
|
|
trigger:
|
2021-04-05 22:59:01 +03:00
|
|
|
- master
|
2021-03-26 22:00:30 +03:00
|
|
|
|
|
|
|
pr:
|
2021-04-05 22:59:01 +03:00
|
|
|
- master
|
2021-03-26 22:00:30 +03:00
|
|
|
|
2020-06-02 22:05:48 +03:00
|
|
|
pool:
|
2022-07-26 01:55:18 +03:00
|
|
|
vmImage: 'macos-latest'
|
2020-06-02 22:05:48 +03:00
|
|
|
|
|
|
|
steps:
|
2022-07-22 23:19:26 +03:00
|
|
|
- task: Gradle@3
|
2022-07-22 22:20:40 +03:00
|
|
|
displayName: 'gradlew clean build'
|
2022-07-22 23:19:26 +03:00
|
|
|
inputs:
|
|
|
|
tasks: clean build
|
|
|
|
publishJUnitResults: false
|
|
|
|
jdkVersionOption: 1.11
|
|
|
|
gradleOptions: '-Xmx4608M'
|
2022-07-22 22:20:40 +03:00
|
|
|
|
2022-07-26 01:43:43 +03:00
|
|
|
- bash: |
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Install AVD files
|
|
|
|
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-28;google_apis;x86'
|
|
|
|
|
|
|
|
# Create emulator
|
2022-07-26 01:55:18 +03:00
|
|
|
echo "no" | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n xamarin_android_emulator -k 'system-images;android-28;google_apis;x86' --force
|
2022-07-26 01:43:43 +03:00
|
|
|
|
|
|
|
$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'
|
|
|
|
|
2022-07-22 23:42:37 +03:00
|
|
|
- task: Gradle@3
|
2020-06-02 22:05:48 +03:00
|
|
|
displayName: 'gradlew -Pcoverage jacocoCoverageReport'
|
|
|
|
inputs:
|
2022-07-26 02:04:52 +03:00
|
|
|
jdkVersionOption: 1.11
|
2020-06-02 22:05:48 +03:00
|
|
|
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'
|
|
|
|
|
2022-07-26 02:18:56 +03:00
|
|
|
- task: Gradle@3
|
2020-06-13 02:38:58 +03:00
|
|
|
displayName: 'gradlew lint'
|
2020-06-02 22:05:48 +03:00
|
|
|
inputs:
|
2022-07-26 02:18:56 +03:00
|
|
|
jdkVersionOption: 1.11
|
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
|