2019-03-06 16:54:58 -05:00
|
|
|
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
|
|
|
|
2019-03-11 20:34:48 -04:00
|
|
|
export type OperatingSystem = "mac" | "win" | "linux";
|
|
|
|
|
|
|
|
export type Arch = "x64" | "arm64";
|
|
|
|
|
2019-03-06 16:54:58 -05:00
|
|
|
// Do not add unsupported platforms.
|
|
|
|
/** Build related information */
|
|
|
|
export interface BuildInfo {
|
2019-03-11 20:34:48 -04:00
|
|
|
/** The CPU architecture. */
|
|
|
|
arch: Arch;
|
2019-03-06 16:54:58 -05:00
|
|
|
|
2019-03-11 20:34:48 -04:00
|
|
|
/** The operating system. */
|
|
|
|
os: OperatingSystem;
|
2019-03-06 16:54:58 -05:00
|
|
|
|
2019-03-07 09:11:49 -05:00
|
|
|
/** The arguments passed to GN during build. See `gn help buildargs`. */
|
|
|
|
args: string;
|
2019-03-06 16:54:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// 'build' is injected by rollup.config.js at compile time.
|
|
|
|
export const build: BuildInfo = {
|
|
|
|
// These string will be replaced by rollup
|
2019-03-11 20:34:48 -04:00
|
|
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
2019-03-06 16:54:58 -05:00
|
|
|
arch: `ROLLUP_REPLACE_ARCH` as any,
|
2019-03-11 20:34:48 -04:00
|
|
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
2019-03-06 16:54:58 -05:00
|
|
|
os: `ROLLUP_REPLACE_OS` as any,
|
2019-03-07 09:11:49 -05:00
|
|
|
args: `ROLLUP_REPLACE_GN_ARGS`
|
2019-03-06 16:54:58 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
// TODO(kevinkassimo): deprecate Deno.platform
|
|
|
|
export const platform = build;
|