This repository has been archived by the owner on Apr 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e108967
commit b95bae2
Showing
40 changed files
with
3,052 additions
and
2,836 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": "./node_modules/gts/tsconfig-google.json", | ||
"compilerOptions": { | ||
"rootDir": ".", | ||
"outDir": "build" | ||
}, | ||
"include": [ | ||
"scripts/*.ts", | ||
"scripts/**/*.ts" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
} |
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,67 @@ | ||
/** | ||
* Copyright 2017 Google Inc. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import * as path from 'path'; | ||
import * as pify from 'pify'; | ||
import * as rawFs from 'fs'; | ||
import * as rawMkdirp from 'mkdirp'; | ||
import * as rawNcp from 'ncp'; | ||
|
||
const fs = pify(rawFs); | ||
const mkdirp = pify(rawMkdirp); | ||
const ncp = pify(rawNcp); | ||
|
||
const TEST = 'test'; | ||
const SYSTEM_TEST = 'system-test'; | ||
const PACKAGE_JSON = 'package.json'; | ||
|
||
// For the transpiled code: | ||
// __dirname = <project root>/build/scripts/ | ||
const PROJECT_ROOT = path.join(__dirname, '..', '..'); | ||
const BUILD_DIR = path.join(PROJECT_ROOT, 'build'); | ||
|
||
const INPUT_TEST_DIR = path.join(PROJECT_ROOT, TEST); | ||
const INPUT_SYSTEM_TEST_DIR = path.join(PROJECT_ROOT, SYSTEM_TEST); | ||
const INPUT_PACKAGE_JSON = path.join(PROJECT_ROOT, PACKAGE_JSON); | ||
|
||
const OUTPUT_TEST_DIR = path.join(BUILD_DIR, TEST); | ||
const OUTPUT_SYSTEM_TEST_DIR = path.join(BUILD_DIR, SYSTEM_TEST); | ||
const OUTPUT_PACKAGE_JSON = path.join(BUILD_DIR, PACKAGE_JSON); | ||
|
||
async function setupUnitTests(): Promise<void> { | ||
await mkdirp(OUTPUT_TEST_DIR); | ||
await fs.writeFile(OUTPUT_PACKAGE_JSON, | ||
await fs.readFile(INPUT_PACKAGE_JSON)); | ||
await ncp(INPUT_TEST_DIR, OUTPUT_TEST_DIR); | ||
} | ||
|
||
async function setupSystemTests(): Promise<void> { | ||
await mkdirp(OUTPUT_SYSTEM_TEST_DIR); | ||
await ncp(INPUT_SYSTEM_TEST_DIR, OUTPUT_SYSTEM_TEST_DIR); | ||
} | ||
|
||
async function main(): Promise<void> { | ||
try { | ||
await setupUnitTests(); | ||
await setupSystemTests(); | ||
} | ||
catch (e) { | ||
console.error(e); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
main(); |
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
Oops, something went wrong.