@@ -18,25 +18,29 @@ extension HookConfigCodeConfig on HookConfig {
1818 /// Code asset specific configuration.
1919 CodeConfig get code => CodeConfig ._fromJson (json, path);
2020
21+ /// Whether the hook invoker (e.g. the Dart or Flutter SDK) expects this
22+ /// hook to build code assets.
2123 bool get buildCodeAssets => buildAssetTypes.contains (CodeAssetType .type);
2224}
2325
2426/// Extension to the [LinkInput] providing access to configuration specific to
2527/// code assets as well as code asset inputs to the linker (only available if
2628/// code assets are supported).
2729extension LinkInputCodeAssets on LinkInputAssets {
28- // Returns the code assets that were sent to this linker .
29- //
30- // NOTE: If the linker implementation depends on the contents of the files the
31- // code assets refer (e.g. looks at static archives and links them) then the
32- // linker script has to add those files as dependencies via
33- // [LinkOutput.addDependency ] to ensure the linker script will be re-run if
34- // the content of the files changes.
30+ /// The [CodeAsset] s in this [LinkInputAssets.encodedAssets] .
31+ ///
32+ /// NOTE: If the linker implementation depends on the contents of the files
33+ /// the code assets refer (e.g. looks at static archives and links them) then
34+ /// the linker script has to add those files as dependencies via
35+ /// [HookOutputBuilder.addDependencies ] to ensure the linker script will be
36+ /// re-run if the content of the files changes.
3537 Iterable <CodeAsset > get code =>
3638 encodedAssets.where ((e) => e.isCodeAsset).map (CodeAsset .fromEncoded);
3739}
3840
3941/// The configuration for [CodeAsset] s in [HookConfig] .
42+ ///
43+ /// Available via [HookConfigCodeConfig.code] .
4044final class CodeConfig {
4145 final CodeConfigSyntax _syntax;
4246
@@ -53,6 +57,7 @@ final class CodeConfig {
5357 Architecture get targetArchitecture =>
5458 ArchitectureSyntaxExtension .fromSyntax (_syntax.targetArchitecture);
5559
60+ /// The preferred link for [CodeAsset] s.
5661 LinkModePreference get linkModePreference =>
5762 LinkModePreferenceSyntaxExtension .fromSyntax (_syntax.linkModePreference);
5863
@@ -101,6 +106,7 @@ final class IOSCodeConfig {
101106 /// The lowest iOS version that the compiled code will be compatible with.
102107 int get targetVersion => _syntax.targetVersion;
103108
109+ /// Constructs a new [IOSCodeConfig] .
104110 IOSCodeConfig ({required IOSSdk targetSdk, required int targetVersion})
105111 : _syntax = IOSCodeConfigSyntax (
106112 targetSdk: targetSdk.type,
@@ -119,6 +125,7 @@ final class AndroidCodeConfig {
119125 /// compatible with.
120126 int get targetNdkApi => _syntax.targetNdkApi;
121127
128+ /// Constructs a new [AndroidCodeConfig] .
122129 AndroidCodeConfig ({required int targetNdkApi})
123130 : _syntax = AndroidCodeConfigSyntax (targetNdkApi: targetNdkApi);
124131}
@@ -133,6 +140,7 @@ final class MacOSCodeConfig {
133140 /// The lowest MacOS version that the compiled code will be compatible with.
134141 int get targetVersion => _syntax.targetVersion;
135142
143+ /// Constructs a new [MacOSCodeConfig] .
136144 MacOSCodeConfig ({required int targetVersion})
137145 : _syntax = MacOSCodeConfigSyntax (targetVersion: targetVersion);
138146}
@@ -145,6 +153,7 @@ extension BuildOutputAssetsBuilderCode on BuildOutputAssetsBuilder {
145153
146154/// Extension on [BuildOutputBuilder] to add [CodeAsset] s.
147155final class BuildOutputCodeAssetBuilder {
156+ /// Provides access to emitting code assets.
148157 final BuildOutputAssetsBuilder _output;
149158
150159 BuildOutputCodeAssetBuilder ._(this ._output);
@@ -185,6 +194,8 @@ final class LinkOutputCodeAssetBuilder {
185194
186195/// Extension to initialize code specific configuration on link/build inputs.
187196extension CodeAssetBuildInputBuilder on HookConfigBuilder {
197+ /// Sets up the code asset specific configuration for a build or link hook
198+ /// input.
188199 void setupCode ({
189200 required Architecture targetArchitecture,
190201 required OS targetOS,
@@ -229,19 +240,30 @@ extension LinkOutputCodeAssets on LinkOutputAssets {
229240 .toList ();
230241}
231242
243+ /// Extension methods for [MacOSCodeConfig] to convert to and from the syntax
244+ /// model.
232245extension MacOSCodeConfigSyntaxExtension on MacOSCodeConfig {
246+ /// Converts this [MacOSCodeConfig] to its corresponding
247+ /// [MacOSCodeConfigSyntax] .
233248 MacOSCodeConfigSyntax toSyntax () =>
234249 MacOSCodeConfigSyntax (targetVersion: targetVersion);
235250}
236251
252+ /// Extension methods for [IOSCodeConfig] to convert to and from the syntax
253+ /// model.
237254extension IOSCodeConfigSyntaxExtension on IOSCodeConfig {
255+ /// Converts this [IOSCodeConfig] to its corresponding [IOSCodeConfigSyntax] .
238256 IOSCodeConfigSyntax toSyntax () => IOSCodeConfigSyntax (
239257 targetSdk: targetSdk.type,
240258 targetVersion: targetVersion,
241259 );
242260}
243261
262+ /// Extension methods for [AndroidCodeConfig] to convert to and from the syntax
263+ /// model.
244264extension AndroidCodeConfigSyntaxExtension on AndroidCodeConfig {
265+ /// Converts this [AndroidCodeConfig] to its corresponding
266+ /// [AndroidCodeConfigSyntax] .
245267 AndroidCodeConfigSyntax toSyntax () =>
246268 AndroidCodeConfigSyntax (targetNdkApi: targetNdkApi);
247269}
0 commit comments