Skip to content

Add flutter_build package for codegen and version sync with tool#26978

Merged
jonahwilliams merged 12 commits intoflutter:masterfrom
jonahwilliams:flutter_build
Jan 26, 2019
Merged

Add flutter_build package for codegen and version sync with tool#26978
jonahwilliams merged 12 commits intoflutter:masterfrom
jonahwilliams:flutter_build

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Jan 23, 2019

Includes a single build which can produce an .app.dill and a modified .packages file using the frontend server. The configuration options mirror those available in the flutter_tool and can be configured with defines similar to blaze.

When a user takes a dev_dependency on flutter_build, they can run the following command to invoke this builder. (This is just a building block of codegen, not the final workflow)

exec flutter pub pub run build_runner build \
--define "flutter_build|kernel=disabled=false" \
--define "flutter_build|kernel=aot=false" \
--define "flutter_build|kernel=linkPlatformKernelIn=false" \
--define "flutter_build|kernel=trackWidgetCreation=false" \
--define "flutter_build|kernel=targetProductVm=false" \
--define "flutter_build|kernel=mainPath=/Users/user/Documents/testbed/lib/main.dart" \
--define "flutter_build|kernel=packagesPath=/Users/user/Documents/testbed/.packages" \
--define "flutter_build|kernel=sdkRoot=/Users/user/Documents/Flutter/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk" \
--define "flutter_build|kernel=frontendServerPath=/Users/user/Documents/Flutter/flutter/bin/cache/artifacts/engine/darwin-x64/frontend_server.dart.snapshot" \
--define "flutter_build|kernel=engineDartBinaryPath=/Users/user/Documents/Flutter/flutter/bin/cache/dart-sdk/bin/dart" \

Note: This package should not be synced internally.

@jonahwilliams jonahwilliams changed the title Add flutter_build package for codegen and version sync with tool [WIP] Add flutter_build package for codegen and version sync with tool Jan 23, 2019
@zoechi zoechi added the tool Affects the "flutter" command-line tool. See also t: labels. label Jan 23, 2019
@jonahwilliams
Copy link
Contributor Author

Apparently the update-packages went wrong

@jonahwilliams jonahwilliams changed the title [WIP] Add flutter_build package for codegen and version sync with tool Add flutter_build package for codegen and version sync with tool Jan 24, 2019
@jonahwilliams
Copy link
Contributor Author

cc @gspencergoog , do you recognize the issue that docs is having here?

@gspencergoog
Copy link
Contributor

No, I don't know what that is: it's not failing doing dartdoc though, that completed properly. It's failing doing the javadoc on the engine code.

@gspencergoog
Copy link
Contributor

Does it fail locally when you run ./dev/bots/docs.sh?

Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a bunch of nits.

await buildStep.writeAsBytes(outputId, await outputFile.readAsBytes());
await buildStep.writeAsBytes(packagesOutputId, await packagesFile.readAsBytes());
} catch (err, stackTrace) {
log.shout('frontend server failed to start: $err, $stackTrace');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is logging enough when this happens? What does shout do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shout leaves an error log in .dart_tool/build/generated/<>/<>/<> that can be read out later. I believe this also causes the build to complete with an error, will double-check

@tvolkert
Copy link
Contributor

Tests?

@jonahwilliams
Copy link
Contributor Author

Tests?

Will work on tests

@jonahwilliams
Copy link
Contributor Author

Re:offline discussion, to make sure we have reasonable coverage I will add an integration test that triggers code generation and then runs the resulting code

@jonahwilliams jonahwilliams merged commit 2e8f173 into flutter:master Jan 26, 2019
kangwang1988 pushed a commit to XianyuTech/flutter that referenced this pull request Feb 12, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants