blob: 785912a6594dfcefbe0b30342b5eef5cb44e7428 [file] [log] [blame]
Joe Onorato0578cbc2016-10-19 17:03:06 -07001/*
2 * Copyright (C) 2016 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
17#ifndef MAKE_H
18#define MAKE_H
19
20#include <map>
21#include <string>
22#include <vector>
23
24using namespace std;
25
26struct Module
27{
28 string name;
29 vector<string> classes;
30 vector<string> paths;
31 vector<string> installed;
Joe Onorato6c97f492019-02-27 20:42:37 -050032
33 bool HasClass(const string& cl);
Joe Onorato0578cbc2016-10-19 17:03:06 -070034};
35
Joe Onorato0578cbc2016-10-19 17:03:06 -070036/**
Joe Onoratoce0bd062019-01-14 15:30:05 -080037 * Class to encapsulate getting build variables. Caches the
38 * results if possible.
Joe Onorato0578cbc2016-10-19 17:03:06 -070039 */
Joe Onoratoce0bd062019-01-14 15:30:05 -080040class BuildVars
41{
42public:
43 BuildVars(const string& outDir, const string& buildProduct,
44 const string& buildVariant, const string& buildType);
45 ~BuildVars();
46
47 string GetBuildVar(const string& name, bool quiet);
48
49private:
50 void save();
51
52 string m_filename;
53
54 map<string,string> m_cache;
55};
Joe Onorato0578cbc2016-10-19 17:03:06 -070056
57void read_modules(const string& buildOut, const string& buildDevice,
58 map<string,Module>* modules, bool quiet);
59
60int build_goals(const vector<string>& goals);
61
62#endif // MAKE_H