forked from sanyaade-mobiledev/chromium.src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Android aidl and support for gyp's java_in_dir
Adds the android_aidl template to support Android aidl. Adds a DEPRECATED_java_in_dir to android_library and android_apk. This will greatly ease the transition from gyp to gn. Adds BUILD.gn for third_party/eyesfree (using the two new features added). TBR=rsleevi BUG=359249 Review URL: https://codereview.chromium.org/512923002 Cr-Commit-Position: refs/heads/master@{#293386}
- Loading branch information
cjhopman
authored and
Commit bot
committed
Sep 5, 2014
1 parent
2e86410
commit dad5f42
Showing
9 changed files
with
213 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/env python | ||
# | ||
# Copyright 2014 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. | ||
|
||
"""Invokes Android's aidl | ||
""" | ||
|
||
import optparse | ||
import os | ||
import sys | ||
|
||
from util import build_utils | ||
|
||
|
||
def main(argv): | ||
option_parser = optparse.OptionParser() | ||
build_utils.AddDepfileOption(option_parser) | ||
option_parser.add_option('--aidl-path', help='Path to the aidl binary.') | ||
option_parser.add_option('--imports', help='Files to import.') | ||
option_parser.add_option('--includes', | ||
help='Directories to add as import search paths.') | ||
option_parser.add_option('--srcjar', help='Path for srcjar output.') | ||
options, args = option_parser.parse_args(argv[1:]) | ||
|
||
with build_utils.TempDir() as temp_dir: | ||
for f in args: | ||
classname = os.path.splitext(os.path.basename(f))[0] | ||
output = os.path.join(temp_dir, classname + '.java') | ||
aidl_cmd = [options.aidl_path] | ||
aidl_cmd += [ | ||
'-p' + s for s in build_utils.ParseGypList(options.imports) | ||
] | ||
if options.includes is not None: | ||
aidl_cmd += [ | ||
'-I' + s for s in build_utils.ParseGypList(options.includes) | ||
] | ||
aidl_cmd += [ | ||
f, | ||
output | ||
] | ||
build_utils.CheckOutput(aidl_cmd) | ||
|
||
build_utils.ZipDir(options.srcjar, temp_dir) | ||
|
||
if options.depfile: | ||
build_utils.WriteDepfile( | ||
options.depfile, | ||
build_utils.GetPythonDependencies()) | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main(sys.argv)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import("//build/config/android/config.gni") | ||
import("//build/config/android/rules.gni") | ||
|
||
android_aidl("common_aidl") { | ||
interface_file = "java/src/org/chromium/content/common/common.aidl" | ||
import_include = "java/src" | ||
sources = [ | ||
"java/src/org/chromium/content/common/IChildProcessCallback.aidl", | ||
"java/src/org/chromium/content/common/IChildProcessService.aidl", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import("//build/config/android/config.gni") | ||
import("//build/config/android/rules.gni") | ||
|
||
android_library("eyesfree_java") { | ||
srcjar_deps = [ ":eyesfree_aidl" ] | ||
DEPRECATED_java_in_dir = "src/android/java/src" | ||
} | ||
|
||
android_aidl("eyesfree_aidl") { | ||
import_include = "src/android/java/src" | ||
sources = [ | ||
"src/android/java/src/com/googlecode/eyesfree/braille/display/IBrailleService.aidl", | ||
"src/android/java/src/com/googlecode/eyesfree/braille/display/IBrailleServiceCallback.aidl", | ||
"src/android/java/src/com/googlecode/eyesfree/braille/selfbraille/ISelfBrailleService.aidl", | ||
"src/android/java/src/com/googlecode/eyesfree/braille/translate/ITranslatorService.aidl", | ||
"src/android/java/src/com/googlecode/eyesfree/braille/translate/ITranslatorServiceCallback.aidl", | ||
] | ||
} |