Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: third_party/ijar/ijar.cc

Issue 1894013002: 🐟 Make Android Lint use interface jars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ijar-update
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/ijar/README.chromium ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Bazel Authors. All rights reserved. 1 // Copyright 2015 The Bazel Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 u1* buf = reinterpret_cast<u1*>(malloc(size)); 77 u1* buf = reinterpret_cast<u1*>(malloc(size));
78 u1* classdata_out = buf; 78 u1* classdata_out = buf;
79 if (!StripClass(buf, data, size)) { 79 if (!StripClass(buf, data, size)) {
80 free(classdata_out); 80 free(classdata_out);
81 return; 81 return;
82 } 82 }
83 u1* q = builder->NewFile(filename, 0); 83 u1* q = builder->NewFile(filename, 0);
84 size_t out_length = buf - classdata_out; 84 size_t out_length = buf - classdata_out;
85 memcpy(q, classdata_out, out_length); 85 memcpy(q, classdata_out, out_length);
86 builder->FinishFile(out_length); 86 builder->FinishFile(out_length, false, true);
87 free(classdata_out); 87 free(classdata_out);
88 } 88 }
89 89
90 // Opens "file_in" (a .jar file) for reading, and writes an interface 90 // Opens "file_in" (a .jar file) for reading, and writes an interface
91 // .jar to "file_out". 91 // .jar to "file_out".
92 void OpenFilesAndProcessJar(const char *file_out, const char *file_in) { 92 void OpenFilesAndProcessJar(const char *file_out, const char *file_in) {
93 JarStripperProcessor processor; 93 JarStripperProcessor processor;
94 std::unique_ptr<ZipExtractor> in(ZipExtractor::Create(file_in, &processor)); 94 std::unique_ptr<ZipExtractor> in(ZipExtractor::Create(file_in, &processor));
95 if (in.get() == NULL) { 95 if (in.get() == NULL) {
96 fprintf(stderr, "Unable to open Zip file %s: %s\n", file_in, 96 fprintf(stderr, "Unable to open Zip file %s: %s\n", file_in,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 } 177 }
178 } 178 }
179 179
180 if (devtools_ijar::verbose) { 180 if (devtools_ijar::verbose) {
181 fprintf(stderr, "INFO: writing to '%s'.\n", filename_out); 181 fprintf(stderr, "INFO: writing to '%s'.\n", filename_out);
182 } 182 }
183 183
184 devtools_ijar::OpenFilesAndProcessJar(filename_out, filename_in); 184 devtools_ijar::OpenFilesAndProcessJar(filename_out, filename_in);
185 return 0; 185 return 0;
186 } 186 }
OLDNEW
« no previous file with comments | « third_party/ijar/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698