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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4fbdc6040e9635fef05c0681a1a3513871ea4d4eab781541c802f66dabddf57d
4
- data.tar.gz: 97b35d3393324cc1ada05ca9c43095c16c989d4b00f360ec9af940ff6cfdaefa
3
+ metadata.gz: bf04032b5fd467ed3123d922c9ad7978e577601552bf46a2fe4bde8b0b464caf
4
+ data.tar.gz: dd5a7b4c2742f4d3a8b19871729c89ae59ceb4035d7a573476f34a9178406b4d
5
5
  SHA512:
6
- metadata.gz: 954874dbeab6830e58ab484958bbc3679725fdefffce73df7d94a6451a3c31bfa5ab28e2a4a989c51a4194f0572b4b55247ac53dbed98d65e233e50d3be88ad7
7
- data.tar.gz: 2cbc0745b9885ec8cfcb42e6ef5eb11edc06ed9e4b6574388fbb5e34ca128f800f4f0edcd650cab1d474ce998f4e27812ce7b9e283400c7406e9b9f59add0e89
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"`)
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GoGem
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.1"
5
5
  end
@@ -38,6 +38,8 @@ module GoGem
38
38
 
39
39
  def define_go_fmt_task: () -> void
40
40
 
41
+ def define_go_build_envs_task: () -> void
42
+
41
43
  def within_target_dir: () { () -> void } -> void
42
44
 
43
45
  def ext_dir: () -> String
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.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-24 00:00:00.000000000 Z
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: