Don't rely on Git for generating the MANIFEST.
When using Git the resulting Gem will contain far too many useless files. For example, the profile/ and spec/ directories are not needed when building Gems.
This commit is contained in:
parent
579c0499ed
commit
59dae873e4
16
Rakefile
16
Rakefile
|
@ -8,17 +8,23 @@ GEMSPEC = Gem::Specification.load('oga.gemspec')
|
|||
LEXER_OUTPUT = 'lib/oga/xml/lexer.rb'
|
||||
PARSER_OUTPUT = 'lib/oga/xml/parser.rb'
|
||||
|
||||
GENERATED_FILES = [
|
||||
CLEAN.include(
|
||||
'coverage',
|
||||
'yardoc',
|
||||
LEXER_OUTPUT,
|
||||
PARSER_OUTPUT,
|
||||
'benchmark/fixtures/big.xml'
|
||||
]
|
||||
)
|
||||
|
||||
GENERATED_FILES.each do |file|
|
||||
CLEAN << file if File.exist?(file)
|
||||
end
|
||||
FILE_LIST = FileList.new(
|
||||
'checkum/**/*.*',
|
||||
'doc/**/*.*',
|
||||
'lib/**/*.*',
|
||||
'LICENSE',
|
||||
'MANIFEST',
|
||||
'*.gemspec',
|
||||
'README.md'
|
||||
)
|
||||
|
||||
Dir['./task/*.rake'].each do |task|
|
||||
import(task)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
desc 'Generates the MANIFEST file'
|
||||
task :manifest do
|
||||
generated = GENERATED_FILES.map { |path| File.expand_path(path) }
|
||||
files = (`git ls-files`.split("\n") | generated).sort
|
||||
files = FILE_LIST.to_a.sort
|
||||
handle = File.open(File.expand_path('../../MANIFEST', __FILE__), 'w')
|
||||
|
||||
handle.write(files.join("\n"))
|
||||
|
|
Loading…
Reference in New Issue