-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[native_assets_cli] Separate out public API
- Loading branch information
Showing
48 changed files
with
1,078 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
pkgs/native_assets_cli/lib/native_assets_cli_internal.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
/// These files should not be accessed from `build.dart`. | ||
library native_assets_cli_internal; | ||
|
||
export 'src/model/asset.dart'; | ||
export 'src/model/build_config.dart'; | ||
export 'src/model/build_mode.dart'; | ||
export 'src/model/build_output.dart'; | ||
export 'src/model/dependencies.dart'; | ||
export 'src/model/ios_sdk.dart'; | ||
export 'src/model/link_mode.dart'; | ||
export 'src/model/link_mode_preference.dart'; | ||
export 'src/model/metadata.dart'; | ||
export 'src/model/target.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import '../model/asset.dart' as model; | ||
import '../model/link_mode.dart' as model; | ||
import '../model/target.dart' as model; | ||
import 'link_mode.dart'; | ||
import 'target.dart'; | ||
|
||
abstract class AssetPath {} | ||
|
||
/// Asset at absolute path [uri]. | ||
abstract class AssetAbsolutePath implements AssetPath { | ||
Uri get uri; | ||
|
||
factory AssetAbsolutePath(Uri uri) = model.AssetAbsolutePath; | ||
} | ||
|
||
/// Asset is avaliable on the system `PATH`. | ||
/// | ||
/// [uri] only contains a file name. | ||
abstract class AssetSystemPath implements AssetPath { | ||
Uri get uri; | ||
|
||
factory AssetSystemPath(Uri uri) = model.AssetSystemPath; | ||
} | ||
|
||
/// Asset is loaded in the process and symbols are available through | ||
/// `DynamicLibrary.process()`. | ||
abstract class AssetInProcess implements AssetPath { | ||
factory AssetInProcess() = model.AssetInProcess; | ||
} | ||
|
||
/// Asset is embedded in executable and symbols are available through | ||
/// `DynamicLibrary.executable()`. | ||
abstract class AssetInExecutable implements AssetPath { | ||
factory AssetInExecutable() = model.AssetInExecutable; | ||
} | ||
|
||
abstract class Asset { | ||
LinkMode get linkMode; | ||
String get id; | ||
Target get target; | ||
AssetPath get path; | ||
|
||
factory Asset({ | ||
required String id, | ||
required LinkMode linkMode, | ||
required Target target, | ||
required AssetPath path, | ||
}) => | ||
model.Asset( | ||
id: id, | ||
linkMode: linkMode as model.LinkMode, | ||
target: target as model.Target, | ||
path: path as model.AssetPath, | ||
); | ||
} |
Oops, something went wrong.