-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-gem
executable file
·64 lines (50 loc) · 1.68 KB
/
build-gem
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
set -ex
if [ $GIMME_PLATFORM = "+macosx+x86_64" ]; then
export GEM_PLATFORM=x86_64-darwin-15
elif [ $GIMME_PLATFORM = "+linux+x86_64" ]; then
export GEM_PLATFORM=x86_64-linux
else
echo "Unknown platform: $GIMME_PLATFORM" >&2
exit 1
fi
GEM_NAME=qa-tool
export GEM_VERSION=$(cat VERSION)
export GEM_DATE=$(ruby -e "puts Time.at(ARGV[0].to_i).strftime('%F')" $(git log -n 1 --format=%ct))
cd $GIMME_SCRATCH
mkdir bin libexec
cp $(gimme-target-output-dir qa:qa)/bin/qa libexec/
chmod -R a+r libexec
cat > bin/qa <<EOF
#!/usr/bin/env ruby
exec(File.expand_path('../../libexec/qa', __FILE__), *ARGV)
EOF
chmod +x,a+r bin/qa
cat > $GEM_NAME.gemspec <<EOF
Gem::Specification.new do |s|
s.name = '$GEM_NAME'
s.version = "$GEM_VERSION"
s.date = "$GEM_DATE"
s.summary = <<-EOF
Qa is a test runner that runs your existing tests quickly and
intelligently. It does this using parallelism, dependency
analysis, and file watching.
Qa works with your existing rspec, minitest, or test-unit tests.
EOF
s.description = "A lightweight tool for running your tests fast."
s.authors = ["Adam Bouhenguel"]
s.email = '[email protected]'
s.platform = "$GEM_PLATFORM"
s.executables << "qa"
s.files = ["libexec/qa"]
s.homepage = 'https://github.com/ajbouh/qa'
s.license = 'MIT'
s.required_ruby_version = '>= 2.1.0'
s.add_runtime_dependency 'binding_of_caller', '~> 0.7'
s.add_runtime_dependency 'pry', '~> 0.10'
s.add_runtime_dependency 'pry-remote', '~> 0.1'
s.add_runtime_dependency 'pry-stack_explorer', '~> 0.4'
s.add_runtime_dependency 'pry-theme', '~> 1.1'
end
EOF
gem build $GEM_NAME.gemspec
mv ${GEM_NAME}*.gem $GIMME_OUTPUT/