Christopher Wiley | a590de8 | 2015-09-15 15:46:28 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015, The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Christopher Wiley | a590de8 | 2015-09-15 15:46:28 -0700 | [diff] [blame] | 17 | #include "aidl.h" |
Christopher Wiley | 4a2884b | 2015-10-07 11:27:45 -0700 | [diff] [blame] | 18 | #include "io_delegate.h" |
Christopher Wiley | a590de8 | 2015-09-15 15:46:28 -0700 | [diff] [blame] | 19 | #include "logging.h" |
| 20 | #include "options.h" |
| 21 | |
Jiyong Park | 74595c1 | 2018-07-23 15:22:50 +0900 | [diff] [blame] | 22 | #include <iostream> |
| 23 | |
| 24 | using android::aidl::Options; |
Christopher Wiley | a590de8 | 2015-09-15 15:46:28 -0700 | [diff] [blame] | 25 | |
Jiyong Park | 74595c1 | 2018-07-23 15:22:50 +0900 | [diff] [blame] | 26 | int main(int argc, char* argv[]) { |
Christopher Wiley | a590de8 | 2015-09-15 15:46:28 -0700 | [diff] [blame] | 27 | android::base::InitLogging(argv); |
| 28 | LOG(DEBUG) << "aidl starting"; |
| 29 | |
Jiyong Park | 74595c1 | 2018-07-23 15:22:50 +0900 | [diff] [blame] | 30 | Options options(argc, argv, Options::Language::CPP); |
| 31 | if (!options.Ok()) { |
| 32 | std::cerr << options.GetErrorMessage(); |
| 33 | std::cerr << options.GetUsage(); |
Christopher Wiley | a590de8 | 2015-09-15 15:46:28 -0700 | [diff] [blame] | 34 | return 1; |
| 35 | } |
| 36 | |
Christopher Wiley | 4a2884b | 2015-10-07 11:27:45 -0700 | [diff] [blame] | 37 | android::aidl::IoDelegate io_delegate; |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 38 | return android::aidl::compile_aidl(options, io_delegate); |
Christopher Wiley | a590de8 | 2015-09-15 15:46:28 -0700 | [diff] [blame] | 39 | } |