(to_file, fro_file, item)
| 2162 | |
| 2163 | |
| 2164 | def MakePathRelative(to_file, fro_file, item): |
| 2165 | # If item is a relative path, it's relative to the build file dict that it's |
| 2166 | # coming from. Fix it up to make it relative to the build file dict that |
| 2167 | # it's going into. |
| 2168 | # Exception: any |item| that begins with these special characters is |
| 2169 | # returned without modification. |
| 2170 | # / Used when a path is already absolute (shortcut optimization; |
| 2171 | # such paths would be returned as absolute anyway) |
| 2172 | # $ Used for build environment variables |
| 2173 | # - Used for some build environment flags (such as -lapr-1 in a |
| 2174 | # "libraries" section) |
| 2175 | # < Used for our own variable and command expansions (see ExpandVariables) |
| 2176 | # > Used for our own variable and command expansions (see ExpandVariables) |
| 2177 | # ^ Used for our own variable and command expansions (see ExpandVariables) |
| 2178 | # |
| 2179 | # "/' Used when a value is quoted. If these are present, then we |
| 2180 | # check the second character instead. |
| 2181 | # |
| 2182 | if to_file == fro_file or exception_re.match(item): |
| 2183 | return item |
| 2184 | else: |
| 2185 | # TODO(dglazkov) The backslash/forward-slash replacement at the end is a |
| 2186 | # temporary measure. This should really be addressed by keeping all paths |
| 2187 | # in POSIX until actual project generation. |
| 2188 | ret = os.path.normpath( |
| 2189 | os.path.join( |
| 2190 | gyp.common.RelativePath( |
| 2191 | os.path.dirname(fro_file), os.path.dirname(to_file) |
| 2192 | ), |
| 2193 | item, |
| 2194 | ) |
| 2195 | ).replace("\\", "/") |
| 2196 | if item.endswith("/"): |
| 2197 | ret += "/" |
| 2198 | return ret |
| 2199 | |
| 2200 | |
| 2201 | def MergeLists(to, fro, to_file, fro_file, is_paths=False, append=True): |
no test coverage detected