-
Notifications
You must be signed in to change notification settings - Fork 51
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
Fix build cache management in workspaces #675
Merged
+58
−38
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0a1d9bb
init
filip131311 01ee387
format
filip131311 5ca477e
CR
filip131311 106f3c4
Merge remote-tracking branch 'origin/main' into @Filip131311/FixFinge…
kmagiera feb252d
Fix review comments
kmagiera d265552
Make migration async
kmagiera 7a81b19
Fix logic to work ok for Android and iOS
kmagiera 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ import { | |
import { Logger } from "../Logger"; | ||
import { DeviceInfo } from "../common/DeviceManager"; | ||
import { DeviceAlreadyUsedError, DeviceManager } from "../devices/DeviceManager"; | ||
import { extensionContext } from "../utilities/extensionContext"; | ||
import { extensionContext, getAppRootFolder } from "../utilities/extensionContext"; | ||
import { IosSimulatorDevice } from "../devices/IosSimulatorDevice"; | ||
import { AndroidEmulatorDevice } from "../devices/AndroidEmulatorDevice"; | ||
import { DependencyManager } from "../dependency/DependencyManager"; | ||
|
@@ -31,7 +31,7 @@ import { DebugSessionDelegate } from "../debugging/DebugSession"; | |
import { Metro, MetroDelegate } from "./metro"; | ||
import { Devtools } from "./devtools"; | ||
import { AppEvent, DeviceSession, EventDelegate } from "./deviceSession"; | ||
import { PlatformBuildCache } from "../builders/PlatformBuildCache"; | ||
import { BuildCache } from "../builders/BuildCache"; | ||
import { PanelLocation } from "../common/WorkspaceConfig"; | ||
import { activateDevice, getLicenseToken } from "../utilities/license"; | ||
|
||
|
@@ -671,7 +671,8 @@ export class Project | |
private checkIfNativeChanged = throttleAsync(async () => { | ||
if (!this.isCachedBuildStale && this.projectState.selectedDevice) { | ||
const platform = this.projectState.selectedDevice.platform; | ||
const isCacheStale = await PlatformBuildCache.forPlatform(platform).isCacheStale(); | ||
const buildCache = new BuildCache(platform, getAppRootFolder()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would it be possible to restructure the code in a way that we don't have to instantiate the new cache object here? This doesn't matter at this point because the class is stateless, but may be a source of errors in the future if we end up changing that. |
||
const isCacheStale = await buildCache.isCacheStale(); | ||
|
||
if (isCacheStale) { | ||
this.isCachedBuildStale = true; | ||
|
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.