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

Side by Side Diff: build/android/gradle/generate_gradle.py

Issue 2724093003: Android: Add missing resources to android studio (Closed)
Patch Set: Moving third_party changes to separate CL. Created 3 years, 9 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 | « no previous file | build/android/gyp/write_build_config.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved. 2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Generates an Android Studio project from a GN target.""" 6 """Generates an Android Studio project from a GN target."""
7 7
8 import argparse 8 import argparse
9 import codecs 9 import codecs
10 import glob 10 import glob
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 _WriteFile(output_file, data) 290 _WriteFile(output_file, data)
291 291
292 return output_file 292 return output_file
293 293
294 def _Relativize(self, entry, paths): 294 def _Relativize(self, entry, paths):
295 return _RebasePath(paths, self.EntryOutputDir(entry)) 295 return _RebasePath(paths, self.EntryOutputDir(entry))
296 296
297 def _Srcjars(self, entry): 297 def _Srcjars(self, entry):
298 srcjars = _RebasePath(entry.Gradle().get('bundled_srcjars', [])) 298 srcjars = _RebasePath(entry.Gradle().get('bundled_srcjars', []))
299 if not self.use_gradle_process_resources: 299 if not self.use_gradle_process_resources:
300 srcjars += _RebasePath(entry.BuildConfig()['javac']['srcjars']) 300 srcjars += _RebasePath(entry.Javac()['srcjars'])
301 srcjars += _RebasePath(entry.Gradle().get('srcjars'))
301 return srcjars 302 return srcjars
302 303
303 def _GetEntries(self, entry): 304 def _GetEntries(self, entry):
304 if self.split_projects: 305 if self.split_projects:
305 return [entry] 306 return [entry]
306 return entry.AllEntries() 307 return entry.AllEntries()
307 308
308 def EntryOutputDir(self, entry): 309 def EntryOutputDir(self, entry):
309 return os.path.join(self.project_dir, entry.GradleSubdir()) 310 return os.path.join(self.project_dir, entry.GradleSubdir())
310 311
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 _ExtractZips(generator.project_dir, zip_tuples) 738 _ExtractZips(generator.project_dir, zip_tuples)
738 739
739 logging.warning('Project created! (%d subprojects)', len(project_entries)) 740 logging.warning('Project created! (%d subprojects)', len(project_entries))
740 logging.warning('Generated projects work best with Android Studio 2.2') 741 logging.warning('Generated projects work best with Android Studio 2.2')
741 logging.warning('For more tips: https://chromium.googlesource.com/chromium' 742 logging.warning('For more tips: https://chromium.googlesource.com/chromium'
742 '/src.git/+/master/docs/android_studio.md') 743 '/src.git/+/master/docs/android_studio.md')
743 744
744 745
745 if __name__ == '__main__': 746 if __name__ == '__main__':
746 main() 747 main()
OLDNEW
« no previous file with comments | « no previous file | build/android/gyp/write_build_config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698