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

Unified Diff: native_client_sdk/src/build_tools/build_sdk.py

Issue 11074004: [NaCl SDK] Generate NOTICE file automatically. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback Created 8 years, 2 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 | « native_client_sdk/src/NOTICE ('k') | native_client_sdk/src/build_tools/generate_notice.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/build_tools/build_sdk.py
diff --git a/native_client_sdk/src/build_tools/build_sdk.py b/native_client_sdk/src/build_tools/build_sdk.py
index c20f0a5aba1ae24afd86ede7c2f024f638ec5c23..316580970184e69d8c39e3d07c0d8feca6c32906 100755
--- a/native_client_sdk/src/build_tools/build_sdk.py
+++ b/native_client_sdk/src/build_tools/build_sdk.py
@@ -20,9 +20,9 @@ and whether it should upload an SDK to file storage (GSTORE)
# std python includes
import copy
import datetime
-import generate_make
import optparse
import os
+import re
import subprocess
import sys
@@ -30,6 +30,8 @@ import sys
import buildbot_common
import build_updater
import build_utils
+import generate_make
+import generate_notice
import manifest_util
from tests import test_server
@@ -168,7 +170,7 @@ def BuildStepMakePepperDirs(pepperdir, subdirs):
def BuildStepCopyTextFiles(pepperdir, pepper_ver, revision):
buildbot_common.BuildStep('Add Text Files')
- files = ['AUTHORS', 'COPYING', 'LICENSE', 'NOTICE']
+ files = ['AUTHORS', 'COPYING', 'LICENSE']
files = [os.path.join(SDK_SRC_DIR, filename) for filename in files]
oshelpers.Copy(['-v'] + files + [pepperdir])
@@ -712,6 +714,22 @@ def BuildStepBuildLibraries(pepperdir, platform, directory, clean=True):
clean=clean)
+def BuildStepGenerateNotice(pepperdir):
+ # Look for LICENSE files
+ license_filenames_re = re.compile('LICENSE|COPYING')
+
+ license_files = []
+ for root, _, files in os.walk(pepperdir):
+ for filename in files:
+ if license_filenames_re.match(filename):
+ path = os.path.join(root, filename)
+ license_files.append(path)
+ print '\n'.join(license_files)
+
+ notice_filename = os.path.join(pepperdir, 'NOTICE')
+ generate_notice.Generate(notice_filename, pepperdir, license_files)
+
+
def BuildStepTarBundle(pepper_ver, tarfile):
buildbot_common.BuildStep('Tar Pepper Bundle')
buildbot_common.MakeDir(os.path.dirname(tarfile))
@@ -963,6 +981,7 @@ def main(args):
# Ship with libraries prebuilt, so run that first.
BuildStepBuildLibraries(pepperdir, platform, 'src')
+ BuildStepGenerateNotice(pepperdir)
if not options.skip_tar:
BuildStepTarBundle(pepper_ver, tarfile)
« no previous file with comments | « native_client_sdk/src/NOTICE ('k') | native_client_sdk/src/build_tools/generate_notice.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698