Skip to content

Commit 84dc906

Browse files
committed
got native.bundle copying to the lib dir
1 parent b07fa09 commit 84dc906

File tree

2 files changed

+16
-21
lines changed

2 files changed

+16
-21
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Rust
22
Cargo.lock
3+
/lib/case_transform/native.bundle
34
/target/
45

56
*.gem

Rakefile

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,24 @@ else
3535
end
3636
end
3737

38-
require 'rake/testtask'
39-
40-
Rake::TestTask.new(:test) do |t|
41-
t.libs << 'lib'
42-
t.libs << 'test'
43-
t.pattern = 'test/**/*_test.rb'
44-
t.ruby_opts = ['-r./test/test_helper.rb']
45-
t.ruby_opts << ' -w' unless ENV['NO_WARN'] == 'true'
46-
t.verbose = true
47-
end
48-
49-
task default: [:test, :rubocop]
5038

51-
desc 'CI test task'
52-
task ci: [:default]
5339

5440
directory 'target'
5541
directory 'lib/turbo_blank'
5642

5743
task :cargo_build do
5844
sh 'cargo build --release'
45+
sh 'gcc ' \
46+
'-Wl,-force_load,target/release/libcase_transform.a ' \
47+
'--shared -Wl,-undefined,dynamic_lookup -o lib/case_transform/native.bundle'
5948
end
6049
CLEAN.include('target')
6150

6251
file 'lib/case_transform/native.bundle' => ['lib/case_transform', :cargo_build] do
6352
sh 'gcc ' \
6453
'-Wl,-force_load,target/release/libcase_transform.a ' \
6554
'--shared -Wl,-undefined,dynamic_lookup -o lib/case_transform/native.bundle'
55+
6656
end
6757
CLOBBER.include('lib/case_transform/native.bundle')
6858

@@ -74,11 +64,15 @@ task benchmark: 'lib/case_transform/native.bundle' do
7464
exec 'ruby -Ilib benchmark.rb'
7565
end
7666

77-
# Rake::TestTask.new(:test) do |t|
78-
# t.libs << "test"
79-
# t.libs << "lib"
80-
# t.test_files = FileList['test/**/*_test.rb']
81-
# end
67+
Rake::TestTask.new(:test) do |t|
68+
t.libs << "test"
69+
t.libs << "lib"
70+
t.test_files = FileList['test/**/*_test.rb']
71+
end
8272
#
83-
# task :test => "lib/case_transform/native.bundle"
84-
# task :default => :test
73+
task :test => "lib/case_transform/native.bundle"
74+
task default: [:test, :rubocop]
75+
76+
77+
desc 'CI test task'
78+
task ci: [:default]

0 commit comments

Comments
 (0)