| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 2 # Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE.md file. | 4 # BSD-style license that can be found in the LICENSE.md file. |
| 5 | 5 |
| 6 import os | 6 import os |
| 7 import sys | 7 import sys |
| 8 import utils | 8 import utils |
| 9 | 9 |
| 10 version_cc_template = """\ | 10 version_cc_template = """\ |
| 11 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 11 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
| 12 // for details. All rights reserved. Use of this source code is governed by a | 12 // for details. All rights reserved. Use of this source code is governed by a |
| 13 // BSD-style license that can be found in the LICENSE.md file. | 13 // BSD-style license that can be found in the LICENSE.md file. |
| 14 | 14 |
| 15 #include "src/shared/version.h" | 15 #include "src/shared/version.h" |
| 16 | 16 |
| 17 namespace fletch { | 17 namespace fletch { |
| 18 | 18 |
| 19 extern "C" | 19 extern "C" |
| 20 const char* GetVersion() { | 20 const char* GetVersion() { |
| 21 return "%(version)s"; | 21 return "%(version)s"; |
| 22 } | 22 } |
| 23 | 23 |
| 24 } // namespace fletch | 24 } // namespace fletch |
| 25 """; | 25 """; |
| 26 | 26 |
| 27 | 27 |
| 28 def Main(): | 28 def Main(): |
| 29 args = sys.argv[1:] | 29 args = sys.argv[1:] |
| 30 version_cc = args[2] | 30 version_cc = args[2] |
| 31 version = utils.GetSemanticSDKVersion() | 31 version = utils.GetSemanticSDKVersion() |
| 32 updated_content = version_cc_template % {"version": version} | 32 updated_content = version_cc_template % {"version": version} |
| 33 with open(version_cc, 'w') as f: | 33 with open(version_cc, 'w') as f: |
| 34 f.write(updated_content) | 34 f.write(updated_content) |
| 35 return 0 | 35 return 0 |
| 36 | 36 |
| 37 | 37 |
| 38 if __name__ == '__main__': | 38 if __name__ == '__main__': |
| 39 sys.exit(Main()) | 39 sys.exit(Main()) |
| OLD | NEW |