-
Notifications
You must be signed in to change notification settings - Fork 512
Expand file tree
/
Copy pathTaskfile.yml
More file actions
552 lines (464 loc) · 13.1 KB
/
Copy pathTaskfile.yml
File metadata and controls
552 lines (464 loc) · 13.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
version: "3"
# ============================================================================
# ============================================================================
includes:
rust:
taskfile: ./.task/languages/rust.yml
python:
taskfile: ./.task/languages/python.yml
node:
taskfile: ./.task/languages/node.yml
ruby:
taskfile: ./.task/languages/ruby.yml
php:
taskfile: ./.task/languages/php.yml
go:
taskfile: ./.task/languages/go.yml
java:
taskfile: ./.task/languages/java.yml
csharp:
taskfile: ./.task/languages/csharp.yml
elixir:
taskfile: ./.task/languages/elixir.yml
dart:
taskfile: ./.task/languages/dart.yml
swift:
taskfile: ./.task/languages/swift.yml
kotlin-android:
taskfile: ./.task/languages/kotlin_android.yml
zig:
taskfile: ./.task/languages/zig.yml
version:
taskfile: ./.task/tools/version-sync.yml
benchmark:
taskfile: ./.task/workflows/benchmark.yml
docs:
taskfile: ./.task/tools/docs.yml
demo:
taskfile: ./.task/tools/demo.yml
fixtures:
taskfile: ./.task/tools/fixtures.yml
test-apps:
taskfile: ./.task/tools/test-apps.yml
_tools:
taskfile: ./.task/tools/general.yml
flatten: true
tasks:
default:
desc: "List available tasks"
cmds:
- task --list
setup:
desc: "Install all dependencies and setup development environment"
cmds:
- task: rust:install
- alef setup
- command -v poly >/dev/null 2>&1 || brew install goldziher/tap/poly
- poly hooks install
build:
desc: "Build Rust core library only (debug)"
cmds:
- task: build:core
build:release:
desc: "Build Rust core library only (release)"
cmds:
- task: rust:build:release
build:ci:
desc: "Build Rust core library in CI mode"
cmds:
- task: rust:build:ci
build:core:
desc: "Build Rust core library only (debug)"
cmds:
- task: rust:build:dev
build:bindings:
desc: "Build all language bindings"
cmds:
- task: alef:build
build:all:
desc: "Build Rust core library and all language bindings (debug)"
cmds:
- task: build:core
- task: build:bindings
build:cli:
desc: "Build the xberg CLI binary"
cmds:
- task: rust:cli:build
test:
desc: "Run Rust core tests"
cmds:
- task: rust:test
test:all:
desc: "Run all test suites (Rust core + bindings)"
cmds:
- task: test
- alef test
test:bindings:
desc: "Run binding test suites only (skip Rust core)"
cmds:
- alef test
test:cov:
desc: "Run all tests with coverage"
cmds:
- task: rust:test:ci
- alef test --coverage
test:ci:
desc: "Run all tests with coverage (CI mode, alias for test:cov)"
cmds:
- task: test:cov
lint:
desc: "Lint all code via poly"
cmds:
- poly lint .
lint:check:
desc: "Lint all code WITHOUT auto-fix (check-only)"
cmds:
- poly lint .
format:
desc: "Format all code via poly"
cmds:
- poly fmt --fix .
format:check:
desc: "Check code formatting without modifications"
cmds:
- poly fmt --check .
check:
desc: "Run all checks (format + lint, no modifications)"
cmds:
- task: format:check
- task: lint:check
check:android:
desc: "cargo check xberg-dart + xberg-ffi for Android ABIs"
cmds:
- task: rust:check:android
check:ios:
desc: "cargo check xberg-dart + xberg-swift for iOS targets (macOS only)"
cmds:
- task: rust:check:ios
check:mobile:
desc: "cargo check Android + iOS mobile targets"
cmds:
- task: rust:check:mobile
update:
desc: "Update all dependencies within major versions (minor patches only)"
cmds:
- task: rust:update
- task: python:update
- task: node:update
- task: ruby:update
- task: php:update
- task: go:update
- task: java:update
- task: csharp:update
- task: elixir:update
- task: dart:update
- task: swift:update
- task: kotlin-android:update
- task: zig:update
- alef update
upgrade:
desc: "Upgrade all dependencies to latest including breaking changes"
cmds:
- rustup update stable
- task: rust:upgrade
- task: python:upgrade
- task: node:upgrade
- task: ruby:upgrade
- task: php:upgrade
- task: go:upgrade
- task: java:upgrade
- task: csharp:upgrade
- task: elixir:upgrade
- task: dart:upgrade
- task: swift:upgrade
- task: kotlin-android:upgrade
- task: zig:upgrade
- cmd: alef update --latest
ignore_error: true
- gau --update .
cov:rust:
desc: "Generate Rust coverage report"
cmds:
- task: rust:test:ci
cov:all:
desc: "Generate coverage for all languages"
cmds:
- task: rust:test:ci
- alef test --coverage
versions:sync:
desc: "Synchronize version from Cargo.toml to all package manifests"
cmds:
- task: version:sync
alef:generate:
desc: "Regenerate all Alef-managed outputs (formatting via poly, no build)"
cmds:
- alef all --clean
alef:verify:
desc: "Check Alef-generated files are up to date"
cmds:
- alef verify --exit-code
alef:build:
desc: "Build all language bindings"
cmds:
- alef build
alef:sync:
desc: "Sync version from Cargo.toml to all manifests"
cmds:
- alef sync-versions
alef:docs:
desc: "Generate API reference documentation"
cmds:
- alef docs
e2e:generate:
desc: "Generate E2E tests for all languages from fixtures"
cmds:
- alef e2e generate
e2e:build:
desc: "Build all language bindings used by e2e suites (release)"
cmds:
- alef build --release --lang python,node,ruby,php,ffi,go,java,csharp,elixir,wasm,dart,kotlin_android,swift,zig
e2e:all:
desc: "Generate, build, and run all e2e test suites"
cmds:
- task: e2e:generate
- task: e2e:build
- task: e2e:test
e2e:test:
desc: "Run all e2e test suites across all languages"
cmds:
- alef test --e2e --lang rust,python,node,ruby,php,go,java,csharp,elixir,wasm,dart,kotlin_android,swift,zig
e2e:quick:
desc: "Run quick Rust e2e tests"
cmds:
- alef test --e2e --lang rust
e2e:lint:
desc: "Validate e2e fixtures"
cmds:
- alef e2e validate
e2e:verify:
desc: "Verify generated e2e tests are up to date"
cmds:
- alef e2e generate
- git diff --exit-code e2e/
e2e:lang:
desc: "Run e2e tests for a specific language via LANG variable (e.g., task e2e:lang LANG=python)"
cmds:
- task: ${LANG:-rust}:e2e
rust:e2e:
desc: "Run Rust e2e tests via alef"
cmds:
- alef test --e2e --lang rust
python:e2e:
desc: "Run Python e2e tests via Alef"
cmds:
- alef test --e2e --lang python
go:e2e:
desc: "Run Go e2e tests (builds xberg-ffi first)"
cmds:
- alef test --e2e --lang go
node:e2e:
desc: "Run Node/TypeScript e2e tests (builds NAPI module first)"
cmds:
- alef test --e2e --lang node
ruby:e2e:
desc: "Run Ruby e2e tests"
cmds:
- alef test --e2e --lang ruby
php:e2e:
desc: "Run PHP e2e tests"
cmds:
- alef test --e2e --lang php
wasm:e2e:
desc: "Run WASM e2e tests (builds wasm-pack bundle first)"
cmds:
- alef test --e2e --lang wasm
elixir:e2e:
desc: "Run Elixir e2e tests (compiles NIF first)"
cmds:
- alef test --e2e --lang elixir
java:e2e:
desc: "Run Java e2e tests (builds xberg-ffi first)"
cmds:
- alef test --e2e --lang java
csharp:e2e:
desc: "Run C# e2e tests (builds xberg-ffi first)"
cmds:
- alef test --e2e --lang csharp
dart:codegen:
desc: "Generate flutter_rust_bridge bindings for Dart"
cmds:
- command -v flutter_rust_bridge_codegen >/dev/null 2>&1 || cargo install flutter_rust_bridge_codegen --version 2.12.0
- cd packages/dart && dart pub get
- cd packages/dart/rust && flutter_rust_bridge_codegen generate --config-file flutter_rust_bridge.yaml
dart:setup:
desc: "Setup Dart binding (codegen + native lib build + post-processing via alef)"
cmds:
- alef build --lang dart --release
dart:e2e:
desc: "Run Dart e2e tests"
cmds:
- task: dart:setup
- alef test --e2e --lang dart
kotlin-android:e2e:
desc: "Run Kotlin/Android e2e tests"
cmds:
- alef test --e2e --lang kotlin_android
swift:e2e:
desc: "Run Swift e2e tests"
cmds:
- alef test --e2e --lang swift
zig:e2e:
desc: "Run Zig e2e tests"
cmds:
- alef test --e2e --lang zig
publish:validate:
desc: "Validate publish manifests are consistent"
cmds:
- alef publish validate
publish:prepare:
desc: "Prepare packages for publishing (vendor deps, stage FFI)"
cmds:
- alef publish prepare
publish:build:
desc: "Build release artifacts for all languages"
cmds:
- alef publish build
publish:package:
desc: "Package built artifacts into distributable archives"
cmds:
- alef publish package -o dist/
go:lint:
desc: "Lint Go binding with golangci-lint"
cmds:
- golangci-lint run ./...
dir: packages/go
ruby:format:
desc: "Format Ruby binding with rubocop"
cmds:
- export PATH="$HOME/.rbenv/shims:$HOME/.asdf/shims:$PATH" && ruby -S bundle exec rubocop --autocorrect
dir: packages/ruby
ruby:lint:
desc: "Lint Ruby binding with rubocop and steep"
cmds:
- export PATH="$HOME/.rbenv/shims:$HOME/.asdf/shims:$PATH" && ruby -S bundle exec rubocop
- export PATH="$HOME/.rbenv/shims:$HOME/.asdf/shims:$PATH" && ruby -S bundle exec steep check
dir: packages/ruby
php:build:
desc: "Build the xberg-php native extension (cdylib)"
cmds:
- cargo build --locked --release -p xberg-php
php:format:
desc: "Format PHP binding with poly (mago)"
cmds:
- poly fmt --fix packages/php
php:lint:
desc: "Lint PHP binding with poly (mago)"
cmds:
- poly lint packages/php
python:build:sdist:publish:
desc: "Build the Python sdist using maturin"
dir: packages/python
env:
DIST_DIR: '{{.DIST_DIR | default "../../dist"}}'
cmds:
- mkdir -p "$DIST_DIR"
- maturin sdist --out "$DIST_DIR"
wasm:build:all:
desc: "Alias for rust:wasm:build:all (build all WASM targets + TS wrapper)"
deps: [rust:wasm:build:all]
java:build:release:
desc: "Build the Java binding via Maven (mvn package)"
dir: packages/java
cmds:
- mvn -B -DskipTests package
csharp:build:release:
desc: "Build the C# binding in Release configuration"
dir: packages/csharp
cmds:
- dotnet build --configuration Release
csharp:package:
desc: "Pack the C# binding into a NuGet package (forwards extra args)"
dir: packages/csharp
cmds:
- dotnet pack --configuration Release {{.CLI_ARGS}}
csharp:format:
desc: "Format C# binding with dotnet format"
cmds:
- dotnet format
dir: packages/csharp
csharp:lint:
desc: "Lint C# binding with dotnet format --verify-no-changes"
cmds:
- dotnet format --verify-no-changes
dir: packages/csharp
kotlin-android:format:
desc: "Format Kotlin/Android binding with ktlint via gradle"
cmds:
- gradle ktlintFormat --no-daemon
dir: packages/kotlin-android
kotlin-android:lint:
desc: "Lint Kotlin/Android binding with ktlint via gradle"
cmds:
- gradle ktlintCheck --no-daemon
dir: packages/kotlin-android
kotlin-android:test:
desc: "Run Kotlin/Android binding tests"
cmds:
- cargo build --locked --release -p xberg-ffi
- gradle test --no-daemon
dir: packages/kotlin-android
swift:format:
desc: "Format Swift binding with swift format"
cmds:
- swift format --in-place --recursive Sources
dir: packages/swift
swift:lint:
desc: "Lint Swift binding with swift format lint"
cmds:
- swift format lint --recursive Sources
dir: packages/swift
swift:test:
desc: "Run Swift binding tests"
cmds:
- cargo build --locked --release --manifest-path packages/swift/rust/Cargo.toml
- swift test
dir: packages/swift
dart:format:
desc: "Format Dart binding with dart format"
cmds:
- dart format .
dir: packages/dart
dart:lint:
desc: "Lint Dart binding with dart analyze"
cmds:
- dart analyze
dir: packages/dart
dart:test:
desc: "Run Dart binding tests"
cmds:
- cargo build --locked --release --manifest-path packages/dart/rust/Cargo.toml
- dart pub get
- dart test
dir: packages/dart
zig:format:
desc: "Format Zig binding with zig fmt"
cmds:
- zig fmt src
dir: packages/zig
zig:lint:
desc: "Check Zig formatting with zig fmt --check"
cmds:
- zig fmt --check src
dir: packages/zig
zig:test:
desc: "Run Zig binding tests"
cmds:
- cargo build --locked --release -p xberg-ffi
- zig build test
dir: packages/zig
clean:
desc: "Remove build artifacts across all languages"
cmds:
- cargo clean
- alef clean
- rm -rf coverage.lcov dist/ .alef/