The main entry point: writes a .mk file for a single target. Arguments: qualified_target: target we're generating relative_target: qualified target name relative to the root base_path: path relative to source root we're building in, used to resolve
(
self,
qualified_target,
relative_target,
base_path,
output_filename,
spec,
configs,
part_of_all,
write_alias_target,
sdk_version,
)
| 110 | self.android_top_dir = android_top_dir |
| 111 | |
| 112 | def Write( |
| 113 | self, |
| 114 | qualified_target, |
| 115 | relative_target, |
| 116 | base_path, |
| 117 | output_filename, |
| 118 | spec, |
| 119 | configs, |
| 120 | part_of_all, |
| 121 | write_alias_target, |
| 122 | sdk_version, |
| 123 | ): |
| 124 | """The main entry point: writes a .mk file for a single target. |
| 125 | |
| 126 | Arguments: |
| 127 | qualified_target: target we're generating |
| 128 | relative_target: qualified target name relative to the root |
| 129 | base_path: path relative to source root we're building in, used to resolve |
| 130 | target-relative paths |
| 131 | output_filename: output .mk file name to write |
| 132 | spec, configs: gyp info |
| 133 | part_of_all: flag indicating this target is part of 'all' |
| 134 | write_alias_target: flag indicating whether to create short aliases for |
| 135 | this target |
| 136 | sdk_version: what to emit for LOCAL_SDK_VERSION in output |
| 137 | """ |
| 138 | gyp.common.EnsureDirExists(output_filename) |
| 139 | |
| 140 | self.fp = open(output_filename, "w") |
| 141 | |
| 142 | self.fp.write(header) |
| 143 | |
| 144 | self.qualified_target = qualified_target |
| 145 | self.relative_target = relative_target |
| 146 | self.path = base_path |
| 147 | self.target = spec["target_name"] |
| 148 | self.type = spec["type"] |
| 149 | self.toolset = spec["toolset"] |
| 150 | |
| 151 | deps, link_deps = self.ComputeDeps(spec) |
| 152 | |
| 153 | # Some of the generation below can add extra output, sources, or |
| 154 | # link dependencies. All of the out params of the functions that |
| 155 | # follow use names like extra_foo. |
| 156 | extra_outputs = [] |
| 157 | extra_sources = [] |
| 158 | |
| 159 | self.android_class = MODULE_CLASSES.get(self.type, "GYP") |
| 160 | self.android_module = self.ComputeAndroidModule(spec) |
| 161 | (self.android_stem, self.android_suffix) = self.ComputeOutputParts(spec) |
| 162 | self.output = self.output_binary = self.ComputeOutput(spec) |
| 163 | |
| 164 | # Standard header. |
| 165 | self.WriteLn("include $(CLEAR_VARS)\n") |
| 166 | |
| 167 | # Module class and name. |
| 168 | self.WriteLn("LOCAL_MODULE_CLASS := " + self.android_class) |
| 169 | self.WriteLn("LOCAL_MODULE := " + self.android_module) |
no test coverage detected