ReleasePackerDartBuildCli class
A dart build cli command: required when a dependency has build hooks
(native assets), as dart compile exe does NOT support them.
It builds a bundle at <output>/bundle/:
bin/<name> (<name>.exe on Windows)
lib/<dynamic libraries>
The executable loads the dynamic libraries from ../lib/, relative to
itself, so the release must keep the bin/ and lib/ layout.
With launcher, a script at the bundle root (<name>, or <name>.cmd on
Windows) runs bin/<name>, keeping the path of a release that used to
have the executable at its root.
- Inheritance
-
- Object
- ReleasePackerEntry
- ReleasePackerCommand
- ReleasePackerCommandWithArgs
- ReleasePackerDartCommand
- ReleasePackerDartBuild
- ReleasePackerDartBuildCli
Constructors
-
ReleasePackerDartBuildCli(String target, {String? output, List<
String> ? args, bool launcher = false}) -
The
outputmust be relative to the root directory: the bundle is mapped from it. Theargscan't set the target or the output: usetargetandoutput.factory - ReleasePackerDartBuildCli.fromJson(Object? json)
-
Creates a command from a
dart_build_cliJSON value: the target (String) or aMapwithtarget, and the optionaloutput,argsandlauncher.factory
Properties
-
args
→ List<
String> -
finalinherited
- bundlePath → String
-
The path of the built bundle:
<output>/bundle.no setter - command → String
-
finalinherited
- executablePath → String
-
The path of the built executable:
<output>/bundle/bin/<name>.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- launcher → bool
-
If
truegenerates a launcher script at the bundle root.final - launcherPath → String
-
The path of the launcher script:
<output>/bundle/<name>.no setter - launcherScript → String
-
The launcher script content.
no setter
- name → String
-
The executable name: the target file name without extension.
no setter
- output → String
-
The output directory, where the
bundle/is built.final -
platforms
↔ List<
RegExp> -
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- subcommand → String
-
The
dart buildsubcommand, likecli.finalinherited - target → String
-
The main Dart script, like
bin/foo.dart.final - targetsWindows → bool
-
Returns
trueif building for Windows: the--target-osargument, or the current platform.no setter
Methods
-
execute(
ReleasePacker releasePacker, Directory rootDirectory, {ReleaseBundle? releaseBundle, int expectedExitCode = 0}) → bool -
override
-
executeStatus(
ReleasePacker releasePacker, Directory rootDirectory, {ReleaseBundle? releaseBundle}) → FutureOr< ReleasePackerCommandStatus> -
Executes this command returning its ReleasePackerCommandStatus.
inherited
-
matchesPlatform(
String? platform) → bool -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
writeLauncher(
Directory rootDirectory) → File - Writes the launcher script at the bundle root.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
defaultOutput(
String target) → String -
The default output of a
target:build/cli/<name>. -
firstOf(
Iterable< ReleasePackerCommand> ? commands) → ReleasePackerDartBuildCli? -
The first ReleasePackerDartBuildCli in
commands, ornull. -
nameOf(
String target) → String -
The executable name of a
target: its file name without extension. -
normalizeOutput(
String output) → String -
Normalizes an
outputpath (./build/out->build/out).