History log of /system/tools/hidl/Coordinator.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c59326ec5bcae86051571a0824e39e01fc2c4053 21-Jun-2017 Steven Moreland <smoreland@google.com> Don't check hash while generating hash.

A common usecase of -Lhash is to add a new hash to
a current.txt file. However, doing so requires removing
old hashes which then must be re-added for correctness.

This is because hashes of released interfaces should never be
removed.

Here I've made it so that -Lhash will return a hash for
valid interfaces even if the hash fails. I've also added
this to hidl_hash_test.

Test: hidl_hash_test
Bug: 62858322
Change-Id: I840086ae59656c73c7109b20c142da27b47f80f8
/system/tools/hidl/Coordinator.h
b90d327e82303b3e7abaa5fca6a83e168598a162 26-May-2017 Steven Moreland <smoreland@google.com> hidl-gen: work as expected with various path args

Add root path to paths only if non-absolute

Test: all of these pass and provide expected results:
hidl-gen -Lhash -p ~/android/aosp/ android.hardware.nfc@1.0
hidl-gen -Lhash -p /usr/local/google/home/smoreland/android/aosp/ android.hardware.nfc@1.0
hidl-gen -Lhash -p /usr/local/google/home/smoreland/android \
-randroid.hidl:master/system/libhidl/transport \
-randroid.hardware:aosp/hardware/interfaces android.hardware.nfc@1.0
hidl-gen -Lhash android.hardware.nfc@1.0
hidl-gen -Lhash -randroid.hidl:/usr/local/google/home/smoreland/android/master/system/libhidl/transport \
-randroid.hardware:/usr/local/google/home/smoreland/android/master/hardware/interfaces \
android.hardware.nfc@1.0
hidl-gen -Lhash -randroid.hidl:system/libhidl/transport \
-randroid.hardware:/usr/local/google/home/smoreland/android/aosp/hardware/interfaces \
android.hardware.nfc@1.0
Fixes: 62106647

Change-Id: Ibfce35f68e6b2ac0eaecc08fed3c78701464f1d6
/system/tools/hidl/Coordinator.h
28b9b537a4941ac9e4ef2e25e64e3ffc4b833676 13-May-2017 Steven Moreland <smoreland@google.com> Prevent AST from modifying Coordinator.

With additional methods in Coordinator which are non-const, we
should prevent this from happening.

Test: manual
Change-Id: I067840164f847a59239e3c2f0e19a62a4575d704
/system/tools/hidl/Coordinator.h
a171b562af466a0418cadda0f4e7eb246083eb9a 13-May-2017 Steven Moreland <smoreland@google.com> Be explicit about out file formats.

There was no explicit format for output into the source tree directly.

Test: update-makefiles.sh
Change-Id: I471f32e6b294ccf213181da0b8a5986620d4e62b
/system/tools/hidl/Coordinator.h
25c8166fa1e40db71497bf9cbc67d313e5f808ed 12-May-2017 Steven Moreland <smoreland@google.com> Add reasonable package path defaults.

Test: `hidl-gen -Lhash android.hardware.tests.foo@1.0` from anywhere in the source tree
Change-Id: I70d9333f32f1b3dbe0d0ebcc4956f4ae547e1e51
/system/tools/hidl/Coordinator.h
f7fa068fe10f7ba5df8c4352686e906486ebec0f 12-May-2017 Steven Moreland <smoreland@google.com> hidl-gen: allow specifying root

Also, default root to $ANDROID_BUILD_TOP or pwd if that isn't defined.

Now hidl-gen can be run from anywhere, not just croot.

Test: manual
Change-Id: I8a8ef57612ff4235772fb0a24e543ffd8c7a78c1
Bugs: me
/system/tools/hidl/Coordinator.h
218625af26dea71d188361598c1f8c273716830e 19-Apr-2017 Steven Moreland <smoreland@google.com> Add check for hidl package root hash.

When compiling a module, say foo.bar.baz@1.0::IBaz, assume the package
root is foo.bar:some/dir/interfaces, then:
- look at the file some/dir/interfaces/current.txt
- read hash from file corresponding from foo.bar.baz@1.0::IBaz
- file supports same-line comments with '#'
- format of file is each line is blank or looks like:
"<sha-256 hash> <fqName>"
- if the file is misformed or the hal does not match a sha in that file,
then it is considered build breakage.

Test: build with and without changing frozen files
Bug: 34178341
Merged-In: Ieddbc796ea974ac7c2e8b95ca69009c31e0cfb60
Change-Id: Ieddbc796ea974ac7c2e8b95ca69009c31e0cfb60
/system/tools/hidl/Coordinator.h
f619fc7bef5a4af1c196e125d70293d4af85e396 08-Apr-2017 Yifan Hong <elsk@google.com> Do not enforce minor version uprev on imports.

For example, if A imports B and we run hidl-gen on A, we should
not check minor version uprev requirement on B; this is an overkill.
Eventually, hidl-gen needs to be run on B to generate the required
sources, then we can enforce the restrictions there.

This CL is needed because enforceRestrictionsOnPackage internally
calls parse, and the recursion should not go on forever. Stopping
at imports are a good base case for the recursion.

Test: pass
Test: hardware/interfaces/update-makefiles.sh
Test: ./system/tools/hidl/test/test.sh
Test: hidl-gen -o /tmp -Ljava -randroid.hardware:hardware/interfaces
-rtests:system/tools/hidl/test -randroid.hidl:system/libhidl/transport
android.hardware.usb@1.1::IUsbCallback

Bug: 36787547
Change-Id: Id4363a42d6ba8c9b747c7430c79348552cc8139d
Merged-In: Id4363a42d6ba8c9b747c7430c79348552cc8139d
/system/tools/hidl/Coordinator.h
78b38d1e36934a60b3abcd82d576b54ca254b323 13-Feb-2017 Yifan Hong <elsk@google.com> Revert "Revert "Enforce minor version uprevs.""

This reverts commit 976ae898472e03f31c56eb1df62c81842e0ccb90.

Test: mma

Change-Id: Ib2f0be2b4cbf809831500ac536453237523904ec
/system/tools/hidl/Coordinator.h
976ae898472e03f31c56eb1df62c81842e0ccb90 11-Feb-2017 Steven Moreland <smoreland@google.com> Revert "Enforce minor version uprevs."

This reverts commit 2d20ae0dabf690872bd73da480558072a6980998.

Change-Id: Id4a349c33838a1921a4da738b9fb1970f313ef26
/system/tools/hidl/Coordinator.h
2d20ae0dabf690872bd73da480558072a6980998 02-Feb-2017 Yifan Hong <elsk@google.com> Enforce minor version uprevs.

For any .hal file that will be parsed by hidl-gen
(imported directly or indirectly), the whole package
of that .hal file will be examined. A package
android.hardware.foo@2.2 must define an interface IFoo
so that @2.2::IFoo extends @2.1::IFoo, if the directory
hardware/interfaces/foo/2.1 exists.

Test: compiles (with the tests in hardware/interfaces/foo)
Test: run update-makefiles.sh

Bug: 28825532

Change-Id: Iacbf23e2f4f9999b55116f3d5b971348d1f3eb67
/system/tools/hidl/Coordinator.h
97288acdcff66df30cc443c65ddb815e8d0cfeaa 13-Dec-2016 Yifan Hong <elsk@google.com> Update package path for Java.

We used to put IFoo.java with package android.hardware.foo.V1_0
under android/hardware/foo/1.0; the last element is fixed to
V1_0.

Test: compiles
Test: hidl_test_java

Bug: 33554192
Change-Id: I6a6a7d6c0a4c95e7c0797643bc98bec5c12889ca
/system/tools/hidl/Coordinator.h
c89340422f53046bfe24ff3e529161f9194120f8 18-Nov-2016 Yifan Hong <elsk@google.com> Hidlize IBase; use IBase instead of IBinder.

* IBase is hidlized over hwbinder. GenericBinder
is removed and Interface with name
android.hidl.base@1.0::IBase is used instead.

* Removed AST::mImportedNamesForJava, because in Java,
we always refer to a type with the full name. We don't
import anything in the java file.

* IFoo.h now includes HidlSupport.h instead of
HidlTransportSupport.h

Test: hidl_test
Test: hidl_test_java

Fix: 32756130
Fix: 33273293

Change-Id: I435ad7c68dea028a16252148b6f5778e3610b7cd
/system/tools/hidl/Coordinator.h
aa1868371f36507ff8f6337ec0e6bb02b2620981 26-Sep-2016 Steven Moreland <smoreland@google.com> appendPackageInterfaces*ToVector*

Test: hidl_test, update-makefiles.sh
Change-Id: I7e85c45870a5fe48f861752a34ae3cd264b504eb
/system/tools/hidl/Coordinator.h
d537ab02e1707597d70665fd8c75ca1ec9f57326 12-Sep-2016 Steven Moreland <smoreland@google.com> Remove dependency on libutils.

As part of this, TypeDef has also been converted to a NamedType. This is
because originally, Scope contained just a KeyedVector<localname, idx> of
types which it contained, and an std::vector<type> which idx indexes into
(KeyedVector<localname, type> alone would have also worked). However, now
it contains a std::map<localname, idx> instead. Because of this, we have lost
the ability to iterate over the keys (localnames) in O(n). By converting
TypeDef to a NamedType, name => idx => type such that name == type->name.
This also means that in function hierarchy calling Scope::addType, we no
longer have to pass around the tuple (name, type) since type->name == name,
and we can pass around only type.

Change-Id: I8f85afe0e389979a2fd98ff5eeccf47e3fcc8307
/system/tools/hidl/Coordinator.h
1aec397b1fdea7db4120dbe55b6995bb2a9d9138 26-Aug-2016 Andreas Huber <andih@google.com> Adds (C)opyright headers everywhere.

Change-Id: I453af702f80aa4159ef6c3d29d9514b4897adc0a
/system/tools/hidl/Coordinator.h
39fa71827738f6c1340e4523946fe9bf704eef3a 19-Aug-2016 Andreas Huber <andih@google.com> Improved name lookup in order to allow partial names to refer to external

(imported) packages.

Bug: 30977424
Change-Id: I0a3757d6c3b10229627e2c1d6bc6176f88e13151
/system/tools/hidl/Coordinator.h
5bb14024064a51a044e51c14466e5b2ae8352505 10-Aug-2016 Iliyan Malchev <malchev@google.com> hidl-gen: multiple changes

1. Break up generateMakefileOrSourcesForPackage() into separate
functions for generating C++ and Android.mk files.

2. Add new command-line switch (-L) followed by a string to identify the
code generator. Supported code generators are -Lc++ and -Lmakefile,
like so:

hidl-gen -Lc++ \
-randroid.hardware:hardware/interfaces \
android.hardware.nfc@1.0

3. Remove the -m switch

4. Restore the ability to generate code for individual interfaces within
a package, as well as for entire packages. The following are valid
invokations of hidl-gen:

hidl-gen -o/tmp -Lc++ \
-randroid.hardware:hardware/interfaces \
android.hardware.nfc@1.0

hidl-gen -o /tmp -Lc++ \
-randroid.hardware:hardware/interfaces \
android.hardware.nfc@1.0::INfc

The first invokation will generate the following files under
/tmp/android/hardware/nfc/1.0:

/tmp/android/hardware/nfc/1.0/INfc.h
/tmp/android/hardware/nfc/1.0/BnNfc.h
/tmp/android/hardware/nfc/1.0/NfcAll.cpp
/tmp/android/hardware/nfc/1.0/BpNfc.h

The second invokation will result in:

/tmp/android/hardware/nfc/1.0/types.cpp
/tmp/android/hardware/nfc/1.0/INfc.h
/tmp/android/hardware/nfc/1.0/BnNfc.h
/tmp/android/hardware/nfc/1.0/NfcClientCallbackAll.cpp
/tmp/android/hardware/nfc/1.0/NfcAll.cpp
/tmp/android/hardware/nfc/1.0/BpNfcClientCallback.h
/tmp/android/hardware/nfc/1.0/BpNfc.h
/tmp/android/hardware/nfc/1.0/types.h
/tmp/android/hardware/nfc/1.0/BnNfcClientCallback.h
/tmp/android/hardware/nfc/1.0/INfcClientCallback.h

5. Fixed Android.mk generation to build every .hal file once. To make,
a HIDL interface I${name}.hal now maps to the target ${name}All.cpp

Change-Id: I83f76cbc847536bec03520bcaa39d8f449da67f2
Signed-off-by: Iliyan Malchev <malchev@google.com>
/system/tools/hidl/Coordinator.h
d2943e11533697b97aa5330f05fc144493748c0b 05-Aug-2016 Andreas Huber <andih@google.com> extends nuhidl-gen to optionally generate an Android.mk makefile that

produces a shared-library module exporting the necessary header, stub and
proxy code for the packages specified.
/system/tools/hidl/Coordinator.h
dca261ff8a8fed807c6e8206360eb84b1ff9e0a9 04-Aug-2016 Andreas Huber <andih@google.com> Remove hardcoded package paths and prefixes

No longer assume that a package prefix is "android.hardware" and that
the directory mapping to that package prefix is "$TOP/hardware/interfaces".
Instead, provide this informatoin via a command-line option (-r) as follows:

hidl-gen -o /tmp \
-r android.hardware:hardware/interfaces \
android.hardware.nfc@1.0::INfc

Multiple -r options can be provided, for example:

hidl-gen -o /tmp \
-r android.hardware:$TOP/hardware/interfaces \
-r vendor.qcom.hardware:vendor/qcom/interfaces \
android.hardware.nfc@1.0::INfc

The auto-generated files are emitted in the output path (-o option, /tmp
in the example above) and nested under a directory structure based on
the package root. Thus, for android.hardware.nfc@1.0::INfc, given -r
android.hardware:hardware/interfaces, we identify android.hardware as
the package root, which gets mapped to the path fragment
"android/hardware", causing auto-generated files to go under
/tmp/android/hardware/nfc/V1_0/

Signed-off-by: Iliyan Malchev <malchev@google.com>
/system/tools/hidl/Coordinator.h
fd4afabde8fb9bbdd0021addeb9fbb62428f2c17 03-Aug-2016 Andreas Huber <andih@google.com> RefType is no more, 1) simplify, 2) repeat
/system/tools/hidl/Coordinator.h
e61e3f7b138a992047a60c4b8c27f1c752ed57ba 03-Aug-2016 Andreas Huber <andih@google.com> Emit all necessary interface and type files.
/system/tools/hidl/Coordinator.h
0e00de41d11a83ce3becb0dbd20b799acceb19a7 03-Aug-2016 Andreas Huber <andih@google.com> Simplify overly long fully specified type names by stripping out the current

namespace prefix if possible. Properly include "types.h" for regular
(non-interface) types. Emit full names where appropriate.
/system/tools/hidl/Coordinator.h
881227d860c59471eee31d39946e96ce2daa35d6 02-Aug-2016 Andreas Huber <andih@google.com> generate C++ interface header, proxy and stub headers and sources.
/system/tools/hidl/Coordinator.h
dc981333b38f47f416b9b810dc80e5cf2d7ac68a 30-Jul-2016 Andreas Huber <andih@google.com> Use environment variable $TOP to determine full path to hardware/interfaces.
/system/tools/hidl/Coordinator.h
68f24590cda230fb92eac44ed0247f54f9b31ad0 29-Jul-2016 Andreas Huber <andih@google.com> better error-handling, importing entire packages. Cache now keyed by FQName
/system/tools/hidl/Coordinator.h
5345ec2b1b7e4126b77aa2131b231a9eb5ee811d 29-Jul-2016 Andreas Huber <andih@google.com> Recursively parse imported .hal files and perform global type lookup.
/system/tools/hidl/Coordinator.h