Skip to content

Commit

Permalink
rename 'skipPreloads' to 'buildFromSource'
Browse files Browse the repository at this point in the history
  • Loading branch information
georgexu99 committed Aug 8, 2023
1 parent 57cc0d7 commit ff4bd84
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ process.on('unhandledRejection', handler);
useElectronClang: !!argv.useElectronClang,
disablePreGypCopy: !!argv.disablePreGypCopy,
projectRootPath,
skipPrebuilds: !!argv.skipPrebuilds,
buildFromSource: !!argv.buildFromSource,
});

const lifecycle = rebuilder.lifecycle;
Expand Down
2 changes: 1 addition & 1 deletion src/module-rebuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class ModuleRebuilder {

async rebuild(cacheKey: string): Promise<boolean> {
if (
!this.rebuilder.skipPrebuilds && (
!this.rebuilder.buildFromSource && (
(await this.findPrebuildifyModule(cacheKey)) ||
(await this.findPrebuildInstallModule(cacheKey)) ||
(await this.findNodePreGypInstallModule(cacheKey)))
Expand Down
6 changes: 3 additions & 3 deletions src/rebuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface RebuildOptions {
projectRootPath?: string;
forceABI?: number;
disablePreGypCopy?: boolean;
skipPrebuilds?: boolean;
buildFromSource?: boolean;
}

export interface RebuilderOptions extends RebuildOptions {
Expand Down Expand Up @@ -61,7 +61,7 @@ export class Rebuilder implements IRebuilder {
public msvsVersion?: string;
public useElectronClang: boolean;
public disablePreGypCopy: boolean;
public skipPrebuilds: boolean;
public buildFromSource: boolean;

constructor(options: RebuilderOptions) {
this.lifecycle = options.lifecycle;
Expand All @@ -78,7 +78,7 @@ export class Rebuilder implements IRebuilder {
this.prebuildTagPrefix = options.prebuildTagPrefix || 'v';
this.msvsVersion = process.env.GYP_MSVS_VERSION;
this.disablePreGypCopy = options.disablePreGypCopy || false;
this.skipPrebuilds = options.skipPrebuilds || false;
this.buildFromSource = options.buildFromSource || false;

if (this.useCache && this.force) {
console.warn('[WARNING]: Electron Rebuild has force enabled and cache enabled, force take precedence and the cache will not be used.');
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface IRebuilder {
msvsVersion?: string;
platform: string;
prebuildTagPrefix: string;
skipPrebuilds: boolean;
buildFromSource: boolean;
useCache: boolean;
useElectronClang: boolean;
}
2 changes: 1 addition & 1 deletion test/rebuild-napibuildversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('rebuild with napi_build_versions in binary config', async function ()
buildPath: testModulePath,
electronVersion: testElectronVersion,
arch,
skipPrebuilds: true, // need to skip node-pre-gyp prebuilt binary
buildFromSource: true, // need to skip node-pre-gyp prebuilt binary
});

await expectNativeModuleToBeRebuilt(testModulePath, 'sqlite3');
Expand Down

0 comments on commit ff4bd84

Please sign in to comment.