|
@@ -39,7 +39,7 @@ template_string = \
|
|
'''/*
|
|
'''/*
|
|
* Generated by saveVersion.py
|
|
* Generated by saveVersion.py
|
|
*/
|
|
*/
|
|
-%s(version="%s", revision="%s",
|
|
|
|
|
|
+%s(version="%s", revision="%s", branch="%s",
|
|
user="%s", date="%s", url="%s",
|
|
user="%s", date="%s", url="%s",
|
|
srcChecksum="%s")
|
|
srcChecksum="%s")
|
|
package %s;
|
|
package %s;
|
|
@@ -108,8 +108,8 @@ def main(argv=None):
|
|
branch = subprocessOutput(['git', 'branch'])
|
|
branch = subprocessOutput(['git', 'branch'])
|
|
|
|
|
|
filter_current_branch = re.compile(r'^\* (.*)$', re.MULTILINE)
|
|
filter_current_branch = re.compile(r'^\* (.*)$', re.MULTILINE)
|
|
- current_branch = filter_current_branch.search(branch).group(1).strip()
|
|
|
|
- url = "%s on branch %s" % (origin, current_branch)
|
|
|
|
|
|
+ branch = filter_current_branch.search(branch).group(1).strip()
|
|
|
|
+ url = "%s on branch %s" % (origin, branch)
|
|
else:
|
|
else:
|
|
svn_info = subprocessOutput(['svn', 'info'])
|
|
svn_info = subprocessOutput(['svn', 'info'])
|
|
filter_last_revision = re.compile(r'^Last Changed Rev: (.*)$', re.MULTILINE)
|
|
filter_last_revision = re.compile(r'^Last Changed Rev: (.*)$', re.MULTILINE)
|
|
@@ -118,6 +118,10 @@ def main(argv=None):
|
|
filter_url = re.compile(r'^URL: (.*)$', re.MULTILINE)
|
|
filter_url = re.compile(r'^URL: (.*)$', re.MULTILINE)
|
|
url = filter_url.search(svn_info).group(1).strip()
|
|
url = filter_url.search(svn_info).group(1).strip()
|
|
|
|
|
|
|
|
+ # Get canonical branch (branches/X, tags/X, or trunk)
|
|
|
|
+ filter_current_branch = re.compile(r'.*((branches/.*$)|(tags/.*$)|.*(trunk)$)')
|
|
|
|
+ branch = filter_current_branch.search(url).group(1).strip()
|
|
|
|
+
|
|
filter_java = re.compile(r'.+\.java$')
|
|
filter_java = re.compile(r'.+\.java$')
|
|
file_list = []
|
|
file_list = []
|
|
for root, dirs, files in os.walk(os.path.normpath(src_checksum_root_dir)):
|
|
for root, dirs, files in os.walk(os.path.normpath(src_checksum_root_dir)):
|
|
@@ -143,7 +147,7 @@ def main(argv=None):
|
|
|
|
|
|
target_file = os.path.join(target_dir, 'package-info.java')
|
|
target_file = os.path.join(target_dir, 'package-info.java')
|
|
fout = open(target_file, "w")
|
|
fout = open(target_file, "w")
|
|
- fout.write(template_string % (annotation, version, revision, user, date, url, srcChecksum, package))
|
|
|
|
|
|
+ fout.write(template_string % (annotation, version, revision, branch, user, date, url, srcChecksum, package))
|
|
fout.close()
|
|
fout.close()
|
|
|
|
|
|
print("Checksummed %s src/**.java files" % file_count)
|
|
print("Checksummed %s src/**.java files" % file_count)
|