Replace Rakefile with Makefile

This commit is contained in:
Glenn Y. Rolland 2021-01-02 16:23:32 +01:00
parent 6b4155dab1
commit 276cc9932d
2 changed files with 22 additions and 28 deletions

22
Makefile Normal file
View file

@ -0,0 +1,22 @@
PROGNAME=noozoid
BUILD_DIR=_build
all: help
build: # ## build binary
mkdir -p $(BUILD_DIR)
crystal build -o $(BUILD_DIR)/$(PROGNAME) src/main.cr
help: ## print this help
@echo "Usage: make <target>"
@echo ""
@echo "With one of following targets:"
@echo ""
@awk 'BEGIN {FS = ":.*?## "} \
/^[a-zA-Z_-]+:.*?## / \
{ sub("\\\\n",sprintf("\n%22c"," "), $$2); \
printf("\033[36m%-20s\033[0m %s\n", $$1, $$2); \
}' $(MAKEFILE_LIST)
@echo ""

View file

@ -1,28 +0,0 @@
require "bundler/gem_tasks"
require "rake/testtask"
require 'rubocop/rake_task'
# Add additional test suite definitions to the default test task here
namespace :spec do
desc 'Runs RuboCop on specified directories'
RuboCop::RakeTask.new(:rubocop) do |task|
# Dirs: app, lib, test
task.patterns = ['exe/**/*.rb', 'lib/**/*.rb', 'spec/**/*_spec.rb']
# Make it easier to disable cops.
task.options << "--display-cop-names"
# Abort on failures (fix your code first)
task.fail_on_error = true
end
end
Rake::TestTask.new(:spec) do |t|
t.libs << "spec"
t.libs << "lib"
t.test_files = FileList['spec/**/*_spec.rb']
end
Rake::Task[:spec].enhance ['spec:rubocop']
task :default => :spec