Skip to content

Commit

Permalink
refactor: organize commands to a separate directory
Browse files Browse the repository at this point in the history
Housekeeping.
  • Loading branch information
asartalo committed Mar 15, 2024
1 parent 3acf79b commit dcb67c1
Show file tree
Hide file tree
Showing 18 changed files with 60 additions and 59 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'package:conventional/conventional.dart';
import 'package:pub_semver/pub_semver.dart';

import 'git_exec.dart';
import 'help_footer.dart';
import 'printer.dart';
import 'project.dart';
import '../git_exec.dart';
import '../help_footer.dart';
import '../printer.dart';
import '../project.dart';
import '../version_helpers.dart';
import 'release_tools_command.dart';
import 'version_helpers.dart';

class ChangelogCommand extends ReleaseToolsCommand with GitCommand {
final Project project;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'help_footer.dart';
import 'printer.dart';
import 'project.dart';
import '../help_footer.dart';
import '../printer.dart';
import '../project.dart';
import 'release_tools_command.dart';

class CurrentVersionCommand extends ReleaseToolsCommand with VersionCommand {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'package:conventional/conventional.dart';
import 'package:pub_semver/pub_semver.dart';

import 'git_exec.dart';
import 'help_footer.dart';
import 'printer.dart';
import 'project.dart';
import '../git_exec.dart';
import '../help_footer.dart';
import '../printer.dart';
import '../project.dart';
import '../version_helpers.dart';
import 'release_tools_command.dart';
import 'version_helpers.dart';

class NextVersionCommand extends ReleaseToolsCommand
with GitCommand, VersionCommand {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import 'package:conventional/conventional.dart';

import '../printer.dart';
import '../version_helpers.dart';
import 'changelog_command.dart';
import 'next_version_command.dart';
import 'printer.dart';
import 'release_tools_command.dart';
import 'remote_tag_id_command.dart';
import 'update_version_command.dart';
import 'update_year_command.dart';
import 'version_helpers.dart';

class PrepareReleaseCommand extends ReleaseToolsCommand {
@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import 'package:args/command_runner.dart';
import 'package:conventional/conventional.dart';
import 'package:yaml/yaml.dart';

import 'git_exec.dart';
import 'printer.dart';
import 'project.dart';
import '../git_exec.dart';
import '../printer.dart';
import '../project.dart';

abstract class ReleaseToolsCommand extends Command {
Printer get printer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'git_exec.dart';
import 'help_footer.dart';
import 'printer.dart';
import '../git_exec.dart';
import '../help_footer.dart';
import '../printer.dart';
import 'release_tools_command.dart';

class RemoteTagIdCommand extends ReleaseToolsCommand {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:conventional/conventional.dart';

import 'git_exec.dart';
import 'help_footer.dart';
import 'printer.dart';
import '../git_exec.dart';
import '../help_footer.dart';
import '../printer.dart';
import 'release_tools_command.dart';

class ShouldReleaseCommand extends ReleaseToolsCommand with GitCommand {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'package:args/args.dart';
import 'package:file/file.dart';
import 'package:yaml/yaml.dart';

import 'help_footer.dart';
import 'printer.dart';
import 'project.dart';
import '../help_footer.dart';
import '../printer.dart';
import '../project.dart';
import 'release_tools_command.dart';

// Taken from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:file/file.dart';

import 'help_footer.dart';
import 'printer.dart';
import 'project.dart';
import '../help_footer.dart';
import '../printer.dart';
import '../project.dart';
import 'release_tools_command.dart';

final _yearRegexp = RegExp(r'(\d{4,}(, |-))*(\d{4,})');
Expand Down
16 changes: 8 additions & 8 deletions lib/release_tools_runner.dart
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import 'package:args/command_runner.dart';
import 'package:file/file.dart';

import 'changelog_command.dart';
import 'current_version_command.dart';
import 'commands/changelog_command.dart';
import 'commands/current_version_command.dart';
import 'commands/next_version_command.dart';
import 'commands/prepare_release_command.dart';
import 'commands/remote_tag_id_command.dart';
import 'commands/should_release_command.dart';
import 'commands/update_version_command.dart';
import 'commands/update_year_command.dart';
import 'git_exec.dart';
import 'next_version_command.dart';
import 'prepare_release_command.dart';
import 'printer.dart';
import 'project.dart';
import 'release_tools_version.dart';
import 'remote_tag_id_command.dart';
import 'should_release_command.dart';
import 'update_version_command.dart';
import 'update_year_command.dart';

class ReleaseToolsRunner {
final GitExec git;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import 'package:conventional/conventional.dart';
import 'package:file/memory.dart';
import 'package:release_tools/changelog_command.dart';
import 'package:release_tools/commands/changelog_command.dart';
import 'package:release_tools/git_exec.dart';
import 'package:release_tools/printer.dart';
import 'package:release_tools/release_tools_runner.dart';
import 'package:test/test.dart';

import 'fixtures.dart';
import 'runner_setup.dart';
import '../fixtures.dart';
import '../runner_setup.dart';

void main() {
group(ChangelogCommand, () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:file/memory.dart';
import 'package:release_tools/current_version_command.dart';
import 'package:release_tools/commands/current_version_command.dart';
import 'package:release_tools/printer.dart';
import 'package:release_tools/release_tools_runner.dart';
import 'package:test/test.dart';

import 'runner_setup.dart';
import '../runner_setup.dart';

void main() {
group(CurrentVersionCommand, () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import 'package:conventional/conventional.dart';
import 'package:file/memory.dart';
import 'package:release_tools/commands/next_version_command.dart';
import 'package:release_tools/git_exec.dart';
import 'package:release_tools/next_version_command.dart';
import 'package:release_tools/printer.dart';
import 'package:release_tools/release_tools_runner.dart';
import 'package:test/test.dart';

import 'fixtures.dart';
import 'runner_setup.dart';
import '../fixtures.dart';
import '../runner_setup.dart';

void main() {
group(NextVersionCommand, () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:release_tools/commands/prepare_release_command.dart';
import 'package:release_tools/git_exec.dart';
import 'package:release_tools/prepare_release_command.dart';
import 'package:release_tools/printer.dart';
import 'package:release_tools/release_tools_runner.dart';
import 'package:test/test.dart';

import 'fixtures.dart';
import 'helpers.dart';
import 'runner_setup.dart';
import '../fixtures.dart';
import '../helpers.dart';
import '../runner_setup.dart';

void main() {
group(PrepareReleaseCommand, () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:release_tools/commands/remote_tag_id_command.dart';
import 'package:release_tools/git_exec.dart';
import 'package:release_tools/printer.dart';
import 'package:release_tools/release_tools_runner.dart';
import 'package:release_tools/remote_tag_id_command.dart';
import 'package:test/test.dart';

import 'runner_setup.dart';
import '../runner_setup.dart';

void main() {
group(RemoteTagIdCommand, () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'package:conventional/conventional.dart';
import 'package:release_tools/commands/should_release_command.dart';
import 'package:release_tools/git_exec.dart';
import 'package:release_tools/printer.dart';
import 'package:release_tools/release_tools_runner.dart';
import 'package:release_tools/should_release_command.dart';
import 'package:test/test.dart';

import 'fixtures.dart';
import 'runner_setup.dart';
import '../fixtures.dart';
import '../runner_setup.dart';

void main() {
group(ShouldReleaseCommand, () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:release_tools/commands/update_version_command.dart';
import 'package:release_tools/printer.dart';
import 'package:release_tools/release_tools_runner.dart';
import 'package:release_tools/update_version_command.dart';
import 'package:test/test.dart';
import 'runner_setup.dart';

import '../runner_setup.dart';

void main() {
group(UpdateVersionCommand, () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:release_tools/commands/update_year_command.dart';
import 'package:release_tools/printer.dart';
import 'package:release_tools/release_tools_runner.dart';
import 'package:release_tools/update_year_command.dart';
import 'package:test/test.dart';

import 'runner_setup.dart';
import '../runner_setup.dart';

void main() {
group(UpdateYearCommand, () {
Expand Down

0 comments on commit dcb67c1

Please sign in to comment.