go_gem 0.4.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -0
- data/lib/go_gem/rake_task.rb +16 -1
- data/lib/go_gem/version.rb +1 -1
- data/sig/go_gem/rake_task.rbs +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf04032b5fd467ed3123d922c9ad7978e577601552bf46a2fe4bde8b0b464caf
|
4
|
+
data.tar.gz: dd5a7b4c2742f4d3a8b19871729c89ae59ceb4035d7a573476f34a9178406b4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66a47a395e84b2b241974b77da353834f8f344982b2f85ab9ec2a7c2ddb67b29242b3ecc9235f36188be82a575733b3d608b16e367adb74e03476c77d929f27c
|
7
|
+
data.tar.gz: 3db32329bcbba23583fca335ae00b0fa78b4dcbab64262afba18e09fd495af47e0eda7c5c16cf3abc7cdd2fca67441fbebb777003ab3c116d83541a96203c481
|
data/README.md
CHANGED
@@ -49,6 +49,7 @@ Following tasks are generated
|
|
49
49
|
* `rake go:test`
|
50
50
|
* `rake go:testrace`
|
51
51
|
* `rake go:fmt`
|
52
|
+
* `rake go:build_envs`
|
52
53
|
|
53
54
|
#### Example (With config)
|
54
55
|
```ruby
|
@@ -68,6 +69,7 @@ Following tasks are generated
|
|
68
69
|
* `rake go5:test`
|
69
70
|
* `rake go5:testrace`
|
70
71
|
* `rake go5:fmt`
|
72
|
+
* `rake go5:build_envs`
|
71
73
|
|
72
74
|
#### Example (Add additional tasks)
|
73
75
|
```ruby
|
@@ -89,6 +91,24 @@ namespace :go do
|
|
89
91
|
end
|
90
92
|
```
|
91
93
|
|
94
|
+
#### Example (Use [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action))
|
95
|
+
```yml
|
96
|
+
jobs:
|
97
|
+
go-lint:
|
98
|
+
runs-on: ubuntu-latest
|
99
|
+
|
100
|
+
steps:
|
101
|
+
- uses: actions/checkout@v4
|
102
|
+
- uses: actions/setup-go@v5
|
103
|
+
- uses: ruby/setup-ruby@v1
|
104
|
+
|
105
|
+
- name: export CGO_CFLAGS for golangci-lint
|
106
|
+
run: bundle exec rake go:build_envs[CGO_CFLAGS] >> $GITHUB_ENV
|
107
|
+
|
108
|
+
- name: Run golangci-lint
|
109
|
+
uses: golangci/golangci-lint-action@v6
|
110
|
+
```
|
111
|
+
|
92
112
|
#### Available configurations
|
93
113
|
* `task_namespace` : task namespace (default: `:go`)
|
94
114
|
* `go_bin_path` : path to go binary (default: `"go"`)
|
data/lib/go_gem/rake_task.rb
CHANGED
@@ -86,6 +86,7 @@ module GoGem
|
|
86
86
|
define_go_test_task
|
87
87
|
define_go_testrace_task
|
88
88
|
define_go_fmt_task
|
89
|
+
define_go_build_envs_task
|
89
90
|
end
|
90
91
|
end
|
91
92
|
|
@@ -119,7 +120,7 @@ module GoGem
|
|
119
120
|
ldflags.gsub!("-Wl,--unresolved-symbols=ignore-all", "")
|
120
121
|
end
|
121
122
|
|
122
|
-
ld_library_path = RbConfig::CONFIG["libdir"]
|
123
|
+
ld_library_path = RbConfig::CONFIG["libdir"].to_s
|
123
124
|
|
124
125
|
{
|
125
126
|
"CGO_CFLAGS" => cflags,
|
@@ -168,5 +169,19 @@ module GoGem
|
|
168
169
|
end
|
169
170
|
end
|
170
171
|
end
|
172
|
+
|
173
|
+
def define_go_build_envs_task
|
174
|
+
desc "Print build envs for `go build`"
|
175
|
+
task(:build_envs, [:env_name]) do |_, args|
|
176
|
+
if args[:env_name]
|
177
|
+
value = RakeTask.build_env_vars[args[:env_name]]
|
178
|
+
puts "#{args[:env_name]}=#{value}"
|
179
|
+
else
|
180
|
+
RakeTask.build_env_vars.each do |name, value|
|
181
|
+
puts "#{name}=#{value}"
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
171
186
|
end
|
172
187
|
end
|
data/lib/go_gem/version.rb
CHANGED
data/sig/go_gem/rake_task.rbs
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: go_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Helpers for compiling Go extensions for ruby
|
14
14
|
email:
|