-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an end to end example of for building a DevTools extension #6299
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
80798ca
Add an end to end example of for building a DevTools extension
kenzieschmoll f4f218d
Merge branch 'master' of github.com:flutter/devtools into ext-e2e-exa…
kenzieschmoll 1f1b217
add cross reference in main readme
kenzieschmoll 570a53c
Address review comments
kenzieschmoll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Example DevTools Extension | ||
|
||
This is an end-to-end example of a DevTools extension, including | ||
- the extension Flutter web app that will be embedded in DevTools | ||
(`foo/packages/foo_devtools_extension`) | ||
- the parent package that provides the DevTools extension (`foo/packages/foo`) | ||
- the end-user application that depends on `package:foo` (`app_that_uses_foo`), | ||
which will trigger a load of the `pacakge:foo` DevTools extension when debugging | ||
kenzieschmoll marked this conversation as resolved.
Show resolved
Hide resolved
|
||
this app with DevTools. | ||
|
||
This example will show you how to: | ||
1. Structure your package for optimal extension development and publishing | ||
``` | ||
foo/ # formerly the repository root of your pub package | ||
packages/ | ||
foo/ # your pub package | ||
extension/ | ||
devtools/ | ||
build/ | ||
... # pre-compiled output of foo_devtools_extension | ||
config.yaml | ||
foo_devtools_extension/ # source code for your extension | ||
``` | ||
2. Configure your extension using the `foo/extension/devtools/config.yaml` file | ||
```yaml | ||
name: foo | ||
issue_tracker: <link_to_your_issue_tracker.com> | ||
version: 0.0.1 | ||
material_icon_code_point: '0xe0b1' | ||
``` | ||
3. Use `package:devtools_extensions` and `package:devtools_app_shared` to | ||
develop your DevTools extension (see source code under `foo_devtools_extension`). | ||
4. Ship your extension with your pub package by including the pre-built assets | ||
in the `foo/extension/devtools/build` directory. | ||
- For this example, the pre-built assets for `foo_devtools_extension` were added | ||
to `foo/extension/devtools/build` by running the following command from the | ||
`foo_devtools_extension/` directory: | ||
```sh | ||
flutter pub get && | ||
dart run devtools_extensions build_and_copy \ | ||
--source=. \ | ||
--dest=../foo/extension/devtools | ||
``` |
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
packages/devtools_extensions/example/app_that_uses_foo/README.md
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,4 @@ | ||
# app_that_uses_foo | ||
|
||
This is an example application that uses a package, `package:foo`, that includes a | ||
DevTools extension. |
34 changes: 34 additions & 0 deletions
34
packages/devtools_extensions/example/app_that_uses_foo/ios/.gitignore
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,34 @@ | ||
**/dgph | ||
*.mode1v3 | ||
*.mode2v3 | ||
*.moved-aside | ||
*.pbxuser | ||
*.perspectivev3 | ||
**/*sync/ | ||
.sconsign.dblite | ||
.tags* | ||
**/.vagrant/ | ||
**/DerivedData/ | ||
Icon? | ||
**/Pods/ | ||
**/.symlinks/ | ||
profile | ||
xcuserdata | ||
**/.generated/ | ||
Flutter/App.framework | ||
Flutter/Flutter.framework | ||
Flutter/Flutter.podspec | ||
Flutter/Generated.xcconfig | ||
Flutter/ephemeral/ | ||
Flutter/app.flx | ||
Flutter/app.zip | ||
Flutter/flutter_assets/ | ||
Flutter/flutter_export_environment.sh | ||
ServiceDefinitions.json | ||
Runner/GeneratedPluginRegistrant.* | ||
|
||
# Exceptions to above rules. | ||
!default.mode1v3 | ||
!default.mode2v3 | ||
!default.pbxuser | ||
!default.perspectivev3 |
26 changes: 26 additions & 0 deletions
26
packages/devtools_extensions/example/app_that_uses_foo/ios/Flutter/AppFrameworkInfo.plist
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,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleExecutable</key> | ||
<string>App</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>io.flutter.flutter.app</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>App</string> | ||
<key>CFBundlePackageType</key> | ||
<string>FMWK</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleVersion</key> | ||
<string>1.0</string> | ||
<key>MinimumOSVersion</key> | ||
<string>11.0</string> | ||
</dict> | ||
</plist> |
1 change: 1 addition & 0 deletions
1
packages/devtools_extensions/example/app_that_uses_foo/ios/Flutter/Debug.xcconfig
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 @@ | ||
#include "Generated.xcconfig" |
1 change: 1 addition & 0 deletions
1
packages/devtools_extensions/example/app_that_uses_foo/ios/Flutter/Release.xcconfig
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 @@ | ||
#include "Generated.xcconfig" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to cover the example with integration test to make sure it does not erose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will use this example app when I add the end to end integration test in devtools_app.