blob: 5cb778c68c182ad6cae2d9ea94ef7de2cf7c447b [file] [log] [blame]
Christopher Wileya590de82015-09-15 15:46:28 -07001/*
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 Wileya590de82015-09-15 15:46:28 -070017#include "aidl.h"
Christopher Wiley4a2884b2015-10-07 11:27:45 -070018#include "io_delegate.h"
Christopher Wileya590de82015-09-15 15:46:28 -070019#include "logging.h"
20#include "options.h"
21
Jiyong Park74595c12018-07-23 15:22:50 +090022#include <iostream>
23
24using android::aidl::Options;
Christopher Wileya590de82015-09-15 15:46:28 -070025
Jiyong Park74595c12018-07-23 15:22:50 +090026int main(int argc, char* argv[]) {
Christopher Wileya590de82015-09-15 15:46:28 -070027 android::base::InitLogging(argv);
28 LOG(DEBUG) << "aidl starting";
29
Jiyong Park74595c12018-07-23 15:22:50 +090030 Options options(argc, argv, Options::Language::CPP);
31 if (!options.Ok()) {
32 std::cerr << options.GetErrorMessage();
33 std::cerr << options.GetUsage();
Christopher Wileya590de82015-09-15 15:46:28 -070034 return 1;
35 }
36
Christopher Wiley4a2884b2015-10-07 11:27:45 -070037 android::aidl::IoDelegate io_delegate;
Jiyong Parkb034bf02018-07-30 17:44:33 +090038 return android::aidl::compile_aidl(options, io_delegate);
Christopher Wileya590de82015-09-15 15:46:28 -070039}