pub_release library

Classes

CustomVersion
Used by the version menu to allow the user to select a custom version. When this classes version property is called it triggers
Git
MultiSettings
reads/writes to the pubrelease_multi.yaml file.
NewVersion
Used by version menu to provide a nice message for the user.
Package
PreReleaseVersion
Used by the version menu to allow the user to select a custom version. When this classes version property is called it triggers
PubSpecDetails
ReleaseRunner
Settings
SimpleGitHub
Version
A parsed semantic version number.

Functions

addAsset(SimpleGitHub ghr, Release release, {required String assetPath, String? mimeType}) → Future<void>
Uploads the file at assetPath to git hub against the given release. If mimeType is not supplied then the extension of the assetPath is used to determine the mimeType.
addExecutableAsset(SimpleGitHub ghr, Release release, String script, {String? assetName}) → Future<void>
@Throwing(ArgumentError) @Throwing(InvalidArgumentException) @Throwing(ReadException)
addExecutablesAsAssets(SimpleGitHub ghr, PubSpec pubspec, Release release) → Future<void>
@Throwing(ArgumentError) @Throwing(InvalidArgumentException) @Throwing(ReadException)
askForVersion(Version currentVersion) → Version
Ask the user to select the new version no. Pass in the current currentVersion number. @Throwing(ArgumentError) @Throwing(UnsupportedError)
backupVersionLibrary(String pathToPackageRoot) → void
Makes a backup copy of the version.g.dart source file. @Throwing(ArgumentError)
buildPre(Version currentVersion, String preType, int preVersion) → Version
@Throwing(ArgumentError)
confirmVersion(Version version) → Version
Ask the user to confirm the selected version no. @Throwing(ArgumentError) @Throwing(UnsupportedError)
createRelease({required String username, required String apiToken, required String owner, required String repository}) → Future<void>
@Throwing(ArgumentError) @Throwing(DuplicateKeyException) @Throwing(InvalidArgumentException) @Throwing(NotFoundException) @Throwing(PubReleaseException) @Throwing(PubSpecException) @Throwing(ReadException) @Throwing(VersionException)
defaultVersionToOffer(Version currentVersion, {bool includePre = false}) → List<NewVersion>
determineVersionToOffer(Version currentVersion) → List<NewVersion>
@Throwing(ArgumentError)
exeName(String exeName) → String
findPubSpec({String? startingDir}) → String?
Returns the path to the pubspec.yaml. startingDir is the directory we start searching from. We climb the path searching for the pubspec.yaml @Throwing(ArgumentError)
getHigestVersionNo(String pathToPrimaryPackage) → Version
In a multi-package release (where we have a multi settings file) This method will return the highest version no. used by any of the packages listed in the multi settings file. pathToPrimaryPackage so contain the path to the main package of the multi package project that contains the pub_release.multi.yaml file in its tool directory. In reallity it can be the path to any of the project roots. @Throwing(ArgumentError) @Throwing(PubReleaseException)
resolveExecutableAssets(PubSpec pubspec, {String? packageRoot}) → List<({String assetName, String scriptPath})>
Resolves all advertised executables before release mutation, compilation, or upload begins. Names and script mappings must be portable filename stems. Sources must be regular files whose canonical paths remain inside the package, including when bin or a source is linked. In-memory pubspecs use the current directory.
restoreVersionLibrary(String pathToPackageRoot) → void
Restores the version.g.dart source from a back made by an earlier call to backupVersionLibrary @Throwing(ArgumentError)
updateLatestTag({required SimpleGitHub sgh, required PubSpec pubspec}) → Future<void>
update latest.<platform> tag to point to this new tag. @Throwing(ArgumentError) @Throwing(InvalidArgumentException) @Throwing(ReadException)
updateVersion(Version newVersion, PubSpec pubspec, String pathToPubSpec) → void
Updates the pubspec.yaml and versiong.g.dart with the new version no. @Throwing(ArgumentError) @Throwing(CreateDirException) @Throwing(PubSpecException)
updateVersionFromDetails(Version newVersion, PubSpecDetails pubspecDetails) → void
Updates the pubspec.yaml and versiong.g.dart with the new version no. @Throwing(ArgumentError) @Throwing(CreateDirException) @Throwing(PubSpecException)
version({required String pubspecPath}) → Version?
Returns the version no. for the pubspec.yaml located at pubspecPath. Use findPubSpec to find the location.
versionLibraryPath(String pathToPackgeRoot) → String
@Throwing(ArgumentError)
versionPath(String pathToPackgeRoot) → String
@Throwing(ArgumentError)
whichEx(String exeName) → bool