diff --git a/CMakeLists.txt b/CMakeLists.txt index bf09539e960f..9c8a25b3d731 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,14 +39,19 @@ set(CHPL_MAJOR_VERSION 2) set(CHPL_MINOR_VERSION 3) set(CHPL_PATCH_VERSION 0) set(CHPL_BUILD_VERSION 0) + set(CHPL_PREV_MAJOR_VERSION 2) set(CHPL_PREV_MINOR_VERSION 2) set(CHPL_PREV_PATCH_VERSION 0) -set(CHPL_PREV_BUILD_VERSION 0) + +set(CHPL_NEXT_MAJOR_VERSION 2) +set(CHPL_NEXT_MINOR_VERSION 4) +set(CHPL_NEXT_PATCH_VERSION 0) + # Flip this to 'true' when we're ready to roll out a release; then back # after branching -set(CHPL_OFFICIAL_RELEASE true) +set(CHPL_OFFICIAL_RELEASE false) ### END config.h version value setting - configured_prefix set below ### @@ -414,6 +419,9 @@ add_custom_target(update-release-and-version-info ALL ${CHPL_PREV_MAJOR_VERSION} ${CHPL_PREV_MINOR_VERSION} ${CHPL_PREV_PATCH_VERSION} + ${CHPL_NEXT_MAJOR_VERSION} + ${CHPL_NEXT_MINOR_VERSION} + ${CHPL_NEXT_PATCH_VERSION} "--files" ${SRC_DIR}/doc/rst/conf.py ${SRC_DIR}/man/confchpl.rst diff --git a/util/config/update-release-and-version-info b/util/config/update-release-and-version-info index e73e5a21999a..dc5e3f2d3b88 100755 --- a/util/config/update-release-and-version-info +++ b/util/config/update-release-and-version-info @@ -2,7 +2,7 @@ import argparse # Represents a file or maybe a group of similar files that are updated the same way class FileUpdater: - def __init__(self, file_path, major_version, minor_version, patch_version, release, prev_major_version, prev_minor_version, prev_patch_version): + def __init__(self, file_path, major_version, minor_version, patch_version, release, prev_major_version, prev_minor_version, prev_patch_version, next_major_version, next_minor_version, next_patch_version): self.file_path = file_path self.major_version = major_version self.minor_version = minor_version @@ -10,6 +10,9 @@ class FileUpdater: self.prev_major_version = prev_major_version self.prev_minor_version = prev_minor_version self.prev_patch_version = prev_patch_version + self.next_major_version = next_major_version + self.next_minor_version = next_minor_version + self.next_patch_version = next_patch_version self.release = release # TODO: would be nice to have preformatted version strings in the base class @@ -157,10 +160,9 @@ class VersionButtonUpdater(FileUpdater): next_rel = 'var nextRelease = "{}.{}";' if self.release: for i, line in enumerate(lines): - # TODO: Store the next release in cmake too? This is a pretty naive way, just incrementing the minor version by 1. - if line.strip().startswith('var nextRelease = ') and not line.strip() == 'var nextRelease = "{}.{}"; // what\'s the next release? (on docs/main)'.format(self.major_version, self.minor_version + 1): + if line.strip().startswith('var nextRelease = ') and not line.strip() == 'var nextRelease = "{}.{}"; // what\'s the next release? (on docs/main)'.format(self.next_major_version, self.next_minor_version): any_changed = True - lines[i] = ' var nextRelease = "{}.{}"; // what\'s the next release? (on docs/main)\n'.format(self.major_version, self.minor_version + 1) + lines[i] = ' var nextRelease = "{}.{}"; // what\'s the next release? (on docs/main)\n'.format(self.next_major_version, self.next_minor_version) else: for i, line in enumerate(lines): if line.strip().startswith('var currentRelease = ') and not line.strip() == 'var currentRelease = "{}.{}"; // what does the public have?'.format(self.prev_major_version, self.prev_minor_version): @@ -194,27 +196,30 @@ def main(): parser.add_argument('prev_major_version', type=int, help='The previous major version of Chapel') parser.add_argument('prev_minor_version', type=int, help='The previous minor version of Chapel') parser.add_argument('prev_patch_version', type=int, help='The previous patch version of Chapel') + parser.add_argument('next_major_version', type=int, help='The next major version of Chapel') + parser.add_argument('next_minor_version', type=int, help='The next minor version of Chapel') + parser.add_argument('next_patch_version', type=int, help='The next patch version of Chapel') parser.add_argument('--official-release', dest='release', action="store_true", help='Is this an official release?') args = parser.parse_args() for fpath in args.files: # Determine which updater to use based on the file name or other criteria if fpath.endswith('conf.py'): - updater = ConfPyUpdater(fpath, args.major_version, args.minor_version, args.patch_version, args.release, args.prev_major_version, args.prev_minor_version, args.prev_patch_version) + updater = ConfPyUpdater(fpath, args.major_version, args.minor_version, args.patch_version, args.release, args.prev_major_version, args.prev_minor_version, args.prev_patch_version, args.next_major_version, args.next_minor_version, args.next_patch_version) elif fpath.endswith('confchpl.rst') or fpath.endswith('confchpldoc.rst'): - updater = ManConfUpdater(fpath, args.major_version, args.minor_version, args.patch_version, args.release, args.prev_major_version, args.prev_minor_version, args.prev_patch_version) + updater = ManConfUpdater(fpath, args.major_version, args.minor_version, args.patch_version, args.release, args.prev_major_version, args.prev_minor_version, args.prev_patch_version, args.next_major_version, args.next_minor_version, args.next_patch_version) elif fpath.endswith('archivedSpecs.rst'): - updater = ArchivedSpecUpdater(fpath, args.major_version, args.minor_version, args.patch_version, args.release, args.prev_major_version, args.prev_minor_version, args.prev_patch_version) + updater = ArchivedSpecUpdater(fpath, args.major_version, args.minor_version, args.patch_version, args.release, args.prev_major_version, args.prev_minor_version, args.prev_patch_version, args.next_major_version, args.next_minor_version, args.next_patch_version) elif fpath.endswith('QUICKSTART.rst'): - updater = QuickStartUpdater(fpath, args.major_version, args.minor_version, args.patch_version, args.release, args.prev_major_version, args.prev_minor_version, args.prev_patch_version) + updater = QuickStartUpdater(fpath, args.major_version, args.minor_version, args.patch_version, args.release, args.prev_major_version, args.prev_minor_version, args.prev_patch_version, args.next_major_version, args.next_minor_version, args.next_patch_version) elif fpath.endswith('chplenv.rst'): - updater = ChplEnvUpdater(fpath, args.major_version, args.minor_version, args.patch_version, args.release, args.prev_major_version, args.prev_minor_version, args.prev_patch_version) + updater = ChplEnvUpdater(fpath, args.major_version, args.minor_version, args.patch_version, args.release, args.prev_major_version, args.prev_minor_version, args.prev_patch_version, args.next_major_version, args.next_minor_version, args.next_patch_version) elif fpath.endswith('versionhelp.sh') or fpath.endswith('versionhelp-chpldoc.sh'): - updater = VersionHelpUpdater(fpath, args.major_version, args.minor_version, args.patch_version, args.release, args.prev_major_version, args.prev_minor_version, args.prev_patch_version) + updater = VersionHelpUpdater(fpath, args.major_version, args.minor_version, args.patch_version, args.release, args.prev_major_version, args.prev_minor_version, args.prev_patch_version, args.next_major_version, args.next_minor_version, args.next_patch_version) elif fpath.endswith('versionButton.php'): - updater = VersionButtonUpdater(fpath, args.major_version, args.minor_version, args.patch_version, args.release, args.prev_major_version, args.prev_minor_version, args.prev_patch_version) + updater = VersionButtonUpdater(fpath, args.major_version, args.minor_version, args.patch_version, args.release, args.prev_major_version, args.prev_minor_version, args.prev_patch_version, args.next_major_version, args.next_minor_version, args.next_patch_version) elif fpath.endswith('version.goodstart'): - updater = GoodStartUpdater(fpath, args.major_version, args.minor_version, args.patch_version, args.release, args.prev_major_version, args.prev_minor_version, args.prev_patch_version) + updater = GoodStartUpdater(fpath, args.major_version, args.minor_version, args.patch_version, args.release, args.prev_major_version, args.prev_minor_version, args.prev_patch_version, args.next_major_version, args.next_minor_version, args.next_patch_version) else: raise ValueError("Unrecognized file name: {}".format(fpath))