Repository navigation
Use snapshot's .d file as source inputs in Gradle build. - #8756
Merged
Merged
Conversation
If we don't yet have a .d file (first build), fall back to using the .dart files in the current directory. This enables us to detect changes in dependent source files (Flutter framework, packages outside the source directory, etc.), and re-generate the snapshots as needed. Unfortunately, Gradle requires knowing the source files before executing the task, and can't update them after building, so Gradle considers the second build to be out-of-date (because it has more input files than the first build). Sub-sequent builds have the correct dependency information, and will be skipped if the source files haven't changed. Also added a dependency on gen_snapshot. The snapshot ABI isn't stable, so we need to re-generate the snapshots when we roll the Dart SDK dependency. Fixes flutter#8315 Fixes flutter#8687 Fixes flutter#8607
mravn-google
approved these changes
Mar 14, 2017
| dependenciesFile = project.file("${intermediateDir}/snapshot_blob.bin.d") | ||
| } | ||
| FileCollection sources = readDependencies(dependenciesFile) | ||
| if (sources != null) { |
Contributor
There was a problem hiding this comment.
Please add a comment describing the situations sources == null and sources !=null
| try { | ||
| // Dependencies file has Makefile syntax: | ||
| // <target> <files>: <source> <files> <separated> <by> <space> | ||
| String depText = dependenciesFile.text |
Contributor
There was a problem hiding this comment.
Can a dependency files have comments? Like lines of the form
# TODO(mravn): remove dependencies on bigwig
Contributor
Author
There was a problem hiding this comment.
It's technically in 'Makefile' format, which does allow comments. However, gen_snapshot only emits one line containing 'target: sources'.
Contributor
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
If we don't yet have a .d file (first build), fall back to using the
.dart files in the current directory. This enables us to detect changes
in dependent source files (Flutter framework, packages outside the
source directory, etc.), and re-generate the snapshots as needed.
Unfortunately, Gradle requires knowing the source files before executing
the task, and can't update them after building, so Gradle considers the
second build to be out-of-date (because it has more input files than the
first build). Sub-sequent builds have the correct dependency
information, and will be skipped if the source files haven't changed.
Also added a dependency on gen_snapshot. The snapshot ABI isn't stable,
so we need to re-generate the snapshots when we roll the Dart SDK
dependency.
Fixes #8315
Fixes #8687
Fixes #8607