1 #ifndef ANDROIDTOOLS_H_
2 #define ANDROIDTOOLS_H_
5 #include <msp/builder/toolchain.h>
6 #include <msp/fs/path.h>
16 /* Needs refactoring if API levels go over 63. At present rate this will
17 take decades to occur. */
18 uint64_t supported_api_levels = 0;
20 AndroidDevKit(Builder &, const std::string &, const Msp::FS::Path & = Msp::FS::Path());
24 const Msp::FS::Path &get_root_dir() const { return root; }
25 uint64_t get_supported_api_levels() const { return supported_api_levels; }
26 void select_api_level(unsigned);
28 virtual void init_api_level(unsigned) = 0;
31 class AndroidSdk: public AndroidDevKit
34 Msp::FS::Path build_tools_dir;
35 // TODO use a FileTarget for the jar
36 Msp::FS::Path platform_jar;
39 AndroidSdk(Builder &);
42 void find_build_tools_dir();
43 void init_api_level(unsigned) override;
46 const Msp::FS::Path &get_build_tools_dir() const { return build_tools_dir; }
47 const Msp::FS::Path &get_platform_jar() const { return platform_jar; }
50 class AndroidNdk: public AndroidDevKit
53 const Architecture &architecture;
54 Msp::FS::Path bin_dir;
55 Msp::FS::Path common_sysroot;
56 Msp::FS::Path platform_sysroot;
59 AndroidNdk(Builder &, const Architecture &, const AndroidSdk &);
61 static Msp::FS::Path create_default_path(const AndroidSdk &);
63 void find_toolchain_dir();
64 void init_api_level(unsigned) override;
67 const Msp::FS::Path &get_bin_dir() const { return bin_dir; }
68 const Msp::FS::Path &get_common_sysroot() const { return common_sysroot; }
69 const Msp::FS::Path &get_platform_sysroot() const { return platform_sysroot; }
73 class AndroidTools: public Toolchain
80 AndroidTools(Builder &, const Architecture &);
82 static int get_priority(const Architecture &);