Skip to content

Commit

Permalink
delete unneeded files
Browse files Browse the repository at this point in the history
  • Loading branch information
gjtorikian committed Mar 28, 2023
1 parent c42210e commit 43b6a02
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 675 deletions.
10 changes: 0 additions & 10 deletions .cross_rubies

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ actual.txt
test.txt
test/progit
test/benchinput.md

*.orig
102 changes: 0 additions & 102 deletions ext/selma/_util.rb

This file was deleted.

2 changes: 0 additions & 2 deletions ext/selma/extconf.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
require "mkmf"
require "rb_sys/mkmf"

require_relative "_util"

create_rust_makefile("selma/selma")
70 changes: 8 additions & 62 deletions rakelib/extension.rake
Original file line number Diff line number Diff line change
@@ -1,69 +1,15 @@
# frozen_string_literal: true

require "rake/extensiontask"
require "rb_sys/extensiontask"

require_relative "extension/cross_rubies"

Rake::ExtensionTask.new("selma", SELMA_SPEC) do |ext|
ext.source_pattern = "*.{rs,toml}"

ext.lib_dir = File.join("lib", "selma")

ext.cross_compile = true
ext.cross_platform = CROSS_PLATFORMS

ext.config_script = ENV["ALTERNATE_CONFIG_SCRIPT"] || "extconf.rb"

# remove things not needed for precompiled gems
ext.cross_compiling do |spec|
spec.files.reject! { |file| File.fnmatch?("*.tar.gz", file) }
spec.dependencies.reject! { |dep| dep.name == "rb-sys" }
end
RbSys::ExtensionTask.new("commonmarker", SELMA_SPEC) do |ext|
ext.lib_dir = File.join("lib", "commonmarker")
end

task :setup do # rubocop:disable Rake/Desc
require "rake_compiler_dock"
RakeCompilerDock.sh(<<~EOT, verbose: true)
gem update --system 3.3.22 &&
bundle
EOT
rescue => e
warn(e.message)
desc "Build native extension for a given platform (i.e. `rake 'native[x86_64-linux]'`)"
task :native, [:platform] do |_t, platform:|
sh "bundle", "exec", "rb-sys-dock", "--platform", platform, "--build"
end

namespace "gem" do
CROSS_RUBIES.find_all { |cr| cr.windows? || cr.linux? || cr.darwin? }.map(&:platform).uniq.each do |platform|
desc "build native gem for #{platform} platform"
task platform do
puts "Invoking RakeCompilerDock for #{platform} ..."
require "rake_compiler_dock"
RakeCompilerDock.sh(<<~EOT, verbose: true)
gem update --system 3.3.22 &&
bundle
EOT
rescue => e
warn(e.message)
end

namespace platform do
desc "build native gem for #{platform} platform (guest container)"
task "builder" do
puts "Invoking native:#{platform} ..."
# use Task#invoke because the pkg/*gem task is defined at runtime
Rake::Task["native:#{platform}"].invoke
puts "Invoking #{"pkg/#{SELMA_SPEC.full_name}-#{Gem::Platform.new(platform)}.gem"} ..."

Rake::Task["pkg/#{SELMA_SPEC.full_name}-#{Gem::Platform.new(platform)}.gem"].invoke
end
end
end

desc "build native gems for windows"
multitask "windows" => CROSS_RUBIES.find_all(&:windows?).map(&:platform).uniq

desc "build native gems for linux"
multitask "linux" => CROSS_RUBIES.find_all(&:linux?).map(&:platform).uniq

desc "build native gems for darwin"
multitask "darwin" => CROSS_RUBIES.find_all(&:darwin?).map(&:platform).uniq
end
desc "Compile and build native extension for a given platform (i.e. `rake 'native[x86_64-linux]'`)"
task build: :compile
134 changes: 0 additions & 134 deletions rakelib/extension/cross_rubies.rb

This file was deleted.

4 changes: 0 additions & 4 deletions rakelib/package.rake

This file was deleted.

24 changes: 0 additions & 24 deletions rakelib/set-version-to-timestamp.rake

This file was deleted.

2 changes: 1 addition & 1 deletion script/generate_changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

CHANGELOG_GITHUB_TOKEN="$GITHUB_TOKEN" bundle exec github_changelog_generator -u gjtorikian -p selma
bundle exec github_changelog_generator -u gjtorikian -p selma --token $GITHUB_TOKEN
Loading

0 comments on commit 43b6a02

Please sign in to comment.