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

Side by Side Diff: build/config/mac/prepare_framework_version.py

Issue 2453933006: Revert of [Mac/GN] Fix rebuilds when changing framework_version of a mac_framework_bundle. (Closed)
Patch Set: Created 4 years, 1 month 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 | « .gn ('k') | build/config/mac/rules.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import os.path
6 import shutil
7 import sys
8
9 # Ensures that the current version matches the last-produced version, which is
10 # stored in the version_file. If it does not, then the framework_root_dir is
11 # obliterated.
12 # Usage: python prepare_framework_version.py out/obj/version_file \
13 # out/Framework.framework \
14 # 'A'
15
16 def PrepareFrameworkVersion(version_file, framework_root_dir, version):
17 try:
18 with open(version_file, 'r') as f:
19 current_version = f.read()
20 if current_version == version:
21 return
22 except IOError:
23 pass
24
25 if os.path.exists(framework_root_dir):
26 shutil.rmtree(framework_root_dir)
27
28 f = open(version_file, 'w+')
29 f.write(version)
30 f.close()
31
32
33 if __name__ == '__main__':
34 PrepareFrameworkVersion(sys.argv[1], sys.argv[2], sys.argv[3])
OLDNEW
« no previous file with comments | « .gn ('k') | build/config/mac/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698