summaryrefslogtreecommitdiffstats
path: root/native_client_sdk
diff options
context:
space:
mode:
authormball@google.com <mball@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-13 23:40:06 +0000
committermball@google.com <mball@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-13 23:40:06 +0000
commitfa85bbaa753bd7c15e4a43d6d85de6cbfbcae524 (patch)
treea9bff3aa0fc4cab935edf6c7367d9db38ea1219c /native_client_sdk
parent9e03e2c8fddfbc21d360909f94912f190313b257 (diff)
downloadchromium_src-fa85bbaa753bd7c15e4a43d6d85de6cbfbcae524.zip
chromium_src-fa85bbaa753bd7c15e4a43d6d85de6cbfbcae524.tar.gz
chromium_src-fa85bbaa753bd7c15e4a43d6d85de6cbfbcae524.tar.bz2
Merged in r1390 from old NaCl SDK repository
BUG=None TEST=None TBR=bradnelson@chromium.org Review URL: http://codereview.chromium.org/8921018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114307 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
-rwxr-xr-xnative_client_sdk/src/project_templates/init_project.py11
-rwxr-xr-xnative_client_sdk/src/project_templates/init_project_test.py2
2 files changed, 8 insertions, 5 deletions
diff --git a/native_client_sdk/src/project_templates/init_project.py b/native_client_sdk/src/project_templates/init_project.py
index 52aa1b8b..2cfd889 100755
--- a/native_client_sdk/src/project_templates/init_project.py
+++ b/native_client_sdk/src/project_templates/init_project.py
@@ -264,7 +264,7 @@ class ProjectInitializer(object):
def __init__(self, is_c_project, is_vs_project, project_name,
project_location, nacl_platform, project_templates_dir,
- os_resource=os):
+ nacl_sdk_root=None, os_resource=os):
"""Initializes all the fields that are known after parsing the parameters.
Args:
@@ -285,6 +285,7 @@ class ProjectInitializer(object):
self.__project_templates_dir = project_templates_dir
# System resources are properties so mocks can be inserted.
self.__fileinput = fileinput
+ self.__nacl_sdk_root = nacl_sdk_root
self.__os = os_resource
self.__shutil = shutil
self.__sys = sys
@@ -350,7 +351,7 @@ class ProjectInitializer(object):
contents as necessary.
"""
camel_case_name = GetCamelCaseName(self.__project_name)
- sdk_root_dir = os.getenv('NACL_SDK_ROOT', None)
+ sdk_root_dir = self.__nacl_sdk_root
if not sdk_root_dir:
raise Error("Error: NACL_SDK_ROOT is not set")
sdk_root_dir = self.os.path.abspath(sdk_root_dir)
@@ -475,7 +476,8 @@ def main(argv):
print 'init_project is preparing your project.'
# Check to see if the project is going into the SDK bundle. If so, issue a
# warning.
- sdk_root_dir = os.getenv('NACL_SDK_ROOT', None)
+ sdk_root_dir = os.getenv('NACL_SDK_ROOT',
+ os.path.dirname(os.path.dirname(script_dir)))
if sdk_root_dir:
if os.path.normpath(options.project_directory).count(
os.path.normpath(sdk_root_dir)) > 0:
@@ -487,7 +489,8 @@ def main(argv):
options.project_name,
options.project_directory,
options.nacl_platform,
- script_dir)
+ script_dir,
+ nacl_sdk_root=sdk_root_dir)
project_initializer.PrepareDirectoryContent()
project_initializer.PrepareFileContent()
return 0
diff --git a/native_client_sdk/src/project_templates/init_project_test.py b/native_client_sdk/src/project_templates/init_project_test.py
index 931aec3..708183b 100755
--- a/native_client_sdk/src/project_templates/init_project_test.py
+++ b/native_client_sdk/src/project_templates/init_project_test.py
@@ -104,7 +104,7 @@ class TestProjectInitializer(unittest.TestCase):
self.test_subject = init_project.ProjectInitializer(
# True => is C project, False => is vs project
True, False, 'test_project', 'test/dir', 'pepper_14', self.script_dir,
- init_os_mock)
+ self.nacl_src_dir, os_resource=init_os_mock)
self.mock_factory.VerifyAll()
self.InitializeResourceMocks()