Skip to content

Commit

Permalink
Version format quickfix
Browse files Browse the repository at this point in the history
  • Loading branch information
PlugFox committed Jun 30, 2023
1 parent 71a93f2 commit cb52d71
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 31 deletions.
Binary file modified .img/version.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 8 additions & 9 deletions README.md
Expand Up @@ -65,15 +65,14 @@ sealed class Pubspec {
build: <String>[],
);
static final DateTime timestamp = DateTime(
2023,
6,
30,
13,
12,
15,
487,
936,
static const PubspecVersion version = (
representation: r'4.0.0-pre.1',
canonical: r'4.0.0-pre.1',
major: 4,
minor: 0,
patch: 0,
preRelease: <String>[r'pre', r'1'],
build: <String>[],
);
static const String name = r'pubspec_generator';
Expand Down
27 changes: 14 additions & 13 deletions example/example.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lib/src/generator/typedef_generator_mixin.dart
Expand Up @@ -12,9 +12,9 @@ mixin TypedefGeneratorMixin on PubspecGenerator {
..writeln('typedef PubspecVersion = ({')
..writeln(' String representation,')
..writeln(' String canonical,')
..writeln(' String major,')
..writeln(' String minor,')
..writeln(' String patch,')
..writeln(' int major,')
..writeln(' int minor,')
..writeln(' int patch,')
..writeln(' List<String> preRelease,')
..writeln(' List<String> build')
..writeln('});');
Expand Down
13 changes: 7 additions & 6 deletions lib/src/generator/version_generator_mixin.dart
Expand Up @@ -27,14 +27,15 @@ mixin VersionGeneratorMixin on PubspecGenerator {
' // Canonicalized string representation of the version.\n'
' canonical: r\'${version.canonicalizedVersion}\',\n'
' // MAJOR version when you make incompatible API changes.\n'
' // The major version number: "1" in "1.2.3".\n'
' major: r\'${version.major}\',\n'
' // The major version number: 1 in "1.2.3".\n'
' major: ${version.major},\n'
' // MINOR version when you add functionality\n'
' // in a backward compatible manner.\n'
' // The minor version number: "2" in "1.2.3".\n'
' minor: r\'${version.minor}\',\n'
' // The patch version number: "3" in "1.2.3".\n'
' patch: r\'${version.patch}\',\n'
' // The minor version number: 2 in "1.2.3".\n'
' minor: ${version.minor},\n'
' // PATCH version when you make backward compatible bug fixes.\n'
' // The patch version number: 3 in "1.2.3".\n'
' patch: ${version.patch},\n'
' // The pre-release identifier: "foo" in "1.2.3-foo".\n'
' preRelease: <String>[${_preRelease(version.preRelease)}],\n'
' // The build identifier: "foo" in "1.2.3+foo".\n'
Expand Down

0 comments on commit cb52d71

Please sign in to comment.