forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize version and platform into Deno.build and Deno.version (den…
- Loading branch information
1 parent
91364ca
commit de1a10e
Showing
14 changed files
with
52 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. | ||
|
||
// Do not add unsupported platforms. | ||
/** Build related information */ | ||
export interface BuildInfo { | ||
/** The operating system CPU architecture. */ | ||
arch: "x64"; | ||
|
||
/** The operating system platform. */ | ||
os: "mac" | "win" | "linux"; | ||
|
||
/** The GN build arguments */ | ||
gnArgs: string; | ||
} | ||
|
||
// 'build' is injected by rollup.config.js at compile time. | ||
export const build: BuildInfo = { | ||
// tslint:disable:no-any | ||
// These string will be replaced by rollup | ||
arch: `ROLLUP_REPLACE_ARCH` as any, | ||
os: `ROLLUP_REPLACE_OS` as any, | ||
gnArgs: `ROLLUP_REPLACE_GN_ARGS` | ||
// tslint:disable:any | ||
}; | ||
|
||
// TODO(kevinkassimo): deprecate Deno.platform | ||
export const platform = build; |
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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. | ||
import { test, assert } from "./test_util.ts"; | ||
|
||
test(function platformTransform() { | ||
// deno.platform is injected by rollup at compile time. Here | ||
test(function buildInfo() { | ||
// Deno.build is injected by rollup at compile time. Here | ||
// we check it has been properly transformed. | ||
const { arch, os } = Deno.platform; | ||
const { arch, os } = Deno.build; | ||
assert(arch === "x64"); | ||
assert(os === "mac" || os === "win" || os === "linux"); | ||
}); | ||
|
||
test(function buildGnArgs() { | ||
assert(Deno.build.gnArgs.length > 100); | ||
}); |
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 was deleted.
Oops, something went wrong.
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
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