This repository was archived by the owner on Aug 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRakefile
More file actions
59 lines (47 loc) · 1.5 KB
/
Rakefile
File metadata and controls
59 lines (47 loc) · 1.5 KB
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
require 'rake'
module DocumentrHelper
ROOT_DIR = File.expand_path(File.dirname(__FILE__))
SRC_DIR = File.join(ROOT_DIR, 'src')
DIST_DIR = File.join(ROOT_DIR, 'dist')
DOCS_DIR = File.join(ROOT_DIR, 'docs')
DOCS_OUTPUT_DIR = File.join(SRC_DIR, 'docs')
BUILD_DIR = File.join(ROOT_DIR, 'build/Documentr')
def self.package
puts "\n>>> BUILDING PEAR PACKAGE <<<"
system "php package_builder.php"
system "cd #{DIST_DIR} && pear package #{SRC_DIR}/package.xml"
end
def self.docs
puts "\n>>> GENERATING DOCUMENTATION <<<"
system "cd #{DOCS_DIR} && documentr"
end
def self.tarball
puts "\n>>> GENERATING STANDALONE TARBALL <<<"
`mkdir -p #{BUILD_DIR}`
`rm -rf #{ROOT_DIR}/buid/*`
`cp -rf #{SRC_DIR} #{BUILD_DIR}`
`rm -f #{BUILD_DIR}/src/package.xml`
`cp -rf #{ROOT_DIR}/sample #{BUILD_DIR}`
`rm -f #{BUILD_DIR}/sample/output/`
system("export COPYFILE_DISABLE=true && cd #{ROOT_DIR}/build && tar -zcvf Documentr.tar.gz .")
`cp #{ROOT_DIR}/build/Documentr.tar.gz #{DIST_DIR}`
`rm -rf #{ROOT_DIR}/build`
end
end
namespace :build do
desc "Builds the Pear Package"
task :package do
DocumentrHelper.package
end
desc "Builds Standalone Tarball"
task :tarball do
DocumentrHelper.tarball
end
desc "Generate Documentation"
task :docs do
DocumentrHelper.docs
end
end
desc "Builds Documentr"
task :build => ['build:docs', 'build:package', 'build:tarball']
task :default => :build