Commit 203787a4 authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

Move Fuchsia SDK to //third_party/fuchsia-sdk/sdk

Previously the SDK was unpacked in //third_party/fuchsia-sdk. Moving
it to a nested directory will allow adding GN build files under
//third_party/fuchsia-sdk for libraries and FIDL interfaces in the SDK.

Bug: 707030
Change-Id: I7687f7e44010e5b93ba487c25b7e48ea755ae024
Reviewed-on: https://chromium-review.googlesource.com/976741Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
Reviewed-by: default avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546228}
parent 5c8eb661
......@@ -6,5 +6,5 @@ assert(current_os == "fuchsia")
declare_args() {
# Path to Fuchsia SDK.
fuchsia_sdk = "//third_party/fuchsia-sdk"
fuchsia_sdk = "//third_party/fuchsia-sdk/sdk"
}
......@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/fuchsia/config.gni")
# Creates a Fuchsia .far package file.
#
# Parameters are:
......@@ -16,7 +18,7 @@ template("package") {
}
assert(defined(pkg.binary))
_pm_tool_path = "//third_party/fuchsia-sdk/tools/pm"
_pm_tool_path = "${fuchsia_sdk}/tools/pm"
_pkg_out_dir = "$root_out_dir/gen/" + get_label_info(pkg.package_name, "dir")
_runtime_deps_file = "$_pkg_out_dir/${pkg.package_name}.runtime_deps"
......
......@@ -5,6 +5,7 @@
assert(is_fuchsia)
import("//build/config/chromecast_build.gni")
import("//build/config/fuchsia/config.gni")
import("//build/config/fuchsia/package.gni")
template("generate_runner_script") {
......@@ -61,7 +62,7 @@ template("generate_runner_script") {
invoker.generated_script,
"//build/fuchsia/",
"//build/util/lib/",
"//third_party/fuchsia-sdk/",
"${fuchsia_sdk}/",
_runtime_deps_file,
]
data_deps = [
......@@ -119,7 +120,7 @@ template("generate_runner_script") {
_manifest_path,
"//build/fuchsia/runner_v2/",
"//build/util/lib/",
"//third_party/fuchsia-sdk/",
"${fuchsia_sdk}/",
]
# Arguments used at build time by the runner script generator.
......
......@@ -23,7 +23,7 @@ import uuid
DIR_SOURCE_ROOT = os.path.abspath(
os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'fuchsia-sdk')
SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'fuchsia-sdk', 'sdk')
# The guest will get 192.168.3.9 from DHCP, while the host will be
# accessible as 192.168.3.2 .
......
......@@ -6,5 +6,5 @@ import os
DIR_SOURCE_ROOT = os.path.abspath(
os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir))
SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'fuchsia-sdk')
SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'fuchsia-sdk', 'sdk')
......@@ -21,6 +21,9 @@ sys.path.append(os.path.join(REPOSITORY_ROOT, 'build'))
import find_depot_tools
SDK_SUBIDRS = ["arch", "pkg", "qemu", "sysroot", "target",
"toolchain_libs", "tools"]
def EnsureDirExists(path):
if not os.path.exists(path):
......@@ -28,11 +31,26 @@ def EnsureDirExists(path):
os.makedirs(path)
# Removes previous SDK from the specified path if it's detected there.
def Cleanup(path):
hash_file = os.path.join(path, '.hash')
if os.path.exists(hash_file):
print 'Removing old SDK from %s.' % path
for d in SDK_SUBIDRS:
shutil.rmtree(os.path.join(path, d))
os.remove(hash_file)
def main():
if len(sys.argv) != 1:
print >>sys.stderr, 'usage: %s' % sys.argv[0]
return 1
# Previously SDK was unpacked in //third_party/fuchsia-sdk instead of
# //third_party/fuchsia-sdk/sdk . Remove the old files if they are still
# there.
Cleanup(os.path.join(REPOSITORY_ROOT, 'third_party', 'fuchsia-sdk'))
with open(SDK_HASH_FILE, 'r') as f:
sdk_hash = f.read().strip()
......@@ -40,7 +58,8 @@ def main():
print >>sys.stderr, 'No SHA1 found in %s' % SDK_HASH_FILE
return 1
output_dir = os.path.join(REPOSITORY_ROOT, 'third_party', 'fuchsia-sdk')
output_dir = os.path.join(REPOSITORY_ROOT, 'third_party', 'fuchsia-sdk',
'sdk')
hash_filename = os.path.join(output_dir, '.hash')
if os.path.exists(hash_filename):
......
......@@ -62,7 +62,7 @@
/flatbuffers/src
/fontconfig/src
/freetype/src
/fuchsia-sdk
/fuchsia-sdk/sdk
/gestures/gestures
/gles1_conform
/gles2_conform
......
file://build/fuchsia/OWNERS
Name: Fuchsia NDK
URL: https://fuchsia.googlesource.com/docs/+/master/development/sdk/README.md
Version: 0
Security Critical: no
License: BSD 3-Clause, MIT, GPL v2
Description:
This directory contains the current Fuchsia SDK. The SDK contains headers,
libraries and tools that are needed to build Chromium for Fuchsia. It also
contains qemu, which is used to run tests on Fuchsia.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment