-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[eas-cli] compute fingerprint on each build (#2663)
* Temporary Commit at 11/4/2024, 4:33:33 PM * Temporary Commit at 11/5/2024, 4:17:31 PM * Temporary Commit at 11/5/2024, 4:22:18 PM
- Loading branch information
Showing
6 changed files
with
120 additions
and
16 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Env, Workflow } from '@expo/eas-build-job'; | ||
import { silent as silentResolveFrom } from 'resolve-from'; | ||
|
||
export async function createFingerprintAsync( | ||
projectDir: string, | ||
options: { | ||
workflow: Workflow; | ||
platform: string; | ||
debug?: boolean; | ||
env: Env | undefined; | ||
cwd?: string; | ||
} | ||
): Promise<{ | ||
hash: string; | ||
sources: object[]; | ||
isDebugSource: boolean; | ||
} | null> { | ||
// @expo/fingerprint is exported in the expo package for SDK 52+ | ||
const fingerprintPath = silentResolveFrom(projectDir, 'expo/fingerprint'); | ||
if (!fingerprintPath) { | ||
return null; | ||
} | ||
const Fingerprint = require(fingerprintPath); | ||
const fingerprintOptions: Record<string, any> = {}; | ||
if (options.platform) { | ||
fingerprintOptions.platforms = [options.platform]; | ||
} | ||
if (options.workflow === Workflow.MANAGED) { | ||
fingerprintOptions.ignorePaths = ['android/**/*', 'ios/**/*']; | ||
} | ||
if (options.debug) { | ||
fingerprintOptions.debug = true; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/return-await | ||
return await Fingerprint.createFingerprintAsync(projectDir, fingerprintOptions); | ||
} |