0
Commit Graph

6 Commits

Author SHA1 Message Date
Avi Drissman
7b017a99d8 Update copyright headers in docs/ and styleguide/
No-Try: true
Bug: 1098010
Change-Id: Id44652c3572c46c4ec732b69473fb951749d35eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3878321
Commit-Queue: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1043985}
2022-09-07 15:50:38 +00:00
Mike Frysinger
e69fa05666 drop "All rights reserved" from examples
OSS licensing has asked us to remove this from new file headers.

Change-Id: I89121dd167aa88617ce2090f8684148bbbac90ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3792556
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1031130}
2022-08-03 18:40:53 +00:00
Nate Fischer
ac07b26220 Android: add java_cpp_features GN rule
This adds the java_cpp_features GN rule to autogenerate Java String
constants representing C++ features. This refactors parts of
java_cpp_strings so java_cpp_features can share it.

This aims to address the most common syntaxes for declaring C++
features (string literal names, "brace" and "equals brace"
initialization, with & without the "base::" namespace).

Design: http://go/autogen-java-features
Bug: 1060097
Fixed: 1091031
Test: vpython build/android/gpy/java_cpp_strings_tests.py
Test: vpython build/android/gpy/java_cpp_features_tests.py
Test: tools/md_browser/md_browser.py docs/android_accessing_cpp_features_in_java.md
Change-Id: I5311f72f8837c122186148cf183f4219087df96a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2412840
Auto-Submit: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Peter Wen <wnwen@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812889}
2020-10-01 20:20:14 +00:00
Nate Fischer
eb70fb4aca Docs: add best practices for java_cpp_strings
No change to logic, only docs. This updates java_cpp_strings docs:

 * The first paragraph incorrectly stated this uses comments to
   determine the Java class name. This corrects that statement.
 * Merges the two GN steps into one, explains it's a best practice to
   add this to an android_library (or create a new one if there is
   none), and recommends private visibility for :java_switches_srcjar.

Test: Upload to gerrit > open file > click "gitiles"
Change-Id: I4ae45da15f7db02a9d4c101de1a23c40f154b464
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2369652
Commit-Queue: Bo <boliu@chromium.org>
Auto-Submit: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800838}
2020-08-22 15:25:55 +00:00
Nate Fischer
9320324617 Docs: fix documentation for java_cpp_strings
No change to logic, only docs.

This fixes several mistakes in the java_cpp_strings docs:
 * Do not need GENERATED_JAVA_PACKAGE
 * {NATIVE_STRINGS}, not {NATIVE_SWITCHES}
 * Do not need "This file is autogenerated..." boilerplate in the
   template
 * Consistent package name between template and generated file
 * Consistent class name between template and generated file
 * Change {YEAR} to $YEAR, as this must not be left templated, but
   should be filled in by the author

This also adds some more opinionated changes:
 * Mark the class as "public final" not "public abstract" and mark the
   constructor private, as this is a more robust way to mark the class
   as non-instantiable
 * Include the boilerplate "This following string constants..." [sic]
   message in the generated file, as that's what the script inserts.
 * Use more realistic file names (foo_switches.cc and FooSwitches.java).
 * Add javadoc for the template file, as a suggestion for others to
   document the generated class.

Bug: 1011991
Test: tools/md_browser/md_browser.py
Test: Upload to gerrit > open file > click "gitiles"
Change-Id: Ia1aa96cf50842bf226f35440fd2cafe8a186f8b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863866
Reviewed-by: Ian Vollick <vollick@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706456}
2019-10-16 15:31:58 +00:00
Ian Vollick
b99472e9d4 Share strings between native and Java
Creates a script that can be used to generate Java files to
expose native strings to Java, giving us a single source of
truth for these constants.

Bug: 937280
Change-Id: I1f0804bdfff8101dfd149612acd44360ae0dc2c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1495747
Commit-Queue: Ian Vollick <vollick@chromium.org>
Auto-Submit: Ian Vollick <vollick@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638754}
2019-03-07 21:35:26 +00:00