Latest Flutter tasks for Azure DevOps.
Initially a fork maintained by me of the awesome work done by original author Github. As per people's request, this is now a separate repo as this is now an advanced/latest extension with more features.
NOTE : I will no longer maintain my fork instead this repository will be updated, as this has developed into a lot more than the original extension.
PRs are always welcome. Feel free to create an issue if you face any problem.
Don't forget to star this repo, thanks π
Installation can be done using Visual Studio MarketPlace. Add the tasks to your build definition.
Installs the Flutter SDK onto the running agent if not already installed. Then uses it for following tasks.
Release Url Mode
: auto
(default), custom
. If custom
is specified, a Custom (Flutter SDK Install Url)
must be set.channel
: stable
(default), beta
, or dev
.version
of the SDK to install: latest
(default), custom
. If custom
is specified, a customVersion
must be set.customVersion
(in a <M>.<m>.<p>
semver format) if needed.Custom (Flutter SDK Install Url)
to release install url like https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_2.2.1-stable.zip
or any other available on (https://flutter.dev/docs/development/tools/sdk/releases?tab=windows).customArch
(example 'arm64') if needed.Build the given mobile application project. You must call the Flutter Install
task or use the optional flutterDirectory
task input that points to your flutter/bin
folder before execution. All application bundles are created in the build/outputs
folder of your project.
projectDirectory
that contains the pubspec.yaml
file.target
platform. Options are: apk
(default), aab
, ios
, ipa
, web
, all mobile
(all mobile platforms only), desktop (windows)
, desktop (macos)
, desktop (linux)
, all desktop
(all desktop platforms only) , all
(all platforms).flutterDirectory
to set path to the Flutter SDK if you were not using Flutter Install
task before this onebuildName
(like 1.2.3
) that will override the manifest's one.buildNumber
(like 12
) that will override the manifest's one. Use $(Build.BuildNumber)
to use build number as auto incremental number.buildFlavour
(like development
) to specify a build flavour. Must match Android Gradle flavor definition or XCode scheme.entryPoint
to override the main entry point file of the application. Default is 'lib/main.dart'.verboseMode
if you wish to get detailed verbose log output for diagnoses purposes. Default is false
.debugMode
if you wish to override the default release mode for the build. Default is false
. This flag cannot be combined with profileMode=true
.profileMode
if you wish to add the --profile
flag to the build. Default is false
. This flag cannot be combined with debugMode=true
.dartDefine
compile-time variables, use as : foo=bar
(use 'dartDefineMulti' for multiple args)"dartDefineMulti
compile-time variables, use as (space separated) : foo=bar key1=val1 key2=val2
(use for multiple --dart-define arguments)"dartDefineMultiArgSeparator
Separator used in params passed to dartDefineMulti
. Default is single space (' ')extraArgs
if you want to pass more official/custom command arguments, Space Separated
. Example: "--no-tree-shake-icons --publish-to-play"extraArgsSeparator
Separator used in params passed to extraArgs
. Default is single space (' ')apkTargetPlatform
for the Android platform architecture target: default
(default set by Flutter sdk) android-arm
, android-arm64
, android-x86
, android-x64
, custom
.customApkTargetPosition
for the custom
target platform architecture, provide your own combination (comma separated) of valid values. Example like android-arm,android-arm64,android-x64
splitPerAbi
to compile the code into an APK per target ABI. Otherwise the build will result in a single APK.iosTargetPlatform
for the iOS target: device
(default), simulator
.iosCodesign
to configure whenever the bundle odesign the application bundle (only available on device builds, and activated by default). Warning: you must install a valid certificate before build with the Install an Apple Certificate
taskexportOptionsPlist
to the path of your ExportOptions.plist
to configure --export-options-plist
. This flag cannot be combined with '--split-debug-info'. Optionally export an IPA with these options. See 'xcodebuild -h' for available exportOptionsPlist keys.NOTE : for
--release
builds, passdebugMode=false
andprofileMode=false
Launch tests and publish a report as build test results.
projectDirectory
that contains to pubspec.yaml
file.testName
as a regular expression matching substrings of the names of tests to run.testPlainName
as a plain-text substring of the names of tests to run.updateGoldens
: whether matchesGoldenFile()
calls within your test methods should update the golden files rather than test for an existing match.generateCodeCoverageReport
to generate code coverage report based on tests in the project. The report file is located in the specified projectDirectory
in coverage/lcov.info
.concurrency
to specify the number of concurrent test processes to run. Default is 6
.extraArgs
if you want to pass more official/custom command arguments, Comma Separated
. Example: "--no-sound-null-safety,--dart-define=Launch analyze on flutter directory.
projectDirectory
that contains the pubspec.yaml
file.pubGet
if you wish to run pub get
command before analyze. Default is true
.extraArgs
if you want to pass more official/custom command arguments. Example: "--fatal-infos --fatal-warnings"extraArgsSeparator
Separator used in params passed to extraArgs
. Default is single space (' ')Launch a Flutter command with custom arguments.
arguments
to your custom valid flutter command.projectDirectory
that contains the pubspec.yaml
file.flutterDirectory
to set path to the Flutter SDK if you were not using Flutter Install
task before this oneargSeparator
Separator used in params passed to extraArgs
. Default is single space (' ')Task to create the environment variables FlutterToolPath
, FlutterPubCachePath
and DartToolPath
.
Flutter path from
either to Custom Path
or File Path
.Custom Path
to give a path string like "$(Agent.ToolsDirectory)/<yourPath>/flutter
"File Path
to set path to the Flutter SDKNOTE : Do not give path to 'bin' folder
Environment variables created by the Install
or Env
tasks are :
$(FlutterToolPath)
- can be used as "$(FlutterToolPath)/flutter packages get
"$(FlutterPubCachePath)
can be used as "$(FlutterPubCachePath)/pubver set $(Version)
"$(DartToolPath)
- can be used as "$(DartToolPath)/dart prog.dart arg1
"First, please read the WIKI and then FAQs before opening any new issues.
Flutter command isn't recognized ?
Make sure that you have a Flutter Install
at the beginning of your definition.
Can I run a custom Flutter command ?
Yes, right after the Flutter Install
task, a FlutterToolPath
environment variable points to the bin
of the Flutter SDK directory. You just have to use $(FlutterToolPath)
in your following tasks. Example: "$(FlutterToolPath)/flutter packages get
"
Can I run Dart program ?
Yes, right after the Flutter Install
task, a DartToolPath
environment variable points to the bin
of the Dart SDK directory. You just have to use $(DartToolPath)
in your following tasks. Example: "$(DartToolPath)/dart program.dart arg1 arg2
"
Can I access Flutter's pub-cache ?
Yes, right after the Flutter Install
task, a FlutterPubCachePath
environment variable points to the pub-cache
directory that Flutter installs all depdencies. You just have to use $(FlutterPubCachePath)
in your following tasks. Example: "$(FlutterPubCachePath)/pubver set $(Version)
"
Facing error - "No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi" ?
Read this issue #16 for solution or this stackoverflow
How to run "Integeration Tests" ?
Read this wiki for steps, thanks to @maksymgendin for the help.
IOS build fail "Provisional Profile Errors" ?
Read this #35 for help
Any IOS or Android Examples (Setup Guide/YAML config)
Read this issue #37 and this wiki setup
iOS build fails with: "Xcode couldn't find any iOS App Development provisioning profiles matching..."
Read this issue #49
Disclaimer : These are 3rd Party YAML config, please use them on your own discretion
First, please read the WIKI and then FAQs before opening any new issues. Help me by reporting bugs, creating PRs, submit new ideas for features or anything else that you want to share.
Check out my other useful Flutter packages on pub.dev or more DevOps extensions on marketplace
Source code can be found on Github.
Previous fork : Github
Original repo : Github.