Commit 58a169d
Improve DurableTask source generator detection and add optional project type configuration (#575)
* Initial plan
* Add DurableTaskGeneratorProjectType configuration option
- Add support for MSBuild property DurableTaskGeneratorProjectType
- Support values: DurableFunctions, Worker, DurableTaskScheduler, Auto
- Add comprehensive unit tests for all configuration scenarios
- All 46 generator tests passing
Co-authored-by: YunchuWang <[email protected]>
* Add documentation for DurableTaskGeneratorProjectType configuration
Co-authored-by: YunchuWang <[email protected]>
* Refactor project type checking to use HashSet for better maintainability
Co-authored-by: YunchuWang <[email protected]>
* Simplify project type configuration to use Functions and Standalone modes only
- Changed from multiple naming variations to two clear modes: "Functions" and "Standalone"
- Updated generator code to only accept "Functions" or "Standalone" (plus "Auto")
- Updated documentation to reflect simplified configuration
- Updated all tests to use new naming convention
- Reduced from 8 to 7 tests by consolidating similar scenarios
Co-authored-by: YunchuWang <[email protected]>
* Resolve merge conflicts with main branch
- Added DurableEventTypeInfo support from main branch
- Updated Initialize method to include durableEventAttributes provider
- Updated Execute method signature to include allEvents parameter
- Added GetDurableEventTypeInfo method
- Added DurableEventTypeInfo class
- Preserved projectType parameter functionality
- All 45 tests passing
Co-authored-by: YunchuWang <[email protected]>
* Improve project type detection to check for Azure Functions trigger attributes
- Changed primary detection mechanism from assembly references to actual usage of trigger attributes
- Now checks if any methods use OrchestrationTrigger, ActivityTrigger, or EntityTrigger
- Solves the original issue: projects with transitive Functions dependencies now correctly generate standalone code
- Assembly reference check kept as fallback for edge cases
- MSBuild property still available as manual override when needed
- Updated documentation to explain the improved detection logic
- All 50 tests passing
Co-authored-by: YunchuWang <[email protected]>
* Update src/Generators/DurableTaskSourceGenerator.cs
Co-authored-by: Copilot <[email protected]>
* Add tests for null projectType (default behavior)
- Added test for null projectType without Functions reference (generates Standalone)
- Added test for null projectType with Functions reference (detects Functions)
- These tests verify default behavior when no MSBuild property is set
- All 52 tests passing (50 original + 2 new)
Co-authored-by: YunchuWang <[email protected]>
* Add test for auto-detection via trigger attributes
- Added AutoDetect_WithTriggerAttributes_GeneratesFunctionsCode test
- Validates that presence of [ActivityTrigger] causes auto-detection as Functions project
- Tests the allFunctions.IsDefaultOrEmpty check in DetermineIsDurableFunctions
- All 53 tests passing (52 original + 1 new)
Co-authored-by: YunchuWang <[email protected]>
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: YunchuWang <[email protected]>
Co-authored-by: wangbill <[email protected]>
Co-authored-by: Copilot <[email protected]>1 parent c96a6bf commit 58a169d
File tree
4 files changed
+663
-12
lines changed- src/Generators
- test/Generators.Tests
- Utils
4 files changed
+663
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
66 | 74 | | |
67 | | - | |
| 75 | + | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
71 | 79 | | |
| 80 | + | |
72 | 81 | | |
73 | 82 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
79 | 89 | | |
80 | 90 | | |
81 | | - | |
| 91 | + | |
82 | 92 | | |
83 | 93 | | |
84 | 94 | | |
| |||
235 | 245 | | |
236 | 246 | | |
237 | 247 | | |
238 | | - | |
| 248 | + | |
| 249 | + | |
239 | 250 | | |
240 | 251 | | |
241 | 252 | | |
242 | 253 | | |
243 | 254 | | |
244 | 255 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
| 256 | + | |
| 257 | + | |
249 | 258 | | |
250 | 259 | | |
251 | 260 | | |
| |||
381 | 390 | | |
382 | 391 | | |
383 | 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 | + | |
384 | 436 | | |
385 | 437 | | |
386 | 438 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 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 | + | |
3 | 63 | | |
0 commit comments