Skip to content

Commit

Permalink
chore: Drop 4th segment of version prefix (#3880)
Browse files Browse the repository at this point in the history
The `50303` part of the version string `4.0.0.50303` has been included
for historical reasons and doesn't serve any real purpose, and since the
Java DafnyRuntime package is published under regular `4.0.0` version
strings just creates inconsistencies.

I didn't find any documentation explicitly saying to add this part when
releasing aside from `Directory.Build.props`, so it seems adequate to
just drop it there (and I pre-emptively updated it to the next pending
version number, which has the nice side-effect of making our nightly
prereleases newer than the actual releases according to `nuget`, so the
`--prerelease` flag will work as intended!)
  • Loading branch information
robin-aws authored Apr 18, 2023
1 parent 3d8667a commit 1dd9d94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
18 changes: 5 additions & 13 deletions Scripts/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,28 +236,20 @@ def pack(args, releases):
def check_version_cs(args):
# Checking Directory.Build.props
with open(path.join(SOURCE_DIRECTORY, "Directory.Build.props")) as fp:
match = re.search(r'\<VersionPrefix\>([0-9]+.[0-9]+.[0-9]+).([0-9]+)', fp.read())
match = re.search(r'\<VersionPrefix\>([0-9]+.[0-9]+.[0-9]+)', fp.read())
if match:
(v1, v2) = match.groups()
source_version = match.groups()[0]
else:
flush("The AssemblyVersion attribute in Directory.Build.props could not be found.")
return False
now = time.localtime()
year = now[0]
month = now[1]
day = now[2]
v3 = str(year-2018) + str(month).zfill(2) + str(day).zfill(2)
if v2 != v3:
flush("The date in Directory.Build.props does not agree with today's date: " + v3 + " vs. " + v2)
if "-" in args.version:
hy = args.version[:args.version.index('-')]
else:
hy = args.version
if hy != v1:
flush("The version number in Directory.Build.props does not agree with the given version: " + hy + " vs. " + v1)
if (v2 != v3 or hy != v1):
if hy != source_version:
flush("The version number in Directory.Build.props does not agree with the given version: " + source_version + " vs. " + hy)
return False
flush("Creating release files for release \"" + args.version + "\" and internal version information: " + v1 + "." + v2)
flush("Creating release files for release \"" + args.version + "\" and internal version information: " + source_version)
return True

def parse_arguments():
Expand Down
2 changes: 1 addition & 1 deletion Source/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<VersionPrefix>4.0.0.50303<!--Version 4.0.0, year 2018+5, month 3, day 3.--></VersionPrefix>
<VersionPrefix>4.1.0</VersionPrefix>
<NoWarn>1701;1702;VSTHRD200</NoWarn>
</PropertyGroup>

Expand Down

0 comments on commit 1dd9d94

Please sign in to comment.