Commit 07ec0acf authored by binji@chromium.org's avatar binji@chromium.org

[NaCl SDK] Create a resources/ directory and move files to it.

* Move files out of the roout of examples/ to resources/
* Move files from examples/resources to resources/
* Move Makefile templates to resources/ and rename them.

BUG=none
R=sbc@chromium.org

Review URL: https://codereview.chromium.org/23919004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221741 0039d316-1c4b-4281-b951-d872f2087c98
parent ae3b19fc
......@@ -19,7 +19,7 @@ import build_version
import easy_template
import parse_dsc
from build_paths import SDK_SRC_DIR, OUT_DIR, SDK_EXAMPLE_DIR
from build_paths import SDK_SRC_DIR, OUT_DIR, SDK_RESOURCE_DIR
sys.path.append(os.path.join(SDK_SRC_DIR, 'tools'))
import getos
......@@ -81,7 +81,7 @@ def main(args):
pepperdir = os.path.join(OUT_DIR, 'pepper_' + pepper_ver)
app_dir = os.path.join(OUT_DIR, 'naclsdk_app')
app_examples_dir = os.path.join(app_dir, 'examples')
sdk_resources_dir = os.path.join(SDK_EXAMPLE_DIR, 'resources')
sdk_resources_dir = SDK_RESOURCE_DIR
platform = getos.GetPlatform()
buildbot_common.RemoveDir(app_dir)
......@@ -138,7 +138,7 @@ def main(args):
os.environ['NACL_SDK_ROOT'] = pepperdir
build_projects.BuildProjects(app_dir, tree, deps=True, clean=False,
build_projects.BuildProjects(app_dir, tree, deps=False, clean=False,
config=config)
RemoveBuildCruft(app_dir)
......
......@@ -9,6 +9,7 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
SDK_SRC_DIR = os.path.dirname(SCRIPT_DIR)
SDK_EXAMPLE_DIR = os.path.join(SDK_SRC_DIR, 'examples')
SDK_LIBRARY_DIR = os.path.join(SDK_SRC_DIR, 'libraries')
SDK_RESOURCE_DIR = os.path.join(SDK_SRC_DIR, 'resources')
SDK_DIR = os.path.dirname(SDK_SRC_DIR)
SRC_DIR = os.path.dirname(SDK_DIR)
NACL_DIR = os.path.join(SRC_DIR, 'native_client')
......
......@@ -13,7 +13,7 @@ import build_version
import generate_make
import parse_dsc
from build_paths import NACL_DIR, SDK_SRC_DIR, OUT_DIR, SDK_EXAMPLE_DIR
from build_paths import NACL_DIR, SDK_SRC_DIR, OUT_DIR, SDK_RESOURCE_DIR
from build_paths import GSTORE
from generate_index import LandingPage
......@@ -54,14 +54,10 @@ def UpdateHelpers(pepperdir, clobber=False):
buildbot_common.RemoveDir(exampledir)
buildbot_common.MakeDir(exampledir)
# Copy files for individual bild and landing page
files = ['favicon.ico', 'httpd.cmd']
CopyFilesFromTo(files, SDK_EXAMPLE_DIR, exampledir)
resourcesdir = os.path.join(SDK_EXAMPLE_DIR, 'resources')
files = ['index.css', 'index.js', 'button_close.png',
'button_close_hover.png']
CopyFilesFromTo(files, resourcesdir, exampledir)
# Copy files for individual build and landing page
files = ['favicon.ico', 'httpd.cmd', 'index.css', 'index.js',
'button_close.png', 'button_close_hover.png']
CopyFilesFromTo(files, SDK_RESOURCE_DIR, exampledir)
# Copy tools scripts and make includes
buildbot_common.CopyDir(os.path.join(SDK_SRC_DIR, 'tools', '*.py'),
......@@ -133,9 +129,7 @@ def UpdateProjects(pepperdir, project_tree, toolchains,
if landing_page:
# Generate the landing page text file.
index_html = os.path.join(pepperdir, 'examples', 'index.html')
example_resources_dir = os.path.join(SDK_EXAMPLE_DIR, 'resources')
index_template = os.path.join(example_resources_dir,
'index.html.template')
index_template = os.path.join(SDK_RESOURCE_DIR, 'index.html.template')
with open(index_html, 'w') as fh:
out = landing_page.GeneratePage(index_template)
fh.write(out)
......
......@@ -11,7 +11,7 @@ import build_version
import getos
from buildbot_common import ErrorExit
from easy_template import RunTemplateFileIfChanged
from build_paths import SCRIPT_DIR, SDK_EXAMPLE_DIR
from build_paths import SDK_RESOURCE_DIR
def Trace(msg):
if Trace.verbose:
......@@ -137,7 +137,7 @@ def ProcessHTML(srcroot, dstroot, desc, toolchains, configs, first_toolchain):
def GenerateManifest(srcroot, dstroot, desc):
outdir = os.path.join(dstroot, desc['DEST'], desc['NAME'])
srcpath = os.path.join(SDK_EXAMPLE_DIR, 'resources', 'manifest.json.template')
srcpath = os.path.join(SDK_RESOURCE_DIR, 'manifest.json.template')
dstpath = os.path.join(outdir, 'manifest.json')
permissions = desc.get('PERMISSIONS', [])
socket_permissions = desc.get('SOCKET_PERMISSIONS', [])
......@@ -182,8 +182,7 @@ def ProcessProject(pepperdir, srcroot, dstroot, desc, toolchains, configs=None,
name = desc['NAME']
out_dir = os.path.join(dstroot, desc['DEST'], name)
buildbot_common.MakeDir(out_dir)
srcdirs = desc.get('SEARCH', ['.', '..', '../..'])
srcdirs.append(os.path.join(SDK_EXAMPLE_DIR, 'resources'))
srcdirs = desc.get('SEARCH', ['.', SDK_RESOURCE_DIR])
# Copy sources to example directory
sources = GenerateSourceCopyList(desc)
......@@ -198,9 +197,9 @@ def ProcessProject(pepperdir, srcroot, dstroot, desc, toolchains, configs=None,
make_path = os.path.join(out_dir, 'Makefile')
if IsNexe(desc):
template = os.path.join(SCRIPT_DIR, 'template.mk')
template = os.path.join(SDK_RESOURCE_DIR, 'Makefile.example.template')
else:
template = os.path.join(SCRIPT_DIR, 'library.mk')
template = os.path.join(SDK_RESOURCE_DIR, 'Makefile.library.template')
# Ensure the order of |tools| is the same as toolchains; that way if
# first_toolchain is set, it will choose based on the order of |toolchains|.
......@@ -240,7 +239,7 @@ def GenerateMasterMakefile(pepperdir, out_path, targets):
out_path: Root for output such that out_path+NAME = full path
targets: List of targets names
"""
in_path = os.path.join(SDK_EXAMPLE_DIR, 'Makefile')
in_path = os.path.join(SDK_RESOURCE_DIR, 'Makefile.index.template')
out_path = os.path.join(out_path, 'Makefile')
rel_path = os.path.relpath(pepperdir, os.path.dirname(out_path))
template_dict = {
......
{
'DISABLE_PACKAGE': True, # Doesn't work in packaged apps yet.
'TOOLS': ['newlib'],
'SEARCH': [
'.',
'../..',
],
'TARGETS': [
{
'NAME' : 'debugging',
......
{
'TOOLS': ['newlib', 'glibc', 'pnacl', 'linux', 'win'],
'SEARCH': [
'.',
'../../../../testing/gmock/include/gmock',
'../../../../testing/gmock/include/gmock/internal',
'../../../../testing/gmock/src',
......
{
'TOOLS': ['newlib', 'glibc', 'pnacl', 'win', 'linux'],
'SEARCH': [
'.',
'../../../../ppapi/cpp',
'../../../../ppapi/cpp/dev',
'../../../../ppapi/cpp/extensions',
......
{
'TOOLS': ['newlib', 'glibc', 'pnacl', 'win'],
'SEARCH': [
'.'
],
'TARGETS': [
{
'NAME' : 'sdk_util',
......
{
'TOOLS': ['newlib', 'glibc', 'pnacl'],
'SEARCH': [
'.'
],
'TARGETS': [
{
'NAME' : 'xray',
......
{
'TOOLS': ['newlib', 'glibc', 'pnacl'],
# Need to add ../../examples for common.js
'SEARCH': ['.', '../../examples'],
'TARGETS': [
{
'NAME' : 'nacl_io_socket_test',
......
......@@ -2,8 +2,6 @@
'TOOLS': ['newlib', 'glibc', 'pnacl'],
'SEL_LDR': True,
# Need to add ../../examples for common.js
'SEARCH': ['.', '../../examples'],
'TARGETS': [
{
'NAME' : 'nacl_io_test',
......
......@@ -2,8 +2,6 @@
'TOOLS': ['newlib', 'glibc', 'pnacl'],
'SEL_LDR': True,
# Need to add ../../examples for common.js
'SEARCH': ['.', '../../examples'],
'TARGETS': [
{
'NAME' : 'sdk_util_test',
......
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