New issue
Advanced search Search tips

Issue 759146 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Add a script to allow compiling a single source file.

Project Member Reported by sebmarchand@chromium.org, Aug 25 2017

Issue description

Compiling a single source file is already doable with ninja but can be tricky, the basic command is:
ninja -C out/Debug ../../path/to/file^

it requires manipulating the path so it's relative to the build directory and the number of carets depend on your OS and on if you're using wrapper scripts to invoke ninja.

Having a small helper script to automatically compile a source file will be quite convenient and this could be used directly in a text editor (like Sublime) to compile the file you're currently editing.

This script would be invoked like this: compile_single_file --file-path {path_to_file} --build-dir {build_dir}

{path_to_file} and {build_dir} could either be absolute or relative to the current working directory.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Sep 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/tools/depot_tools/+/4dd9682b11148f4fd6e2fbf99d16e67bd7422eb5

commit 4dd9682b11148f4fd6e2fbf99d16e67bd7422eb5
Author: Sebastien Marchand <sebmarchand@chromium.org>
Date: Wed Sep 06 18:22:17 2017

Add a script to make it easier to build a single source file with ninja

Bug:  759146 
Change-Id: I19edd0b525044655bb9a38b7ada0be9064457f38
Reviewed-on: https://chromium-review.googlesource.com/636446
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>

[add] https://crrev.com/4dd9682b11148f4fd6e2fbf99d16e67bd7422eb5/compile_single_file.py
[add] https://crrev.com/4dd9682b11148f4fd6e2fbf99d16e67bd7422eb5/compile_single_file.bat
[add] https://crrev.com/4dd9682b11148f4fd6e2fbf99d16e67bd7422eb5/compile_single_file

Status: Fixed (was: Assigned)
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0724732216bbc245eeff06787c9fb9698fe9270b

commit 0724732216bbc245eeff06787c9fb9698fe9270b
Author: Sebastien Marchand <sebmarchand@chromium.org>
Date: Thu Mar 08 21:05:23 2018

Documents how to use compile_single_file in VSCode and Sublime.

This scripts lives in depot_tools.

Bug:  759146 
Change-Id: I3877d3b53ef2f91b34cebb61b04e6f285a006ae7
Reviewed-on: https://chromium-review.googlesource.com/911428
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Lutz Justen <ljusten@chromium.org>
Reviewed-by: Sasha Morrissey <sashab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541885}
[modify] https://crrev.com/0724732216bbc245eeff06787c9fb9698fe9270b/docs/sublime_ide.md
[modify] https://crrev.com/0724732216bbc245eeff06787c9fb9698fe9270b/docs/vscode.md

Sign in to add a comment