Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: tools/gn/gyp_target_writer.cc

Issue 206813002: Remove GN GYP generator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/gyp_target_writer.h ('k') | tools/gn/secondary/chrome/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/gyp_target_writer.cc
diff --git a/tools/gn/gyp_target_writer.cc b/tools/gn/gyp_target_writer.cc
deleted file mode 100644
index 789b6b05a2f5722f7265a4d7865e813056800ea9..0000000000000000000000000000000000000000
--- a/tools/gn/gyp_target_writer.cc
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "tools/gn/gyp_target_writer.h"
-
-#include <iostream>
-
-#include "base/file_util.h"
-#include "base/files/file_path.h"
-#include "tools/gn/build_settings.h"
-#include "tools/gn/builder_record.h"
-#include "tools/gn/filesystem_utils.h"
-#include "tools/gn/gyp_action_target_writer.h"
-#include "tools/gn/gyp_binary_target_writer.h"
-#include "tools/gn/scheduler.h"
-#include "tools/gn/settings.h"
-#include "tools/gn/target.h"
-#include "tools/gn/toolchain.h"
-
-GypTargetWriter::TargetGroup::TargetGroup()
- : debug(NULL),
- release(NULL),
- host_debug(NULL),
- host_release(NULL),
- debug64(NULL),
- release64(NULL),
- xcode_debug(NULL),
- xcode_release(NULL),
- xcode_host_debug(NULL),
- xcode_host_release(NULL) {
-}
-
-GypTargetWriter::GypTargetWriter(const Target* target,
- const Toolchain* toolchain,
- const SourceDir& gyp_dir,
- std::ostream& out)
- : settings_(target->settings()),
- target_(target),
- toolchain_(toolchain),
- gyp_dir_(gyp_dir),
- out_(out),
- // All GYP paths are relative to GYP file.
- path_output_(gyp_dir, ESCAPE_JSON, false) {
-}
-
-GypTargetWriter::~GypTargetWriter() {
-}
-
-// static
-void GypTargetWriter::WriteFile(const SourceFile& gyp_file,
- const std::vector<TargetGroup>& targets,
- const Toolchain* debug_toolchain,
- Err* err) {
- if (targets.empty())
- return;
- const Settings* debug_settings =
- targets[0].debug->item()->AsTarget()->settings();
- const BuildSettings* debug_build_settings = debug_settings->build_settings();
-
- base::FilePath gyp_file_path = debug_build_settings->GetFullPath(gyp_file);
- base::CreateDirectory(gyp_file_path.DirName());
-
- std::stringstream file;
- file << "# Generated by GN. Do not edit.\n\n";
- file << "{\n";
-
- // Optional GYP header specified in the default debug toolchain.
- if (!debug_toolchain->gyp_header().empty())
- file << debug_toolchain->gyp_header() << std::endl;
-
- file << " 'skip_includes': 1,\n";
- file << " 'targets': [\n";
-
- for (size_t i = 0; i < targets.size(); i++) {
- const Target* cur = targets[i].debug->item()->AsTarget();
- switch (cur->output_type()) {
- case Target::COPY_FILES:
- break; // TODO(brettw)
- case Target::ACTION:
- case Target::ACTION_FOREACH: {
- GypActionTargetWriter writer(targets[i], debug_toolchain,
- gyp_file.GetDir(), file);
- writer.Run();
- break;
- }
- case Target::GROUP:
- break; // TODO(brettw)
- case Target::EXECUTABLE:
- case Target::STATIC_LIBRARY:
- case Target::SHARED_LIBRARY:
- case Target::SOURCE_SET: {
- GypBinaryTargetWriter writer(targets[i], debug_toolchain,
- gyp_file.GetDir(), file);
- writer.Run();
- break;
- }
- default:
- CHECK(0);
- }
- }
-
- file << " ],\n}\n";
-
- std::string contents = file.str();
- base::WriteFile(gyp_file_path, contents.c_str(),
- static_cast<int>(contents.size()));
-}
-
-std::ostream& GypTargetWriter::Indent(int spaces) {
- return Indent(out_, spaces);
-}
-
-// static
-std::ostream& GypTargetWriter::Indent(std::ostream& out, int spaces) {
- const char kSpaces[81] =
- " "
- " ";
- CHECK(static_cast<size_t>(spaces) <= arraysize(kSpaces) - 1);
- out.write(kSpaces, spaces);
- return out;
-}
« no previous file with comments | « tools/gn/gyp_target_writer.h ('k') | tools/gn/secondary/chrome/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698