Ensure that the build system checks for updates of locally built flutter_web_sdk artifacts (#156534)

The SourceVisitor uses the engineVersion parameter to determine whether it needs to check for changes to artifacts or if it can assume that artifacts are unmodified from a versioned build of the engine.  engineVersion is set based on whether the Artifacts instance sets the isLocalEngine property.

CachedLocalWebSdkArtifacts (instantiated when the --local-web-sdk flag is used) was only setting isLocalEngine if --local-engine was also used.  This caused the build system to ignore changes to the files in the locally built flutter_web_sdk when using --local-web-sdk alone.

This PR renames Artifacts.isLocalEngine to usesLocalArtifacts in order to clarify what it means.  It also changes CachedLocalWebSdkArtifacts to always enable usesLocalArtifacts.
This commit is contained in:
Jason Simmons
2024-10-21 15:52:29 -07:00
committed by GitHub
parent 4e8060eff5
commit 8b4d48715b
7 changed files with 25 additions and 13 deletions

View File

@@ -300,6 +300,17 @@ void main() {
'darwin-x64',
);
});
testWithoutContext('CachedLocalWebSdkArtifacts wrapping a versioned engine sets usesLocalArtifacts', () {
final CachedLocalWebSdkArtifacts webArtifacts = CachedLocalWebSdkArtifacts(
parent: artifacts,
webSdkPath: fileSystem.path.join(fileSystem.currentDirectory.path, 'out', 'wasm_release'),
fileSystem: fileSystem,
platform: platform,
operatingSystemUtils: FakeOperatingSystemUtils()
);
expect(webArtifacts.usesLocalArtifacts, true);
});
});
group('LocalEngineArtifacts', () {