Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bazel): Eject Bazel #29167

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+50 −28
Diff settings

Always

Just for now

feat(bazel): Eject Bazel

Add command line flag to expose Bazel files on disk.

`ng build --leaveBazelFilesOnDisk`
  • Loading branch information...
kyliau committed Mar 7, 2019
commit 53f8e18daded765854aea706dabfc57052fc5762
@@ -20,7 +20,7 @@ class BazelBuilder implements Builder<Schema> {
run(config: BuilderConfiguration<Partial<Schema>>): Observable<BuildEvent> {
const {host, logger, workspace} = this.context;
const root: Path = workspace.root;
const {bazelCommand, targetLabel, watch} = config.options as Schema;
const {bazelCommand, leaveBazelFilesOnDisk, targetLabel, watch} = config.options as Schema;
const executable = watch ? 'ibazel' : 'bazel';
const binary = checkInstallation(executable, root) as Path;

@@ -35,7 +35,9 @@ class BazelBuilder implements Builder<Schema> {
logger.error(err.message);
return {success: false};
} finally {
await deleteBazelFiles(host, bazelFiles); // this will never throw
if (!leaveBazelFilesOnDisk) {
await deleteBazelFiles(host, bazelFiles); // this will never throw
}
}
}));
}
@@ -9,14 +9,27 @@
* Options for Bazel Builder
*/
export interface Schema {
/**
* Common commands supported by Bazel.
*/
bazelCommand: BazelCommand;
/**
* If true, leave Bazel files on disk after running command.
*/
leaveBazelFilesOnDisk?: boolean;
/**
* Target to be executed under Bazel.
*/
targetLabel: string;
/**
* If true, watch the filesystem using ibazel.
*/
watch?: boolean;
}

/**
* Common commands supported by Bazel.
*/
export enum BazelCommand {
Build = 'build',
Run = 'run',
@@ -1,29 +1,36 @@
{
"$schema": "http://json-schema.org/schema",
"title": "Bazel builder schema",
"description": "Options for Bazel Builder",
"type": "object",
"properties": {
"targetLabel": {
"type": "string",
"description": "Target to be executed under Bazel."
},
"bazelCommand": {
"type": "string",
"enum": [
"run",
"build",
"test"
]
},
"watch": {
"type": "boolean",
"default": false
}
"$schema": "http://json-schema.org/schema",
"title": "Bazel builder schema",
"description": "Options for Bazel Builder",
"type": "object",
"properties": {
"targetLabel": {
"type": "string",
"description": "Target to be executed under Bazel."
},
"additionalProperties": false,
"required": [
"targetLabel",
"bazelCommand"
]
"bazelCommand": {
"type": "string",
"description": "Common commands supported by Bazel.",
"enum": [
"run",
"build",
"test"
]
},
"watch": {
"type": "boolean",
"description": "If true, watch the filesystem using ibazel.",
"default": false
},
"leaveBazelFilesOnDisk": {
"type": "boolean",
"description": "If true, leave Bazel files on disk after running command.",
"default": false
}
},
"additionalProperties": false,
"required": [
"targetLabel",
"bazelCommand"
]
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.