diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2025-02-04 17:12:25 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2025-11-04 05:53:37 +0000 |
| commit | 447809658afa851b6523397103c2fce74c4d5562 (patch) | |
| tree | 0606903971ec6b1e28c0f07e1c56f7d33509978c | |
| parent | 0eac75df46bd702dfadb730306dcad5e6b72c55e (diff) | |
[ruby/io-wait] Select packging files by pathspecs
https://github.com/ruby/io-wait/commit/c66a90f5b1
| -rw-r--r-- | ext/io/wait/io-wait.gemspec | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/ext/io/wait/io-wait.gemspec b/ext/io/wait/io-wait.gemspec index 1554dcdb30..44e6b65142 100644 --- a/ext/io/wait/io-wait.gemspec +++ b/ext/io/wait/io-wait.gemspec @@ -15,20 +15,20 @@ Gem::Specification.new do |spec| spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = spec.homepage - spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do - `git ls-files -z`.split("\x0").reject do |f| - File.identical?(f, __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features|rakelib)/|\.(?:git|travis|circleci)|appveyor|Rakefile)}) - end - end + jruby = true if Gem::Platform.new('java') =~ spec.platform or RUBY_ENGINE == 'jruby' + dir, gemspec = File.split(__FILE__) + excludes = [ + *%w[:^/.git* :^/Gemfile* :^/Rakefile* :^/bin/ :^/test/ :^/rakelib/ :^*.java], + *(jruby ? %w[:^/ext/io] : %w[:^/ext/java]), + ":(exclude,literal,top)#{gemspec}" + ] + files = IO.popen(%w[git ls-files -z --] + excludes, chdir: dir, &:read).split("\x0") + + spec.files = files spec.bindir = "exe" spec.executables = [] spec.require_paths = ["lib"] - jruby = true if Gem::Platform.new('java') =~ spec.platform or RUBY_ENGINE == 'jruby' - spec.files.delete_if do |f| - f.end_with?(".java") or - f.start_with?("ext/") && (jruby ^ f.start_with?("ext/java/")) - end if jruby spec.platform = 'java' spec.files << "lib/io/wait.jar" |
