Flutter build task for Azure DevOps.
All credit goes to the original author for his awesome work. This extension is a custom/updated/maintained fork of Alois Deniel's extension Github
Installation can be done using Visual Studio MarketPlace.
Source code can be found on Github.
Original repo : Github.
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.
- Select the
channel:stable(default),beta, ordev. - Select the
versionof the SDK to install:latest(default),custom. Ifcustomis specified, acustomVersionmust be set. - (Optional). Set the
customVersion(in a<M>.<m>.<p>semver format) 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.
- Select the
projectDirectorythat contains thepubspec.yamlfile. - Select the
targetplatform. Options are:apk(default),aab,ios,web,all mobile(all mobile platforms only),desktop (windows),desktop (macos),desktop (linux),all desktop(all desktop platforms only) ,all(all platforms). - (Optional). Set
flutterDirectoryto set path to the Flutter SDK if you were not usingFlutter Installtask before this one - (Optional). Set
buildName(like1.2.3) that will override the manifest's one. - (Optional). Set
buildNumber(like12) that will override the manifest's one. - (Optional). Set
buildFlavour(likedevelopment) to specify a build flavour. Must match Android Gradle flavor definition or XCode scheme. - (Optional). Set
entryPointto override the main entry point file of the application. Default is 'lib/main.dart'. - (Optional). Set
verboseModeif you wish to get detailed verbose log output for diagnoses purposes. Default isfalse. - (Optional). Set
debugModeif you wish to override the default release mode for the build. Default isfalse. - (Optional). Set
dartDefinecompile-time variables. Example: "Some_Var=Some_val --dart-define=Some_Var2=Val" - (Optional). Set
extraArgsif you want to pass more official/custom command arguments. Example: "--no-tree-shake-icons --publish-to-play" - (Android).(Optional). Set
apkTargetPlatformfor the Android platform architecture target:android-arm(default),android-arm64. - (Android).(Optional). Set the build mode
splitPerAbito compile the code into an APK per target ABI. Otherwise the build will result in a single APK. - (iOS).(Optional). Set
iosTargetPlatformfor the iOS target:device(default),simulator. - (iOS).(Optional). Set
iosCodesignto 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 theInstall an Apple Certificatetask
Launch tests and publish a report as build test results.
- Select the
projectDirectorythat contains topubspec.yamlfile. - (Optional). Set
testNameas a regular expression matching substrings of the names of tests to run. - (Optional). Set
testPlainNameas a plain-text substring of the names of tests to run. - (Optional). Set
updateGoldens: whethermatchesGoldenFile()calls within your test methods should update the golden files rather than test for an existing match. - (Optional). Set
generateCodeCoverageReportto generate code coverage report based on tests in the project. The report file is located in the specifiedprojectDirectoryincoverage/lcov.info. - (Optional). Set
concurrencyto specify the number of concurrent test processes to run. Default is6.
Launch analyze on flutter directory.
- Select the
projectDirectorythat contains thepubspec.yamlfile. - (Optional). Set
pubGetif you wish to runpub getcommand before analyze. Default istrue.
Launch a Flutter command with custom arguments.
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)"




