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

Unified Diff: build/android/jar.py

Issue 13432002: Add input content checking to some build scripts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
Index: build/android/jar.py
diff --git a/build/android/jar.py b/build/android/jar.py
deleted file mode 100755
index 9120a7902054ef5dd06ef4b5dbd2f28cde801af5..0000000000000000000000000000000000000000
--- a/build/android/jar.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 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.
-
-import fnmatch
-import optparse
-import os
-import sys
-
-from pylib import build_utils
-
-
-def DoJar(options):
- class_files = build_utils.FindInDirectory(options.classes_dir, '*.class')
- for exclude in build_utils.ParseGypList(options.excluded_classes):
- class_files = filter(
- lambda f: not fnmatch.fnmatch(f, exclude), class_files)
-
- jar_path = os.path.abspath(options.jar_path)
-
- # The paths of the files in the jar will be the same as they are passed in to
- # the command. Because of this, the command should be run in
- # options.classes_dir so the .class file paths in the jar are correct.
- jar_cwd = options.classes_dir
- class_files = [os.path.relpath(f, jar_cwd) for f in class_files]
- jar_cmd = ['jar', 'cf0', jar_path] + class_files
- build_utils.CheckCallDie(jar_cmd, cwd=jar_cwd)
-
-
-def main(argv):
- parser = optparse.OptionParser()
- parser.add_option('--classes-dir', help='Directory containing .class files.')
- parser.add_option('--jar-path', help='Jar output path.')
- parser.add_option('--excluded-classes',
- help='List of .class file patterns to exclude from the jar.')
- parser.add_option('--stamp', help='Path to touch on success.')
-
- # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja.
- parser.add_option('--ignore', help='Ignored.')
-
- options, _ = parser.parse_args()
-
- DoJar(options)
-
- if options.stamp:
- build_utils.Touch(options.stamp)
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv))
-

Powered by Google App Engine
This is Rietveld 408576698