Skip to content

Commit c2e3dba

Browse files
committed
Improve clean semantics
The difference between clean and clobber in rake is quite subtle and difficult for most users to grok. This change makes all created artifacts (regardless of whether are a scratch artifacts or deliverables) part of CLEAN. This means that a user will be able to run either `rake clean` or `rake clobber` and get the same effect. [#69170656]
1 parent ecd66d2 commit c2e3dba

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

Rakefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@ require 'rake/clean'
1818

1919
require 'rspec/core/rake_task'
2020
RSpec::Core::RakeTask.new
21-
CLOBBER << 'coverage'
21+
CLEAN.include 'coverage'
2222

2323
require 'rubocop/rake_task'
2424
Rubocop::RakeTask.new
2525

2626
require 'yard'
2727
YARD::Rake::YardocTask.new
28-
CLEAN << '.yardoc'
29-
CLOBBER << 'doc'
28+
CLEAN.include '.yardoc', 'doc'
3029

3130
desc 'Check that all APIs have been documented'
3231
task :check_api_doc do

rakelib/package_task.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ class PackageTask < Rake::TaskLib
2525
include Package
2626

2727
def initialize
28-
CLOBBER << BUILD_DIR
2928
directory BUILD_DIR
30-
31-
CLEAN << STAGING_DIR
3229
directory STAGING_DIR
3330

31+
CLEAN.include BUILD_DIR, STAGING_DIR
32+
3433
desc 'Create packaged buildpack'
3534
task package: [PACKAGE_NAME]
3635

0 commit comments

Comments
 (0)