-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRakefile
75 lines (60 loc) · 1.88 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "macadmin/common"
require "macadmin/version"
# Only build the extension for Mountian Lion or better
if MacAdmin::Common::MAC_OS_X_PRODUCT_VERSION > 10.7
require "rake/extensiontask"
Rake::ExtensionTask.new "crypto" do |ext|
ext.lib_dir = 'lib/macadmin/password'
ext.name = 'crypto'
ext.ext_dir = 'ext/macadmin/password'
end
Rake::Task[:spec].prerequisites << :compile
end
RSpec::Core::RakeTask.new
task :default => :spec
task :test => :spec
# macadmin tasks
namespace :macadmin do
desc "Publish the macadmin gem"
task :publish => [:fix_perms, :release]
desc "Fix permissions on Gem"
task :fix_perms do
require 'find'
Find.find(File.expand_path("./")) do |path|
FileUtils.chmod(0755, path) if FileTest.directory?(path)
FileUtils.chmod(0644, path) if FileTest.file?(path)
end
end
desc "Cleans out any elements of the gem build compile process"
task :clean do
require 'fileutils'
files = ["./lib/macadmin/password", "./tmp", "./pkg", "./vendor"]
files.each do |obj|
FileUtils.rm_rf(File.expand_path(obj))
end
end
# Version handling tasks
desc "Bump the patch version number"
task :bump_version_patch do
MacAdmin::VERSION.bump_patch
MacAdmin::VERSION.save
`git add ./version.yaml`
`git commit -m "bump patch version, #{MacAdmin::VERSION.to_s}"`
end
desc "Bump the minor version number"
task :bump_version_minor do
MacAdmin::VERSION.bump_minor
MacAdmin::VERSION.save
`git add ./version.yaml`
`git commit -m "bump minor version, #{MacAdmin::VERSION.to_s}"`
end
desc "Bump the major version number"
task :bump_version_major do
MacAdmin::VERSION.bump_major
MacAdmin::VERSION.save
`git add ./version.yaml`
`git commit -m "bump major version, #{MacAdmin::VERSION.to_s}"`
end
end