147 Commits

Author SHA1 Message Date
Christopher Wiley
3a86b41f84 Add a textual hint as to where aidl has gone
Bug: 23691099
Change-Id: I3fb917b4c0e66a83c6299add02869a7088010adc
2015-09-14 08:54:23 -07:00
Christopher Wiley
73ea1230fc Remove the aidl tool
This has been moved into its own repository at

//system/tools/aidl

Test: Built aosp_arm-eng from scratch.
Bug: 23691099

Change-Id: Ic45d55682b9dcafe894efe0a6317792f9c1236c6
2015-09-11 14:41:36 -07:00
Brian Carlstrom
de2ad45784 Merge "Revert "Grab macros from libbase instead of duplicating"" 2015-09-11 05:09:17 +00:00
Casey Dahlin
f3c2ed13d0 Revert "Grab macros from libbase instead of duplicating"
This reverts commit 2535cae005512494469fc5cea1fe630288ecb083.

Change-Id: I373844b6a0f429e88d6bcc1cdd5ac62325da55b3
2015-09-11 02:47:54 +00:00
Casey Dahlin
3e50f04dfa Revert change to win32 isatty stub
This is attempting to fix build breakage caused by redefining the isatty stub
for win32.

Change-Id: I5f854934cb9d2b2981f6349045e85d9ad737aa77
Signed-off-by: Casey Dahlin <sadmac@google.com>
2015-09-10 19:13:49 -07:00
Casey Dahlin
2535cae005 Grab macros from libbase instead of duplicating
Change-Id: I1802f60a4dac45ddee8cd5715a73c77e4371d7e8
Signed-off-by: Casey Dahlin <sadmac@google.com>
2015-09-10 18:43:04 -07:00
Casey Dahlin
96786829c2 Convert to C++ Bison output
We have to step up to a GLR parser to do this without exceptions (for no
reason other than Bison happens to use exceptions for the LALR(1) template and
not for the GLR one), but this should let us smooth out integration going
forward.

Change-Id: Iff44662914b4a65dfa5612d07c3a1ede07e6e4a9
Signed-off-by: Casey Dahlin <sadmac@google.com>
2015-09-10 18:29:09 -07:00
Casey Dahlin
9941dcc7aa First pass on reentrant C++-ish parser
We're flipping Flex/Bison in to reentrant mode, cutting down on global
variables, and exposing a more C++-like interface earlier. This is the first
phase. There's still a couple of weird hacks to deal with the previous code's
reckless disregard for scope sanity, but the outline of things to come is
starting to appear, and this CL really doesn't need to get any bigger.

Change-Id: Ife2d70db026d7ab1319bdf6c586959315666d0bb
Signed-off-by: Casey Dahlin <sadmac@google.com>
2015-09-10 16:55:18 -07:00
Dan Willemsen
8d6f9bf3c8 Whitelist windows module
Bug: 23566667
Change-Id: I030733ffd2b43a0ea74b0fd5f34a0d13ef8dcf7c
2015-09-04 14:22:17 -07:00
Christopher Wiley
b1db04f371 Merge "aidl: Add end to end test" 2015-09-02 21:10:30 +00:00
Christopher Wiley
b14e7b8429 Merge "aidl: Remove example test" 2015-09-02 21:10:09 +00:00
Casey Dahlin
d6b6b80cdb Delete outdated options tests
Bug: 23718807
Test: Re-ran make. Confirmed code was not linked.
Change-Id: If065b9287ed70b9e380281cae42f89bd5f1ffb06
Signed-off-by: Casey Dahlin <sadmac@google.com>
2015-09-02 13:34:26 -07:00
Casey Dahlin
ca4543cdba Remove RPC interface Type
AIDL previously supported "rpc" and "flatten" types, which are not used
anywhere in the Android tree. This patch removes them, which significantly cuts
down code and complexity.

Bug: 23517584
Test: Rebuilt AOSP tree against new version
Change-Id: I6cf38d43c1ce109ffca987cc14520945aa22431f
Signed-off-by: Casey Dahlin <sadmac@google.com>
2015-09-02 13:34:26 -07:00
Christopher Wiley
5ed76073a4 aidl: Add end to end test
This test sets up an artificial hierarchy of .aidl files, then
checks that the generated code contains a substring that we
know to be correct.  This isn't a very good unittest, but it does
validate that the whole flow works start to finish.

Bug: 23516947
Test: compiles, unit tests pass.

Change-Id: I931b7659731b05440040623e12596669604cef3a
2015-09-02 13:00:09 -07:00
Christopher Wiley
6d57207f37 aidl: Remove example test
We have enough tests demonstrating how to write them.

Bug: 23516947
Change-Id: I966cb6bb2d754db389be8f9b90957ac33cf66639
Test: Unittests pass.
2015-09-02 12:55:07 -07:00
Christopher Wiley
1ab54c12e3 aidl: Don't link librt on Mac
This fixes unittest build on Mac.

Change-Id: I5180f647d1b5b41f99c4d0423aaec9d05fee6355
2015-09-02 08:59:30 -07:00
Christopher Wiley
1006bfe09d aidl: Stop using Bionic's test main
This allows us to build unittests on Mac, where Bionic's test main
does not build.

Change-Id: I59c805d233498bb67575f2e5f7049341f70ce55c
2015-09-01 12:40:15 -07:00
Christopher Wiley
a25d35106e aidl: Separate aidl logic into its own static library
Compile aidl's logic into a static library that can be
linked against both the unittest binary and the executable. Validate
that this is working by writing a basic unittest against options
parsing.

Provide default values for Options struct members.  These were
previously taking on values according to the the bits in the memory
allocated to hold them for preprocessed inputs.

Bug: 23516947
Change-Id: Ib57cd7f473995f7851d788deac39f9c4d9018e8f
Test: compiles and unittests pass
2015-09-01 11:15:31 -07:00
Christopher Wiley
267cb88f4d Merge "Set up aidl for gtest" 2015-09-01 18:11:41 +00:00
Christopher Wiley
5b88363ed3 Tighten up compiler flags for aidl
Turn all warnings to errors, with special cases for places where
yacc forces us to be lenient.  Remove one variable with 0 references
elsewhere in the code.

These flags are confined to be clang only because the Windows SDK build
is using an older compiler that does not understand these flags.

Change-Id: I6407bd331c25b8845bde46e9a917bce1d6857bd8
2015-08-31 13:55:46 -07:00
Dan Willemsen
60dd5d5966 Merge "Remove USE_MINGW, whitelist windows modules" 2015-08-31 19:30:57 +00:00
Christopher Wiley
a73e004516 Merge "Revert "Tighten up compiler flags for aidl"" 2015-08-31 19:13:04 +00:00
Christopher Wiley
ecaf21c377 Revert "Tighten up compiler flags for aidl"
This reverts commit eea2353a3427f7d157c46e24ab6aba1378e16c2e.

This seems to have broken the build because whatever compiler the builder is using doesn't understand the same "turn off this warning" flags as my local host's compiler.

Change-Id: Ic68b7065b161a5ae683b7082c67147835833e0fa
2015-08-31 19:07:40 +00:00
Christopher Wiley
2f77417cce aidl: Pull main() into dedicated file
This separates the main() entry point from the functionality we're
hoping to test.  While here, redo the header guards to be consistent
accross the codebae.

Bug: 23516947
Change-Id: I61666126bdba0941f14bd0f031caaa30367b864a
Test: Compiles
2015-08-31 10:54:26 -07:00
Christopher Wiley
eea2353a34 Tighten up compiler flags for aidl
Turn all warnings to errors, with special cases for places where
yacc forces us to be lenient.  Remove one variable with 0 references
elsewhere in the code.

Change-Id: Ia7819795eb162e9c77d215088aee4c45bd87c1af
2015-08-30 11:01:31 -07:00
Casey Dahlin
8a8775c1db Set up aidl for gtest
Bug: 23516947

Change-Id: I1c004868525f462d04894a7b96c671b626061ab5
Signed-off-by: Casey Dahlin <sadmac@google.com>
2015-08-28 16:21:53 -07:00
Dan Willemsen
4aa679ff96 Remove USE_MINGW, whitelist windows modules
Bug: 23566667
Change-Id: Ie6b8c51e2b6d6273f99f4e361c440136d7c6915c
2015-08-28 15:28:26 -07:00
Christopher Wiley
1eaa9ed334 Do not merge namespaces
It is good practice to not include the whole std:: namespace into
the global namespace.  This is doubly true in headers.

TEST=aidl compiles

Change-Id: I910ca8082f61cce4f23f8564b8a12c2828b75b3c
2015-08-24 14:28:36 -07:00
Elliott Hughes
e17788ceff Replace HAVE_MS_C_RUNTIME with _WIN32 in frameworks/base/tools.
Change-Id: Ideef62acbf53a442167c9b8038021affffef9e8a
2015-08-17 12:41:46 -07:00
Elliott Hughes
9ec96f9756 Move frameworks/base/tools/ off AndroidConfig.h.
Change-Id: Ibc7abb67a56945a9618bc91ccdbebe4c806879a5
2015-07-29 14:35:18 -07:00
Elliott Hughes
98c11b511a Use _WIN32 rather than HAVE_WINDOWS_PATHS.
Change-Id: Ib1ae71dfbb20e3e5309ed737f48382cc42d2583f
2015-07-29 08:44:17 -07:00
Ying Wang
50fb02da53 Add phony source target in the generated dependency file of aidl.
This fixes make error when the source .aidl file is moved around but
its path relative to LOCAL_PATH doesn't change.

Bug: 22666539
Change-Id: Idf2492145e4927779d184932a09d61e4fe8ded0f
2015-07-22 17:49:56 -07:00
Yabin Cui
fb8e2b1745 kill OS_CASE_SENSITIVE
Bug: 18314594
Change-Id: Ib11b45d2597b2576bc7df2d0167ce1bbd1449523
2014-11-10 16:08:50 -08:00
Andrew Hsieh
c9d32390e5 include direct.h for _mkdir
Bug: 14416410

The new mingw-w64 toolchain x86_64-w64-mingw32-4.8 no longer
declares _mkdir in io.h.

Change-Id: I624b52d2f35db54a7f28df09f997fc883b0f0557
2014-09-30 02:28:05 -07:00
Ying Wang
0323098269 am 71364f8c: am f5f4d930: am 74bebf6f: Exclude the host aapt and aidl from PDK build.
* commit '71364f8c1e1bcc84375830dd5904dfe7cdfb5ed6':
  Exclude the host aapt and aidl from PDK build.
2014-03-08 05:46:48 +00:00
Ying Wang
f5f4d93060 am 74bebf6f: Exclude the host aapt and aidl from PDK build.
* commit '74bebf6faed2d34814ffc3d46664330ea568f7b2':
  Exclude the host aapt and aidl from PDK build.
2014-03-08 01:54:52 +00:00
Ying Wang
74bebf6fae Exclude the host aapt and aidl from PDK build.
Bug: 13028632
Change-Id: I0f774b19be77462d0fa271088a4a5a152729d13c
2014-03-07 15:56:14 -08:00
David 'Digit' Turner
fd2c77ca24 am 4bd720c2: am a05e7526: am 9c6f41e3: am be7b8f4f: Merge "aidl: Support building with updated host sysroot."
* commit '4bd720c2c63b2400437db971ac96616693a8fe3b':
  aidl: Support building with updated host sysroot.
2014-03-06 00:59:15 +00:00
David 'Digit' Turner
ea6d2197ba aidl: Support building with updated host sysroot.
This patch fixes tools/aidl/Type.cpp to compile with
a more recent SDK host toolchain sysroot (that has not
been submitted yet).

The main issue is that the code uses ssize_t which is
defined in <sys/types.h>, but didn't include the header
directly.

Apparently, this no longer compiles when using the Ubuntu
10.04 libc6-dev headers (the current SDK toolchain is
based on Ubuntu 8.04), so perform an explicit include
to fix this.

NOTE: This doesn't break the Windows SDK build.

Change-Id: Idcacf8f8d1c606b39bf8aa75ab409aa0c2a3cd5a
2014-03-05 23:57:46 +01:00
Elliott Hughes
b30296b5fd Re-apply several tools fixes lost by the directory rearrangement.
Leaks on error in tools/aapt/Images.cpp.
https://code.google.com/p/android/issues/detail?id=61552

Two missing fclose calls in tools/aapt/Resource.cpp.
https://code.google.com/p/android/issues/detail?id=61553

Missing fclose in tools/aidl/aidl.cpp.
https://code.google.com/p/android/issues/detail?id=61554

Change-Id: I56ce144958296961b77354815efc1a245564594b
2014-01-27 10:31:08 -08:00
Adam Lesinski
282e181b58 Revert "Move frameworks/base/tools/ to frameworks/tools/"
This reverts commit 9f6a119c8aa276432ece4fe2118bd8a3c9b1067e.
2014-01-27 10:31:04 -08:00
The Android Open Source Project
dbccd44a63 Merge commit 'b873a17ce7be0a9771c24999adca6964431728f6' into HEAD
Change-Id: I938755073e70602cc8f51ce9bd420fdcf870cecd
2013-11-22 11:18:57 -08:00
Elliott Hughes
ed84dea928 am 8f592378: am 69920427: Merge "Fix a variety of small publicly-reported bugs."
* commit '8f592378a1ea7f31d57253dc202f42707ef4da36':
  Fix a variety of small publicly-reported bugs.
2013-10-29 13:35:04 -07:00
Elliott Hughes
c367d48c55 Fix a variety of small publicly-reported bugs.
Possible NULL dereference in cmds/bootanimation/BootAnimation.cpp.
https://code.google.com/p/android/issues/detail?id=61556

Missing fclose in core/jni/android_os_Debug.cpp.
https://code.google.com/p/android/issues/detail?id=61546

Bad loop guards in core/jni/android_util_Process.cpp.
https://code.google.com/p/android/issues/detail?id=61557

Assignment to wrong variable in libs/androidfw/AssetManager.cpp.
https://code.google.com/p/android/issues/detail?id=61560

Missing delete[]s in libs/androidfw/ObbFile.cpp.
https://code.google.com/p/android/issues/detail?id=61549

Leaks on error in tools/aapt/Images.cpp.
https://code.google.com/p/android/issues/detail?id=61552

Two missing fclose calls in tools/aapt/Resource.cpp.
https://code.google.com/p/android/issues/detail?id=61553

Missing fclose in tools/aidl/aidl.cpp.
https://code.google.com/p/android/issues/detail?id=61554

Change-Id: I5820f3824e72d07a9acb776cf0af3e7443f5694a
2013-10-29 13:12:55 -07:00
Mike Lockwood
9f6a119c8a Move frameworks/base/tools/ to frameworks/tools/
Change-Id: I3ffafdab27cc4aca256c3a5806b630795b75d5c8
2013-08-28 09:44:17 -07:00
Ying Wang
0f91c63602 Better aidl generated dependency
Previously if an imported aidl file has been deleted or moved,
the generated dependency file still contains the stale file name,
and make will fail with "No rule to make target <the deleted/moved
file>".
This change uses technique described in section "Automatic Dependency
Generation", Chapter 8 of "Managing Projects with GNU Make (3d
Edition)".
The same technique is used by the Android platform build system to
generate C/C++ header dependencies.

Bug: 10459179
Change-Id: Ib0c01a4234ef1af994487fdc846cdf8d13a675f6
2013-08-23 17:19:17 -07:00
Laurent Tu
7c93839d7b Revert "Tentative fix for aidl import issue"
Fix build.

This reverts commit 4f115e08cb68aaf77693f3f4598f0eb5f7634777.

Change-Id: Ic4f51e3492f54afec5f0eeb48e08491eb47f3c04
2013-02-15 16:07:56 -08:00
Laurent Tu
4f115e08cb Tentative fix for aidl import issue
Fix issue when aidl generation doesn't use the right type when
it is a suffix of a pre-declared type.

eg. android.location.Location and foo.android.location.Location. The
aidl generation will never use foo.android.location.Location.

The tentative fix reverses the order in which Namespace.Search iterates
through the known types.

A better fix would be to annotate the types that are declared in the
aidl import statements to be prioritary in Namespace.Search. Lmk if I
you agree with this approach and think that this is worth the work.
Thanks!

Change-Id: I97dd1a1d417075accf1d61f9aba5aba3dea175c6
2013-02-14 16:12:54 -08:00
Kenny Root
7b172a49a9 am 58ed5d74: am 768d9e1a: Merge "Correct executable bit for source files"
* commit '58ed5d748c0b9b64845975ef5844ad313de7c3f6':
  Correct executable bit for source files
2012-11-07 13:08:25 -08:00
Kenny Root
58ed5d748c am 768d9e1a: Merge "Correct executable bit for source files"
* commit '768d9e1a72ceee7d4a5f608776b87b62d6ce4a04':
  Correct executable bit for source files
2012-11-07 11:52:12 -08:00