Gradle Dart Plugin
Provides Gradle integration for Dart projects.
Forked from ngyewch/gradle-dart, which was forked from steineggerroland/gradle-dart
Example usage
plugins {
id 'com.github.rmtmckenzie.gradle-dart' version '1.1.0'
}
Available gradle tasks
- pubGet (resolves dependencies with pub get)
- pubUpgrade (upgrade project with latest versions of dependencies with pub upgrade)
- pubPublish (publishes the project with pub publish)
- webDevBuild (build project)
- webDevServe (start a development server for your webapp)
- analyzeDart (analyzes files in source folder)
- testDart (executes tests in test folder)
- executeWithDartVm (executes specified files)
Available settings
-
dartSdkHome / dartSdkBin
- Default: empty string or 'DART_SDK' environment variable
- Used for execution of dart commands. Set 'dartSdkHome' or 'dartSdkBin' if you don't have the dart sdk bin in your path variables.
-
commandLineParameters
- Default: empty list
- Additional parameters for command execution.
-
pubspecDirectory
- Default: Project directory (Location of build.gradle)
- Directory of 'pubspec.yaml' file.
-
sourceDirectory / relativeSourceDirectory
- Default:
$ProjectDirectory$ /lib/src (according to preferred project structure) - Needed for analyzing source files. The path can be set relative to the project directory.
- Default:
-
testDirectory / relativeTestDirectory
- Default:
$ProjectDirectory$ /test (according to preferred project structure) - Needed for executing tests. The path can be set relative to the project directory.
- Default:
-
buildOutputDirectory
- Default: build/dart
- Directory of build output
-
buildIgnore
- Default:
['build', '.idea']
- Paths to ignore for build-related tasks (makes build faster)
- Default:
Available task settings
In addition to these parameters, it is possible to configure each individual task. The settings for each task is in the corresponding named parameter for that task.
i.e.
dart {
pubspecDirectory "a/directory"
webDevBuild {
pubSpecDirectory "a/different/directory"
}
}
Certain tasks also have additional settings:
-
analyzeDart.analyzePackagesFolders
- Default: false
- Whether or not to analyze items in the packages folders
-
executeWithDartVm.files
- Default: []
- The files to execute
-
testDart.testPackagesFolders
- Default: false
- Wether or not to run test in the packages folders