@ai-dev-tools/csharp-copilot-core 0.0.31 → 0.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/out/analyze/cecil.d.ts +1 -0
  2. package/out/analyze/cecil.js +42 -0
  3. package/out/analyze/cecil.js.map +1 -0
  4. package/out/analyze/checkCodeSyntax.d.ts +7 -0
  5. package/out/analyze/checkCodeSyntax.js +67 -0
  6. package/out/analyze/checkCodeSyntax.js.map +1 -0
  7. package/out/analyze/generateCodeDependency.d.ts +6 -0
  8. package/out/analyze/generateCodeDependency.js +127 -0
  9. package/out/analyze/generateCodeDependency.js.map +1 -0
  10. package/out/analyze/installAnalyzerTool.d.ts +1 -0
  11. package/out/analyze/installAnalyzerTool.js +83 -0
  12. package/out/analyze/installAnalyzerTool.js.map +1 -0
  13. package/out/batch/generateCodeTests.d.ts +6 -0
  14. package/out/batch/generateCodeTests.js +163 -0
  15. package/out/batch/generateCodeTests.js.map +1 -0
  16. package/out/batch/getFolderCodeFile.d.ts +1 -0
  17. package/out/batch/getFolderCodeFile.js +19 -0
  18. package/out/batch/getFolderCodeFile.js.map +1 -0
  19. package/out/batch/getProjectCodeFile.d.ts +4 -0
  20. package/out/batch/getProjectCodeFile.js +86 -0
  21. package/out/batch/getProjectCodeFile.js.map +1 -0
  22. package/out/batch/getSolutionCodeFile.d.ts +8 -0
  23. package/out/batch/getSolutionCodeFile.js +70 -0
  24. package/out/batch/getSolutionCodeFile.js.map +1 -0
  25. package/out/benchmark/formatToMarkdown.d.ts +2 -0
  26. package/out/benchmark/formatToMarkdown.js +101 -0
  27. package/out/benchmark/formatToMarkdown.js.map +1 -0
  28. package/out/benchmark/generateBenchmarkReport.d.ts +1 -0
  29. package/out/benchmark/generateBenchmarkReport.js +82 -0
  30. package/out/benchmark/generateBenchmarkReport.js.map +1 -0
  31. package/out/codeCoverage/codeCoverage.d.ts +6 -0
  32. package/out/codeCoverage/codeCoverage.js +39 -0
  33. package/out/codeCoverage/codeCoverage.js.map +1 -0
  34. package/out/codeCoverage/codeCoverageReport.d.ts +6 -0
  35. package/out/codeCoverage/codeCoverageReport.js +76 -0
  36. package/out/codeCoverage/codeCoverageReport.js.map +1 -0
  37. package/out/codeCoverage/extractCodeCoverageInfo.d.ts +2 -0
  38. package/out/codeCoverage/extractCodeCoverageInfo.js +81 -0
  39. package/out/codeCoverage/extractCodeCoverageInfo.js.map +1 -0
  40. package/out/codeCoverage/extractCoverageReportPath.d.ts +1 -0
  41. package/out/codeCoverage/extractCoverageReportPath.js +25 -0
  42. package/out/codeCoverage/extractCoverageReportPath.js.map +1 -0
  43. package/out/codeCoverage/generateCodeCoverageReport.d.ts +1 -0
  44. package/out/codeCoverage/generateCodeCoverageReport.js +30 -0
  45. package/out/codeCoverage/generateCodeCoverageReport.js.map +1 -0
  46. package/out/codeCoverage/getCodeCoverageSetting.d.ts +1 -0
  47. package/out/codeCoverage/getCodeCoverageSetting.js +58 -0
  48. package/out/codeCoverage/getCodeCoverageSetting.js.map +1 -0
  49. package/out/codeCoverage/reportTool.d.ts +2 -0
  50. package/out/codeCoverage/reportTool.js +23 -0
  51. package/out/codeCoverage/reportTool.js.map +1 -0
  52. package/out/codeCoverage/simplifyCoverageXml.d.ts +2 -0
  53. package/out/codeCoverage/simplifyCoverageXml.js +117 -0
  54. package/out/codeCoverage/simplifyCoverageXml.js.map +1 -0
  55. package/out/codebk/250804prompt/buildAfGuidelines.liquid +15 -0
  56. package/out/codebk/250804prompt/general/generalBuildAutofixGuidelines.liquid +13 -0
  57. package/out/codebk/250804prompt/general/generalUtGuidelines.liquid +18 -0
  58. package/out/codebk/250804prompt/generateUtAutoFix.liquid +19 -0
  59. package/out/codebk/250804prompt/generateUtGuidelines.liquid +13 -0
  60. package/out/codebk/250804prompt/generateUtSystem.liquid +5 -0
  61. package/out/codebk/250804prompt/generateUtUserInput.liquid +27 -0
  62. package/out/codebk/250804prompt/testAfGuidelines.liquid +6 -0
  63. package/out/codebk/250804prompt/xap/xapBuildAutofixGuidelines.liquid +13 -0
  64. package/out/codebk/250804prompt/xap/xapCodeCodeDependency.liquid +0 -0
  65. package/out/codebk/250804prompt/xap/xapCodeSample.liquid +38 -0
  66. package/out/codebk/250804prompt/xap/xapUtGuideline-240804.liquid +36 -0
  67. package/out/codebk/250804prompt/xap/xapUtGuideline.liquid +36 -0
  68. package/out/codebk/childProcessManager.d.ts +1 -0
  69. package/out/codebk/childProcessManager.js +50 -0
  70. package/out/codebk/childProcessManager.js.map +1 -0
  71. package/out/codebk/msBuidSpawn.d.ts +1 -0
  72. package/out/codebk/msBuidSpawn.js +58 -0
  73. package/out/codebk/msBuidSpawn.js.map +1 -0
  74. package/out/codebk/msBuild.d.ts +1 -0
  75. package/out/codebk/msBuild.js +123 -0
  76. package/out/codebk/msBuild.js.map +1 -0
  77. package/out/codebk/old/generateXapTestAutoFix.liquid +12 -0
  78. package/out/codebk/old/generateXapTestGuidelines-fm.liquid +68 -0
  79. package/out/codebk/old/generateXapTestGuidelines.liquid +28 -0
  80. package/out/codebk/old/xapGuideline-fm.liquid +149 -0
  81. package/out/codebk/old/xapGuideline.liquid +37 -0
  82. package/out/codebk/oldExec/checkCodeSyntax.d.ts +1 -0
  83. package/out/codebk/oldExec/checkCodeSyntax.js +81 -0
  84. package/out/codebk/oldExec/checkCodeSyntax.js.map +1 -0
  85. package/out/codebk/oldExec/codeCoverage.d.ts +1 -0
  86. package/out/codebk/oldExec/codeCoverage.js +54 -0
  87. package/out/codebk/oldExec/codeCoverage.js.map +1 -0
  88. package/out/codebk/oldExec/codeCoverageReport.d.ts +1 -0
  89. package/out/codebk/oldExec/codeCoverageReport.js +64 -0
  90. package/out/codebk/oldExec/codeCoverageReport.js.map +1 -0
  91. package/out/codebk/oldExec/containsMethods.d.ts +1 -0
  92. package/out/codebk/oldExec/containsMethods.js +74 -0
  93. package/out/codebk/oldExec/containsMethods.js.map +1 -0
  94. package/out/codebk/oldExec/generateCodeDependency.d.ts +1 -0
  95. package/out/codebk/oldExec/generateCodeDependency.js +95 -0
  96. package/out/codebk/oldExec/generateCodeDependency.js.map +1 -0
  97. package/out/codebk/oldExec/msBuild.d.ts +1 -0
  98. package/out/codebk/oldExec/msBuild.js +53 -0
  99. package/out/codebk/oldExec/msBuild.js.map +1 -0
  100. package/out/codebk/oldExec/vsTest.d.ts +1 -0
  101. package/out/codebk/oldExec/vsTest.js +71 -0
  102. package/out/codebk/oldExec/vsTest.js.map +1 -0
  103. package/out/codebk/prompts/general/generalUnitTestGuidelines-20250702.liquid +56 -0
  104. package/out/codebk/prompts/generateXapTestGuidelines-20250704.liquid +21 -0
  105. package/out/codebk/prompts/generateXapTestGuidelines-o.liquid +29 -0
  106. package/out/codebk/prompts/xap/xapGuideline-o.liquid +45 -0
  107. package/out/codebk/testbuildkill.d.ts +1 -0
  108. package/out/codebk/testbuildkill.js +37 -0
  109. package/out/codebk/testbuildkill.js.map +1 -0
  110. package/out/command/index.d.ts +2 -0
  111. package/out/command/index.js +90 -0
  112. package/out/command/index.js.map +1 -0
  113. package/out/command/utGenWrapper.d.ts +3 -0
  114. package/out/command/utGenWrapper.js +53 -0
  115. package/out/command/utGenWrapper.js.map +1 -0
  116. package/out/exit/childProcessManager.d.ts +2 -0
  117. package/out/exit/childProcessManager.js +43 -0
  118. package/out/exit/childProcessManager.js.map +1 -0
  119. package/out/exit/setupProcessSignalHandler.d.ts +1 -0
  120. package/out/exit/setupProcessSignalHandler.js +18 -0
  121. package/out/exit/setupProcessSignalHandler.js.map +1 -0
  122. package/out/gen/autoFix.d.ts +4 -0
  123. package/out/gen/autoFix.js +129 -0
  124. package/out/gen/autoFix.js.map +1 -0
  125. package/out/gen/csharpUtGen.d.ts +2 -0
  126. package/out/gen/csharpUtGen.js +125 -0
  127. package/out/gen/csharpUtGen.js.map +1 -0
  128. package/out/gen/ensureValidLLMResponse.d.ts +1 -0
  129. package/out/gen/ensureValidLLMResponse.js +19 -0
  130. package/out/gen/ensureValidLLMResponse.js.map +1 -0
  131. package/out/gen/postGen/addAiAnnotation.d.ts +1 -0
  132. package/out/gen/postGen/addAiAnnotation.js +57 -0
  133. package/out/gen/postGen/addAiAnnotation.js.map +1 -0
  134. package/out/gen/postGen/extractCodeFromResponse.d.ts +1 -0
  135. package/out/gen/postGen/extractCodeFromResponse.js +38 -0
  136. package/out/gen/postGen/extractCodeFromResponse.js.map +1 -0
  137. package/out/gen/postGen/postGenProcess.d.ts +1 -0
  138. package/out/gen/postGen/postGenProcess.js +39 -0
  139. package/out/gen/postGen/postGenProcess.js.map +1 -0
  140. package/out/gen/postGen/removeComments.d.ts +1 -0
  141. package/out/gen/postGen/removeComments.js +92 -0
  142. package/out/gen/postGen/removeComments.js.map +1 -0
  143. package/out/gen/postGen/removeSingleLines.d.ts +1 -0
  144. package/out/gen/postGen/removeSingleLines.js +29 -0
  145. package/out/gen/postGen/removeSingleLines.js.map +1 -0
  146. package/out/gen/postGen/repairRequiredNameSpaces.d.ts +2 -0
  147. package/out/gen/postGen/repairRequiredNameSpaces.js +142 -0
  148. package/out/gen/postGen/repairRequiredNameSpaces.js.map +1 -0
  149. package/out/gen/postGen/validateTestCode.d.ts +1 -0
  150. package/out/gen/postGen/validateTestCode.js +14 -0
  151. package/out/gen/postGen/validateTestCode.js.map +1 -0
  152. package/out/gen/preGen/excludeFileName.d.ts +1 -0
  153. package/out/gen/preGen/excludeFileName.js +49 -0
  154. package/out/gen/preGen/excludeFileName.js.map +1 -0
  155. package/out/gen/preGen/excludeSpecificTag.d.ts +1 -0
  156. package/out/gen/preGen/excludeSpecificTag.js +19 -0
  157. package/out/gen/preGen/excludeSpecificTag.js.map +1 -0
  158. package/out/gen/preGen/preGenProcess.d.ts +1 -0
  159. package/out/gen/preGen/preGenProcess.js +22 -0
  160. package/out/gen/preGen/preGenProcess.js.map +1 -0
  161. package/out/gen/preGen/validateCode.d.ts +3 -0
  162. package/out/gen/preGen/validateCode.js +63 -0
  163. package/out/gen/preGen/validateCode.js.map +1 -0
  164. package/out/index.d.ts +3 -0
  165. package/out/index.js +10 -0
  166. package/out/index.js.map +1 -0
  167. package/out/llm/model/Gpt.d.ts +1 -0
  168. package/out/llm/model/Gpt.js +93 -0
  169. package/out/llm/model/Gpt.js.map +1 -0
  170. package/out/llm/preparePrompt.d.ts +2 -0
  171. package/out/llm/preparePrompt.js +135 -0
  172. package/out/llm/preparePrompt.js.map +1 -0
  173. package/out/llm/prompt/buildAfGuidelines.liquid +15 -0
  174. package/out/llm/prompt/general/generalBuildAutofixGuidelines.liquid +13 -0
  175. package/out/llm/prompt/general/generalUtGuidelines.liquid +16 -0
  176. package/out/llm/prompt/generateUtAutoFix.liquid +23 -0
  177. package/out/llm/prompt/generateUtDependency.liquid +3 -0
  178. package/out/llm/prompt/generateUtSystem.liquid +5 -0
  179. package/out/llm/prompt/generateUtTemplate.liquid +32 -0
  180. package/out/llm/prompt/generateUtUserInput.liquid +4 -0
  181. package/out/llm/prompt/xap/xapBuildAutofixGuidelines.liquid +13 -0
  182. package/out/llm/prompt/xap/xapCodeCodeDependency.liquid +0 -0
  183. package/out/llm/prompt/xap/xapCodeSample.liquid +38 -0
  184. package/out/llm/prompt/xap/xapUtGuideline.liquid +37 -0
  185. package/out/llm/sendRequestToLLM.d.ts +4 -0
  186. package/out/llm/sendRequestToLLM.js +9 -0
  187. package/out/llm/sendRequestToLLM.js.map +1 -0
  188. package/out/llm/sendRequestToSelfHostLLM.d.ts +4 -0
  189. package/out/llm/sendRequestToSelfHostLLM.js +41 -0
  190. package/out/llm/sendRequestToSelfHostLLM.js.map +1 -0
  191. package/out/metrics/appInsightTelemetry.d.ts +6 -0
  192. package/out/metrics/appInsightTelemetry.js +77 -0
  193. package/out/metrics/appInsightTelemetry.js.map +1 -0
  194. package/out/metrics/machineId.d.ts +11 -0
  195. package/out/metrics/machineId.js +85 -0
  196. package/out/metrics/machineId.js.map +1 -0
  197. package/out/setup/setup.d.ts +1 -0
  198. package/out/setup/setup.js +10 -0
  199. package/out/setup/setup.js.map +1 -0
  200. package/out/setup/setupConsole.d.ts +1 -0
  201. package/out/setup/setupConsole.js +23 -0
  202. package/out/setup/setupConsole.js.map +1 -0
  203. package/out/setup/setupLLMRequest.d.ts +2 -0
  204. package/out/setup/setupLLMRequest.js +10 -0
  205. package/out/setup/setupLLMRequest.js.map +1 -0
  206. package/out/tools/devenvcom.cmd +13 -0
  207. package/out/tools/devenvexe.cmd +13 -0
  208. package/out/tools/msbuildexe.cmd +13 -0
  209. package/out/tools/vstestexe.cmd +13 -0
  210. package/out/types/benchmark.d.ts +11 -0
  211. package/out/types/benchmark.js +3 -0
  212. package/out/types/benchmark.js.map +1 -0
  213. package/out/types/buildResult.d.ts +8 -0
  214. package/out/types/buildResult.js +3 -0
  215. package/out/types/buildResult.js.map +1 -0
  216. package/out/types/constants.d.ts +10 -0
  217. package/out/types/constants.js +14 -0
  218. package/out/types/constants.js.map +1 -0
  219. package/out/types/genResult.d.ts +10 -0
  220. package/out/types/genResult.js +3 -0
  221. package/out/types/genResult.js.map +1 -0
  222. package/out/types/testResult.d.ts +12 -0
  223. package/out/types/testResult.js +3 -0
  224. package/out/types/testResult.js.map +1 -0
  225. package/out/types/verifyResult.d.ts +8 -0
  226. package/out/types/verifyResult.js +3 -0
  227. package/out/types/verifyResult.js.map +1 -0
  228. package/out/utils/checkTestProject.d.ts +2 -0
  229. package/out/utils/checkTestProject.js +79 -0
  230. package/out/utils/checkTestProject.js.map +1 -0
  231. package/out/utils/checkXapCode.d.ts +2 -0
  232. package/out/utils/checkXapCode.js +59 -0
  233. package/out/utils/checkXapCode.js.map +1 -0
  234. package/out/utils/delay.d.ts +1 -0
  235. package/out/utils/delay.js +7 -0
  236. package/out/utils/delay.js.map +1 -0
  237. package/out/utils/detectTestFramework.d.ts +1 -0
  238. package/out/utils/detectTestFramework.js +33 -0
  239. package/out/utils/detectTestFramework.js.map +1 -0
  240. package/out/utils/fileUtils.d.ts +2 -0
  241. package/out/utils/fileUtils.js +42 -0
  242. package/out/utils/fileUtils.js.map +1 -0
  243. package/out/utils/generateCodeSha256.d.ts +1 -0
  244. package/out/utils/generateCodeSha256.js +46 -0
  245. package/out/utils/generateCodeSha256.js.map +1 -0
  246. package/out/utils/getCodeStructurePath.d.ts +5 -0
  247. package/out/utils/getCodeStructurePath.js +155 -0
  248. package/out/utils/getCodeStructurePath.js.map +1 -0
  249. package/out/utils/getOrCreateDir.d.ts +2 -0
  250. package/out/utils/getOrCreateDir.js +63 -0
  251. package/out/utils/getOrCreateDir.js.map +1 -0
  252. package/out/utils/getTestCodeInfo.d.ts +2 -0
  253. package/out/utils/getTestCodeInfo.js +121 -0
  254. package/out/utils/getTestCodeInfo.js.map +1 -0
  255. package/out/utils/getTestFile.d.ts +13 -0
  256. package/out/utils/getTestFile.js +297 -0
  257. package/out/utils/getTestFile.js.map +1 -0
  258. package/out/utils/parseBuildResult.d.ts +3 -0
  259. package/out/utils/parseBuildResult.js +45 -0
  260. package/out/utils/parseBuildResult.js.map +1 -0
  261. package/out/utils/parseSyntaxCheckResult.d.ts +2 -0
  262. package/out/utils/parseSyntaxCheckResult.js +39 -0
  263. package/out/utils/parseSyntaxCheckResult.js.map +1 -0
  264. package/out/utils/parseVstestResult.d.ts +3 -0
  265. package/out/utils/parseVstestResult.js +62 -0
  266. package/out/utils/parseVstestResult.js.map +1 -0
  267. package/out/utils/removeFailedTestMethods.d.ts +3 -0
  268. package/out/utils/removeFailedTestMethods.js +208 -0
  269. package/out/utils/removeFailedTestMethods.js.map +1 -0
  270. package/out/utils/runCommand.d.ts +1 -0
  271. package/out/utils/runCommand.js +14 -0
  272. package/out/utils/runCommand.js.map +1 -0
  273. package/out/utils/spawnExec.d.ts +1 -0
  274. package/out/utils/spawnExec.js +80 -0
  275. package/out/utils/spawnExec.js.map +1 -0
  276. package/out/utils/verifyBuildErrorCausedFile.d.ts +1 -0
  277. package/out/utils/verifyBuildErrorCausedFile.js +60 -0
  278. package/out/utils/verifyBuildErrorCausedFile.js.map +1 -0
  279. package/out/utils/verifyTestCode.d.ts +2 -0
  280. package/out/utils/verifyTestCode.js +25 -0
  281. package/out/utils/verifyTestCode.js.map +1 -0
  282. package/out/utils/writeFailedVerifyResult.d.ts +1 -0
  283. package/out/utils/writeFailedVerifyResult.js +67 -0
  284. package/out/utils/writeFailedVerifyResult.js.map +1 -0
  285. package/out/utils/writeGenCode.d.ts +1 -0
  286. package/out/utils/writeGenCode.js +63 -0
  287. package/out/utils/writeGenCode.js.map +1 -0
  288. package/out/vs/msBuild.d.ts +13 -0
  289. package/out/vs/msBuild.js +49 -0
  290. package/out/vs/msBuild.js.map +1 -0
  291. package/out/vs/vsTest.d.ts +15 -0
  292. package/out/vs/vsTest.js +75 -0
  293. package/out/vs/vsTest.js.map +1 -0
  294. package/out/vs/vsTools.d.ts +7 -0
  295. package/out/vs/vsTools.js +177 -0
  296. package/out/vs/vsTools.js.map +1 -0
  297. package/out/vsPlugin/getVsPluginVerifyResult.d.ts +2 -0
  298. package/out/vsPlugin/getVsPluginVerifyResult.js +41 -0
  299. package/out/vsPlugin/getVsPluginVerifyResult.js.map +1 -0
  300. package/out/vsPlugin/interactionConstants.d.ts +2 -0
  301. package/out/vsPlugin/interactionConstants.js +10 -0
  302. package/out/vsPlugin/interactionConstants.js.map +1 -0
  303. package/out/vsPlugin/sendStdToVsPlugin.d.ts +1 -0
  304. package/out/vsPlugin/sendStdToVsPlugin.js +12 -0
  305. package/out/vsPlugin/sendStdToVsPlugin.js.map +1 -0
  306. package/out/vsPlugin/stdListener.d.ts +3 -0
  307. package/out/vsPlugin/stdListener.js +57 -0
  308. package/out/vsPlugin/stdListener.js.map +1 -0
  309. package/package.json +1 -1
@@ -0,0 +1,37 @@
1
+ ### XAP Framework Guidelines
2
+ - XAP class MUST meets following conditions:
3
+ - inherit from IPlugin, IConditionPlugin, Workflow, IExperiment, IPluginDataStore, IAsyncPlugin.
4
+ - implement **Execute** methond
5
+ - MUST use ExecutionServices.CreateInstance<{ClassName}>() to create XAP class instance.
6
+ - Bond defined data structures may be used in the source code. Must treat Bond structs as normal C# classes.
7
+ - MUST follow these rules when call Execute method of XAP class in test code:
8
+ - ignore parameters with type: PluginServices, PluginOutput<{type}>.
9
+ - ignore parameters with attribute: [ConfigFile("{configFileName}")].
10
+ - parameters must be convert to Task using Task.FromResult({param}).
11
+ This is one example:
12
+ ```C#
13
+ public class EplantMeResponseBuilder : IPlugin
14
+ {
15
+ // xap class Execute
16
+ public PluginResult Execute(
17
+ PluginServices pluginServices,
18
+ PluginOutput<EplantPluginOutput> eplantPluginOutput,
19
+ PluginOutput<EplantUserResp> eplantUserResp,
20
+ PluginOutput<ObjectStoreRequest<EplantUserKey, EplantUser, EMPTY>> userUpdateRequest,
21
+ [ConfigFile("CommonPluginConfig.ini")]
22
+ PluginConfig eplantMeResponseBuilderConfig,
23
+ [ConfigFile("WeatherOSConfig.ini")]
24
+ OSTableInfo eplantUserTableConfig,
25
+ [ConfigFile("EplantConfig.ini")]
26
+ EplantConfig eplantConfig,
27
+ IEnumerable<ObjectStoreResponse_2<EplantUserKey, EMPTY, EMPTY, EplantUser>> osResponses = null,
28
+ EplantRequest req = null)
29
+ {
30
+ ......
31
+ }
32
+ }
33
+
34
+ // Test code of creating instance and test Execute method
35
+ var builder = ExecutionServices.CreateInstance<IEplantMeResponseBuilder>();
36
+ var result = workflow.Execute(Task.FromResult(osResponses), Task.FromResult(request)).Result;
37
+ ```
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ // import * as fs from 'fs';
3
+ // import * as path from 'path';
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ // import { childProcessSet } from '../exit/childProcessManager';
6
+ // import { exec } from 'child_process';
7
+ // const DllRefCacheDir = "./dllref/"
8
+ // export async function checkCodeSyntax(testFilePath: string): Promise<{ success: boolean; message: string }> {
9
+ // createCodeDllRefsDir();
10
+ // const { success, message } = await runTestCodeSyntaxCheck(testFilePath);
11
+ // if (!success) {
12
+ // console.error(`Code analysis failed: ${message}`);
13
+ // return {success: true, message}; // return true to build the project since syntax check fails
14
+ // }
15
+ // if (message.includes("PassedSyntaxCheck")) {
16
+ // console.log(`Pass Syntax check: ${message}`);
17
+ // return {success: true, message};
18
+ // }
19
+ // if (message.includes("SyntaxErrors:")) {
20
+ // const syntaxErrors = getSyntaxErrors(message);
21
+ // console.log(`Syntax errors found in the code:\n ${syntaxErrors}`);
22
+ // return { success: false, message: syntaxErrors };
23
+ // }
24
+ // return { success: true, message };
25
+ // }
26
+ // function getSyntaxErrors(message: string) {
27
+ // const match = message.match(/SyntaxErrors:\s*\n([\s\S]*)/);
28
+ // if (!match || match.length < 2) {
29
+ // return "";
30
+ // }
31
+ // return match[1];
32
+ // }
33
+ // function runTestCodeSyntaxCheck(testCodePath: string): Promise<any> {
34
+ // return new Promise((resolve) => {
35
+ // const analyzerCmd = `ccanalyzer -b "${testCodePath}"`;
36
+ // console.log('📦 Running Csharp code syntax check...');
37
+ // const workDir = path.join(__dirname, DllRefCacheDir);
38
+ // const startTime = Date.now();
39
+ // const codeSyntaxProcess = exec(analyzerCmd, { cwd: workDir, maxBuffer: 1024 * 1024 * 50 }, (error, stdout, stderr) => {
40
+ // console.log(`Csharp code syntax check time: ${(Date.now() - startTime) / 1000} seconds`);
41
+ // if (error) {
42
+ // // console.error(`❌ Analyze failed: ${error.message}`);
43
+ // resolve({ success: false, message: stdout });
44
+ // return;
45
+ // }
46
+ // if (stderr) {
47
+ // // console.warn(`⚠️ Warnings/Errors:\n${stderr}`);
48
+ // resolve({ success: false, message: stdout });
49
+ // return;
50
+ // }
51
+ // // console.log(`✅ Analyze succeeded:\n${stdout}`);
52
+ // resolve({ success: true, message: stdout });
53
+ // });
54
+ // childProcessSet.add(codeSyntaxProcess.pid);
55
+ // });
56
+ // }
57
+ // function createCodeDllRefsDir() {
58
+ // try {
59
+ // const codeDllRefsDir = path.join(__dirname, DllRefCacheDir);
60
+ // const resolvedPath = path.resolve(codeDllRefsDir);
61
+ // // Check if directory exists
62
+ // if (!fs.existsSync(resolvedPath)) {
63
+ // // Create directory recursively
64
+ // fs.mkdirSync(resolvedPath, { recursive: true });
65
+ // console.log(`Directory created: ${resolvedPath}`);
66
+ // } else {
67
+ // console.log(`Directory already exists: ${resolvedPath}`);
68
+ // }
69
+ // } catch (error) {
70
+ // console.error('Error processing directory:', error);
71
+ // }
72
+ // }
73
+ // // checkCodeSyntax("D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\Eplant\\PluginTest\\ResponseBuilder\\EplantUserUpdateResponseBuilderTest.cs",).then(result => {
74
+ // // // checkCodeSyntax("D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\Eplant\\PluginTest\\ResponseBuilder\\EplantRankResponseBuilderTest.cs",).then(result => {
75
+ // // if (result.success) {
76
+ // // console.log("Code syntax check passed:", result.message);
77
+ // // } else {
78
+ // // console.error("Code syntax check failed:", result.message);
79
+ // // }
80
+ // // });
81
+ //# sourceMappingURL=checkCodeSyntax.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkCodeSyntax.js","sourceRoot":"","sources":["../../../src/codebk/oldExec/checkCodeSyntax.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,gCAAgC;;AAEhC,iEAAiE;AACjE,wCAAwC;AAExC,qCAAqC;AAErC,gHAAgH;AAChH,8BAA8B;AAE9B,+EAA+E;AAC/E,sBAAsB;AACtB,6DAA6D;AAC7D,wGAAwG;AACxG,QAAQ;AAER,mDAAmD;AACnD,wDAAwD;AACxD,2CAA2C;AAC3C,QAAQ;AAER,+CAA+C;AAC/C,yDAAyD;AACzD,6EAA6E;AAC7E,4DAA4D;AAC5D,QAAQ;AAER,yCAAyC;AACzC,IAAI;AAEJ,8CAA8C;AAC9C,kEAAkE;AAClE,wCAAwC;AACxC,qBAAqB;AACrB,QAAQ;AAER,uBAAuB;AACvB,IAAI;AAEJ,wEAAwE;AACxE,wCAAwC;AACxC,iEAAiE;AACjE,iEAAiE;AACjE,gEAAgE;AAChE,wCAAwC;AACxC,kIAAkI;AAClI,wGAAwG;AACxG,2BAA2B;AAC3B,0EAA0E;AAC1E,gEAAgE;AAChE,0BAA0B;AAC1B,gBAAgB;AAEhB,4BAA4B;AAC5B,qEAAqE;AACrE,gEAAgE;AAChE,0BAA0B;AAC1B,gBAAgB;AAEhB,iEAAiE;AACjE,2DAA2D;AAC3D,cAAc;AAEd,sDAAsD;AACtD,UAAU;AACV,IAAI;AAEJ,oCAAoC;AACpC,YAAY;AACZ,uEAAuE;AACvE,6DAA6D;AAE7D,uCAAuC;AACvC,8CAA8C;AAC9C,8CAA8C;AAC9C,+DAA+D;AAC/D,iEAAiE;AACjE,mBAAmB;AACnB,wEAAwE;AACxE,YAAY;AACZ,wBAAwB;AACxB,+DAA+D;AAC/D,QAAQ;AACR,IAAI;AAEJ,8MAA8M;AAC9M,2MAA2M;AAC3M,+BAA+B;AAC/B,uEAAuE;AACvE,kBAAkB;AAClB,yEAAyE;AACzE,WAAW;AACX,SAAS","sourcesContent":["// import * as fs from 'fs';\r\n// import * as path from 'path';\r\n\r\n// import { childProcessSet } from '../exit/childProcessManager';\r\n// import { exec } from 'child_process';\r\n\r\n// const DllRefCacheDir = \"./dllref/\"\r\n\r\n// export async function checkCodeSyntax(testFilePath: string): Promise<{ success: boolean; message: string }> {\r\n// createCodeDllRefsDir();\r\n \r\n// const { success, message } = await runTestCodeSyntaxCheck(testFilePath);\r\n// if (!success) {\r\n// console.error(`Code analysis failed: ${message}`);\r\n// return {success: true, message}; // return true to build the project since syntax check fails\r\n// }\r\n\r\n// if (message.includes(\"PassedSyntaxCheck\")) {\r\n// console.log(`Pass Syntax check: ${message}`);\r\n// return {success: true, message};\r\n// }\r\n\r\n// if (message.includes(\"SyntaxErrors:\")) {\r\n// const syntaxErrors = getSyntaxErrors(message);\r\n// console.log(`Syntax errors found in the code:\\n ${syntaxErrors}`);\r\n// return { success: false, message: syntaxErrors };\r\n// }\r\n\r\n// return { success: true, message };\r\n// }\r\n\r\n// function getSyntaxErrors(message: string) {\r\n// const match = message.match(/SyntaxErrors:\\s*\\n([\\s\\S]*)/);\r\n// if (!match || match.length < 2) {\r\n// return \"\";\r\n// }\r\n \r\n// return match[1];\r\n// }\r\n\r\n// function runTestCodeSyntaxCheck(testCodePath: string): Promise<any> {\r\n// return new Promise((resolve) => {\r\n// const analyzerCmd = `ccanalyzer -b \"${testCodePath}\"`;\r\n// console.log('📦 Running Csharp code syntax check...');\r\n// const workDir = path.join(__dirname, DllRefCacheDir);\r\n// const startTime = Date.now();\r\n// const codeSyntaxProcess = exec(analyzerCmd, { cwd: workDir, maxBuffer: 1024 * 1024 * 50 }, (error, stdout, stderr) => {\r\n// console.log(`Csharp code syntax check time: ${(Date.now() - startTime) / 1000} seconds`);\r\n// if (error) {\r\n// // console.error(`❌ Analyze failed: ${error.message}`);\r\n// resolve({ success: false, message: stdout });\r\n// return;\r\n// }\r\n\r\n// if (stderr) {\r\n// // console.warn(`⚠️ Warnings/Errors:\\n${stderr}`);\r\n// resolve({ success: false, message: stdout });\r\n// return;\r\n// }\r\n\r\n// // console.log(`✅ Analyze succeeded:\\n${stdout}`);\r\n// resolve({ success: true, message: stdout });\r\n// });\r\n\r\n// childProcessSet.add(codeSyntaxProcess.pid);\r\n// });\r\n// }\r\n\r\n// function createCodeDllRefsDir() {\r\n// try {\r\n// const codeDllRefsDir = path.join(__dirname, DllRefCacheDir);\r\n// const resolvedPath = path.resolve(codeDllRefsDir);\r\n\r\n// // Check if directory exists\r\n// if (!fs.existsSync(resolvedPath)) {\r\n// // Create directory recursively\r\n// fs.mkdirSync(resolvedPath, { recursive: true });\r\n// console.log(`Directory created: ${resolvedPath}`);\r\n// } else {\r\n// console.log(`Directory already exists: ${resolvedPath}`);\r\n// }\r\n// } catch (error) {\r\n// console.error('Error processing directory:', error);\r\n// }\r\n// }\r\n\r\n// // checkCodeSyntax(\"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\Eplant\\\\PluginTest\\\\ResponseBuilder\\\\EplantUserUpdateResponseBuilderTest.cs\",).then(result => {\r\n// // // checkCodeSyntax(\"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\Eplant\\\\PluginTest\\\\ResponseBuilder\\\\EplantRankResponseBuilderTest.cs\",).then(result => {\r\n// // if (result.success) {\r\n// // console.log(\"Code syntax check passed:\", result.message);\r\n// // } else {\r\n// // console.error(\"Code syntax check failed:\", result.message);\r\n// // }\r\n// // });"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ // import * as path from 'path';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ // import { childProcessSet } from '../exit/childProcessManager';
5
+ // import { exec } from 'child_process';
6
+ // import { extractCoberturaXmlPath } from './extractCodeCoverageInfo';
7
+ // import { vstestPath } from '../vs/vsTools';
8
+ // export function runCodeCoverage(testProjectDllPath: string, codeCoverageSettingPath: string): Promise<any> {
9
+ // return new Promise((resolve) => {
10
+ // const codeCoverageCommand = `"${vstestPath}" "${testProjectDllPath}" /Settings:"${codeCoverageSettingPath}" /TestCaseFilter:"TestCategory!=FunctionalGate&TestCategory!=LocalAH" /EnableCodeCoverage /collect:"Code Coverage;Format=Cobertura"`;
11
+ // const workDir = path.join(__dirname, '../tools');
12
+ // console.log(`Running Code coverage... \n ${codeCoverageCommand}`);
13
+ // const startTime = Date.now();
14
+ // const codeCoverageProcess = exec(codeCoverageCommand, { cwd: workDir, maxBuffer: 1024 * 1024 * 50 }, (error, stdout, stderr) => {
15
+ // console.log(`Code coverage generation time: ${(Date.now() - startTime) / 1000} seconds`);
16
+ // if (error) {
17
+ // console.error(`Code coverage generation failed: ${error.message}`);
18
+ // resolve({ success: false, message: stdout });
19
+ // return;
20
+ // }
21
+ // if (stderr) {
22
+ // console.warn(`Code coverage generation Warnings/Errors:\n${stdout}`);
23
+ // resolve({ success: false, message: stdout, });
24
+ // return;
25
+ // }
26
+ // console.log(`Code coverage generation succeeded`);
27
+ // const coberturaXmlPath = extractCoberturaXmlPath(stdout);
28
+ // resolve({ success: true, message: coberturaXmlPath});
29
+ // });
30
+ // childProcessSet.add(codeCoverageProcess.pid);
31
+ // });
32
+ // }
33
+ // export function containsValidMethods(codePath: string): Promise<boolean> {
34
+ // const analyzerArgs = ['-m', codePath];
35
+ // return runSpawn("ccanalyzer", analyzerArgs, ".", codeCoverageErrorHandler, codeCoverageCloseHandler);
36
+ // }
37
+ // export function codeCoverageErrorHandler(error) {
38
+ // console.error(`codeCoverageErrorHandler - failed: ${error.message}`);
39
+ // return true;
40
+ // }
41
+ // export function codeCoverageCloseHandler(code, stdout, stderr) {
42
+ // if (code !== 0) {
43
+ // console.error(`valid method analyze failed with exit code ${code}, stdout: ${stdout}`);
44
+ // return true; // If the command fails, we assume there are valid methods
45
+ // }
46
+ // if (stderr) {
47
+ // console.warn(`Warnings/Errors:\n${stderr}`);
48
+ // return true;
49
+ // }
50
+ // console.log(`valid method analyze succeeded:\n${stdout}`);
51
+ // const contains = stdout.includes("true");
52
+ // return contains;
53
+ // }
54
+ //# sourceMappingURL=codeCoverage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codeCoverage.js","sourceRoot":"","sources":["../../../src/codebk/oldExec/codeCoverage.ts"],"names":[],"mappings":";AAAA,gCAAgC;;AAEhC,iEAAiE;AACjE,wCAAwC;AACxC,uEAAuE;AACvE,8CAA8C;AAE9C,+GAA+G;AAC/G,wCAAwC;AACxC,4PAA4P;AAE5P,4DAA4D;AAC5D,6EAA6E;AAC7E,wCAAwC;AACxC,4IAA4I;AAC5I,wGAAwG;AACxG,2BAA2B;AAC3B,sFAAsF;AACtF,gEAAgE;AAChE,0BAA0B;AAC1B,gBAAgB;AAEhB,4BAA4B;AAC5B,wFAAwF;AACxF,iEAAiE;AACjE,0BAA0B;AAC1B,gBAAgB;AAEhB,iEAAiE;AACjE,wEAAwE;AACxE,oEAAoE;AACpE,cAAc;AACd,wDAAwD;AACxD,UAAU;AACV,IAAI;AAEJ,6EAA6E;AAC7E,6CAA6C;AAC7C,4GAA4G;AAC5G,IAAI;AAEJ,oDAAoD;AACpD,4EAA4E;AAC5E,mBAAmB;AACnB,IAAI;AAEJ,mEAAmE;AACnE,wBAAwB;AACxB,kGAAkG;AAClG,kFAAkF;AAClF,QAAQ;AAER,oBAAoB;AACpB,uDAAuD;AACvD,uBAAuB;AACvB,QAAQ;AACR,iEAAiE;AACjE,gDAAgD;AAEhD,uBAAuB;AACvB,IAAI","sourcesContent":["// import * as path from 'path';\r\n\r\n// import { childProcessSet } from '../exit/childProcessManager';\r\n// import { exec } from 'child_process';\r\n// import { extractCoberturaXmlPath } from './extractCodeCoverageInfo';\r\n// import { vstestPath } from '../vs/vsTools';\r\n\r\n// export function runCodeCoverage(testProjectDllPath: string, codeCoverageSettingPath: string): Promise<any> {\r\n// return new Promise((resolve) => {\r\n// const codeCoverageCommand = `\"${vstestPath}\" \"${testProjectDllPath}\" /Settings:\"${codeCoverageSettingPath}\" /TestCaseFilter:\"TestCategory!=FunctionalGate&TestCategory!=LocalAH\" /EnableCodeCoverage /collect:\"Code Coverage;Format=Cobertura\"`;\r\n\r\n// const workDir = path.join(__dirname, '../tools');\r\n// console.log(`Running Code coverage... \\n ${codeCoverageCommand}`);\r\n// const startTime = Date.now();\r\n// const codeCoverageProcess = exec(codeCoverageCommand, { cwd: workDir, maxBuffer: 1024 * 1024 * 50 }, (error, stdout, stderr) => {\r\n// console.log(`Code coverage generation time: ${(Date.now() - startTime) / 1000} seconds`);\r\n// if (error) {\r\n// console.error(`Code coverage generation failed: ${error.message}`);\r\n// resolve({ success: false, message: stdout });\r\n// return;\r\n// }\r\n\r\n// if (stderr) {\r\n// console.warn(`Code coverage generation Warnings/Errors:\\n${stdout}`);\r\n// resolve({ success: false, message: stdout, });\r\n// return;\r\n// }\r\n\r\n// console.log(`Code coverage generation succeeded`);\r\n// const coberturaXmlPath = extractCoberturaXmlPath(stdout);\r\n// resolve({ success: true, message: coberturaXmlPath});\r\n// });\r\n// childProcessSet.add(codeCoverageProcess.pid);\r\n// });\r\n// }\r\n\r\n// export function containsValidMethods(codePath: string): Promise<boolean> {\r\n// const analyzerArgs = ['-m', codePath];\r\n// return runSpawn(\"ccanalyzer\", analyzerArgs, \".\", codeCoverageErrorHandler, codeCoverageCloseHandler);\r\n// }\r\n\r\n// export function codeCoverageErrorHandler(error) {\r\n// console.error(`codeCoverageErrorHandler - failed: ${error.message}`);\r\n// return true;\r\n// }\r\n\r\n// export function codeCoverageCloseHandler(code, stdout, stderr) {\r\n// if (code !== 0) {\r\n// console.error(`valid method analyze failed with exit code ${code}, stdout: ${stdout}`);\r\n// return true; // If the command fails, we assume there are valid methods\r\n// }\r\n\r\n// if (stderr) {\r\n// console.warn(`Warnings/Errors:\\n${stderr}`);\r\n// return true;\r\n// }\r\n// console.log(`valid method analyze succeeded:\\n${stdout}`);\r\n// const contains = stdout.includes(\"true\");\r\n\r\n// return contains;\r\n// }"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ // import * as path from 'path';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ // import { checkTestReportToolInstall, installTestReportTool } from './reportTool';
5
+ // import { childProcessSet } from '../exit/childProcessManager';
6
+ // import { exec } from 'child_process';
7
+ // import { runSpawn } from '../utils/spawnExec';
8
+ // export function runCodeCoverageReport2(coverageXmlPath: string): Promise<any> {
9
+ // return new Promise((resolve) => {
10
+ // if (!checkTestReportToolInstall()) {
11
+ // installTestReportTool();
12
+ // }
13
+ // const coverageName = path.basename(coverageXmlPath, ".xml")
14
+ // const coverageReportDir = `CoverageReport-${coverageName}`;
15
+ // const msbuildCommand = `reportgenerator -reports:"${coverageXmlPath}" -targetdir:"${coverageReportDir}" -reporttypes:Html`;
16
+ // const workDir = path.join(__dirname, '../tools');
17
+ // console.log(`Running Code coverage report... \n ${msbuildCommand}`);
18
+ // const startTime = Date.now();
19
+ // const codeCoverageReportProcess = exec(msbuildCommand, { cwd: workDir, maxBuffer: 1024 * 1024 * 50 }, (error, stdout, stderr) => {
20
+ // console.log(`Code coverage report time: ${(Date.now() - startTime) / 1000} seconds`);
21
+ // if (error) {
22
+ // console.error(`Code coverage report failed: ${error.message}`);
23
+ // resolve({ success: false, message: stdout });
24
+ // return;
25
+ // }
26
+ // if (stderr) {
27
+ // console.warn(`Code coverage report Warnings/Errors:\n${stdout}`);
28
+ // resolve({ success: false, message: stdout });
29
+ // return;
30
+ // }
31
+ // console.log(`Code coverage report succeeded`);
32
+ // resolve({ success: true, message: stdout });
33
+ // });
34
+ // childProcessSet.add(codeCoverageReportProcess.pid);
35
+ // });
36
+ // }
37
+ // export function runCodeCoverageReport(coverageXmlPath: string): Promise<boolean> {
38
+ // if (!checkTestReportToolInstall()) {
39
+ // installTestReportTool();
40
+ // }
41
+ // const coverageName = path.basename(coverageXmlPath, ".xml")
42
+ // const coverageReportDir = `CoverageReport-${coverageName}`;
43
+ // const analyzerArgs = ['-reports:"${coverageXmlPath}"', `-targetdir:"${coverageReportDir}"`, '-reporttypes:Html'];
44
+ // const workDir = path.join(__dirname, '../tools');
45
+ // console.log(`Running Code coverage report...`);
46
+ // return runSpawn("ccanalyzer", analyzerArgs, workDir, coverageReportErrorHandler, coverageReportCloseHandler);
47
+ // }
48
+ // export function coverageReportErrorHandler(error) {
49
+ // console.error(`coverageReportErrorHandler - failed: ${error.message}`);
50
+ // return true;
51
+ // }
52
+ // export function coverageReportCloseHandler(code, stdout, stderr) {
53
+ // if (code !== 0) {
54
+ // console.error(`Code coverage report failed with exit code ${code}, stdout: ${stdout}`);
55
+ // return { success: false, message: stdout };
56
+ // }
57
+ // if (stderr) {
58
+ // console.warn(`Code coverage report Warnings/Errors:\n${stdout}`);
59
+ // return { success: false, message: stdout };
60
+ // }
61
+ // console.log(`Code coverage report succeeded`);
62
+ // return { success: true, message: stdout };
63
+ // }
64
+ //# sourceMappingURL=codeCoverageReport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codeCoverageReport.js","sourceRoot":"","sources":["../../../src/codebk/oldExec/codeCoverageReport.ts"],"names":[],"mappings":";AAAA,gCAAgC;;AAEhC,oFAAoF;AAEpF,iEAAiE;AACjE,wCAAwC;AACxC,iDAAiD;AAEjD,kFAAkF;AAClF,wCAAwC;AACxC,+CAA+C;AAC/C,uCAAuC;AACvC,YAAY;AACZ,sEAAsE;AACtE,sEAAsE;AACtE,sIAAsI;AAEtI,4DAA4D;AAC5D,+EAA+E;AAC/E,wCAAwC;AACxC,6IAA6I;AAC7I,oGAAoG;AACpG,2BAA2B;AAC3B,kFAAkF;AAClF,gEAAgE;AAChE,0BAA0B;AAC1B,gBAAgB;AAEhB,4BAA4B;AAC5B,oFAAoF;AACpF,gEAAgE;AAChE,0BAA0B;AAC1B,gBAAgB;AAEhB,6DAA6D;AAC7D,2DAA2D;AAC3D,cAAc;AACd,8DAA8D;AAC9D,UAAU;AACV,IAAI;AAEJ,qFAAqF;AACrF,2CAA2C;AAC3C,mCAAmC;AACnC,QAAQ;AACR,kEAAkE;AAClE,kEAAkE;AAClE,wHAAwH;AACxH,wDAAwD;AACxD,sDAAsD;AACtD,oHAAoH;AACpH,IAAI;AAEJ,sDAAsD;AACtD,8EAA8E;AAC9E,mBAAmB;AACnB,IAAI;AAEJ,qEAAqE;AACrE,wBAAwB;AACxB,kGAAkG;AAClG,sDAAsD;AACtD,QAAQ;AAER,oBAAoB;AACpB,4EAA4E;AAC5E,sDAAsD;AACtD,QAAQ;AAER,qDAAqD;AACrD,iDAAiD;AACjD,IAAI","sourcesContent":["// import * as path from 'path';\r\n\r\n// import { checkTestReportToolInstall, installTestReportTool } from './reportTool';\r\n\r\n// import { childProcessSet } from '../exit/childProcessManager';\r\n// import { exec } from 'child_process';\r\n// import { runSpawn } from '../utils/spawnExec';\r\n\r\n// export function runCodeCoverageReport2(coverageXmlPath: string): Promise<any> {\r\n// return new Promise((resolve) => {\r\n// if (!checkTestReportToolInstall()) {\r\n// installTestReportTool();\r\n// }\r\n// const coverageName = path.basename(coverageXmlPath, \".xml\")\r\n// const coverageReportDir = `CoverageReport-${coverageName}`;\r\n// const msbuildCommand = `reportgenerator -reports:\"${coverageXmlPath}\" -targetdir:\"${coverageReportDir}\" -reporttypes:Html`;\r\n\r\n// const workDir = path.join(__dirname, '../tools');\r\n// console.log(`Running Code coverage report... \\n ${msbuildCommand}`);\r\n// const startTime = Date.now();\r\n// const codeCoverageReportProcess = exec(msbuildCommand, { cwd: workDir, maxBuffer: 1024 * 1024 * 50 }, (error, stdout, stderr) => {\r\n// console.log(`Code coverage report time: ${(Date.now() - startTime) / 1000} seconds`);\r\n// if (error) {\r\n// console.error(`Code coverage report failed: ${error.message}`);\r\n// resolve({ success: false, message: stdout });\r\n// return;\r\n// }\r\n\r\n// if (stderr) {\r\n// console.warn(`Code coverage report Warnings/Errors:\\n${stdout}`);\r\n// resolve({ success: false, message: stdout });\r\n// return;\r\n// }\r\n\r\n// console.log(`Code coverage report succeeded`);\r\n// resolve({ success: true, message: stdout });\r\n// });\r\n// childProcessSet.add(codeCoverageReportProcess.pid);\r\n// });\r\n// }\r\n\r\n// export function runCodeCoverageReport(coverageXmlPath: string): Promise<boolean> {\r\n// if (!checkTestReportToolInstall()) {\r\n// installTestReportTool();\r\n// }\r\n// const coverageName = path.basename(coverageXmlPath, \".xml\")\r\n// const coverageReportDir = `CoverageReport-${coverageName}`;\r\n// const analyzerArgs = ['-reports:\"${coverageXmlPath}\"', `-targetdir:\"${coverageReportDir}\"`, '-reporttypes:Html'];\r\n// const workDir = path.join(__dirname, '../tools');\r\n// console.log(`Running Code coverage report...`);\r\n// return runSpawn(\"ccanalyzer\", analyzerArgs, workDir, coverageReportErrorHandler, coverageReportCloseHandler);\r\n// }\r\n\r\n// export function coverageReportErrorHandler(error) {\r\n// console.error(`coverageReportErrorHandler - failed: ${error.message}`);\r\n// return true;\r\n// }\r\n\r\n// export function coverageReportCloseHandler(code, stdout, stderr) {\r\n// if (code !== 0) {\r\n// console.error(`Code coverage report failed with exit code ${code}, stdout: ${stdout}`);\r\n// return { success: false, message: stdout };\r\n// }\r\n\r\n// if (stderr) {\r\n// console.warn(`Code coverage report Warnings/Errors:\\n${stdout}`);\r\n// return { success: false, message: stdout };\r\n// }\r\n\r\n// console.log(`Code coverage report succeeded`);\r\n// return { success: true, message: stdout };\r\n// }\r\n"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ // import { exec } from 'child_process';
3
+ // import { runSpawn } from '../../utils/spawnExec';
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ // export function containsValidMethods2(codePath: string): Promise<boolean> {
6
+ // return new Promise((resolve) => {
7
+ // const analyzerCmd = `ccanalyzer -m "${codePath}"`;
8
+ // console.log('📦 Running Csharp valid method analyzer...');
9
+ // const startTime = Date.now();
10
+ // exec(analyzerCmd, { maxBuffer: 1024 * 1024 * 50 }, (error, stdout, stderr) => {
11
+ // console.log(`Csharp valid method analyze time: ${(Date.now() - startTime) / 1000} seconds`);
12
+ // if (error) {
13
+ // console.error(`valid method analyze failed: ${error.message}`);
14
+ // resolve(true); // If the command fails, we assume there are valid methods
15
+ // return;
16
+ // }
17
+ // if (stderr) {
18
+ // console.warn(`Warnings/Errors:\n${stderr}`);
19
+ // resolve(true);
20
+ // return;
21
+ // }
22
+ // console.log(`valid method analyze succeeded:\n${stdout}`);
23
+ // const contains = stdout.includes("true");
24
+ // resolve(contains);
25
+ // });
26
+ // });
27
+ // }
28
+ // export function containsValidMethods(codePath: string): Promise<boolean> {
29
+ // const args = ['-m', codePath];
30
+ // return runSpawn("ccanalyzer", args, ".", containsMethodErrorHandler, containsMethodCloseHandler);
31
+ // }
32
+ // export function containsMethodErrorHandler(error) {
33
+ // console.error(`containsMethodErrorHandler - failed: ${error.message}`);
34
+ // return true;
35
+ // }
36
+ // export function containsMethodCloseHandler(code, stdout, stderr) {
37
+ // if (code !== 0) {
38
+ // console.error(`valid method analyze failed with exit code ${code}, stdout: ${stdout}`);
39
+ // return true; // If the command fails, we assume there are valid methods
40
+ // }
41
+ // if (stderr) {
42
+ // console.warn(`Warnings/Errors:\n${stderr}`);
43
+ // return true;
44
+ // }
45
+ // console.log(`valid method analyze succeeded:\n${stdout}`);
46
+ // const contains = stdout.includes("true");
47
+ // return contains;
48
+ // }
49
+ // async function testMethod() {
50
+ // const testFilePaths = [
51
+ // "D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/EplantConstants.cs",
52
+ // "D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/EplantModels.cs",
53
+ // "D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/Conditions/EplantRequestCategoryCondition.cs",
54
+ // "D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/Conditions/EplantRequestTypeCondition.cs",
55
+ // "D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/DataModel/EplantEdgePart.cs",
56
+ // "D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/DataModel/EplantPostBodyContent.cs",
57
+ // "D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/DataModel/EplantRank.cs",
58
+ // "D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/DataModel/EplantRankRow.cs",
59
+ // "D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/DataModel/EplantTreeViewModel.cs",
60
+ // "D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/DataModel/EplantViewModel.cs",
61
+ // "D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/HttpRequestParser/EplantHttpRequestParser.cs",
62
+ // "D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/RequestBuilders/EplantUserRequestBuilder.cs",
63
+ // "D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/ResponseBuilders/EplantActionResponseBuilder.cs",
64
+ // "D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/ResponseBuilders/EplantPlantResponseBuilder.cs",
65
+ // "D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/ResponseBuilders/EplantTreeUpdateResponseBuilder.cs",
66
+ // "D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/ResponseBuilders/EplantUserUpdateResponseBuilder.cs"
67
+ // ];
68
+ // for (const path of testFilePaths) {
69
+ // const hasNonConstructorFunction = await containsValidMethods(path);
70
+ // console.log(`${path} -> ${hasNonConstructorFunction}`);
71
+ // }
72
+ // }
73
+ // testMethod();
74
+ //# sourceMappingURL=containsMethods.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"containsMethods.js","sourceRoot":"","sources":["../../../src/codebk/oldExec/containsMethods.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,oDAAoD;;AAEpD,8EAA8E;AAC9E,wCAAwC;AACxC,6DAA6D;AAC7D,uEAAuE;AACvE,wCAAwC;AACxC,0FAA0F;AAC1F,2GAA2G;AAC3G,2BAA2B;AAC3B,kFAAkF;AAClF,4FAA4F;AAC5F,0BAA0B;AAC1B,gBAAgB;AAEhB,4BAA4B;AAC5B,+DAA+D;AAC/D,iCAAiC;AACjC,0BAA0B;AAC1B,gBAAgB;AAChB,yEAAyE;AACzE,wDAAwD;AAExD,iCAAiC;AACjC,cAAc;AACd,UAAU;AACV,IAAI;AAEJ,6EAA6E;AAC7E,qCAAqC;AACrC,wGAAwG;AACxG,IAAI;AAEJ,sDAAsD;AACtD,8EAA8E;AAC9E,mBAAmB;AACnB,IAAI;AAEJ,qEAAqE;AACrE,wBAAwB;AACxB,kGAAkG;AAClG,kFAAkF;AAClF,QAAQ;AAER,oBAAoB;AACpB,uDAAuD;AACvD,uBAAuB;AACvB,QAAQ;AACR,iEAAiE;AACjE,gDAAgD;AAEhD,uBAAuB;AACvB,IAAI;AAGJ,gCAAgC;AAChC,8BAA8B;AAC9B,qIAAqI;AACrI,kIAAkI;AAClI,+JAA+J;AAC/J,2JAA2J;AAC3J,8IAA8I;AAC9I,qJAAqJ;AACrJ,0IAA0I;AAC1I,6IAA6I;AAC7I,mJAAmJ;AACnJ,+IAA+I;AAC/I,+JAA+J;AAC/J,8JAA8J;AAC9J,kKAAkK;AAClK,iKAAiK;AACjK,sKAAsK;AACtK,qKAAqK;AACrK,SAAS;AAET,0CAA0C;AAC1C,8EAA8E;AAC9E,kEAAkE;AAClE,QAAQ;AACR,IAAI;AAEJ,gBAAgB","sourcesContent":["// import { exec } from 'child_process';\r\n// import { runSpawn } from '../../utils/spawnExec';\r\n\r\n// export function containsValidMethods2(codePath: string): Promise<boolean> {\r\n// return new Promise((resolve) => {\r\n// const analyzerCmd = `ccanalyzer -m \"${codePath}\"`;\r\n// console.log('📦 Running Csharp valid method analyzer...');\r\n// const startTime = Date.now();\r\n// exec(analyzerCmd, { maxBuffer: 1024 * 1024 * 50 }, (error, stdout, stderr) => {\r\n// console.log(`Csharp valid method analyze time: ${(Date.now() - startTime) / 1000} seconds`);\r\n// if (error) {\r\n// console.error(`valid method analyze failed: ${error.message}`);\r\n// resolve(true); // If the command fails, we assume there are valid methods\r\n// return;\r\n// }\r\n\r\n// if (stderr) {\r\n// console.warn(`Warnings/Errors:\\n${stderr}`);\r\n// resolve(true);\r\n// return;\r\n// }\r\n// console.log(`valid method analyze succeeded:\\n${stdout}`);\r\n// const contains = stdout.includes(\"true\");\r\n\r\n// resolve(contains);\r\n// });\r\n// });\r\n// }\r\n\r\n// export function containsValidMethods(codePath: string): Promise<boolean> {\r\n// const args = ['-m', codePath];\r\n// return runSpawn(\"ccanalyzer\", args, \".\", containsMethodErrorHandler, containsMethodCloseHandler);\r\n// }\r\n\r\n// export function containsMethodErrorHandler(error) {\r\n// console.error(`containsMethodErrorHandler - failed: ${error.message}`);\r\n// return true;\r\n// }\r\n\r\n// export function containsMethodCloseHandler(code, stdout, stderr) {\r\n// if (code !== 0) {\r\n// console.error(`valid method analyze failed with exit code ${code}, stdout: ${stdout}`);\r\n// return true; // If the command fails, we assume there are valid methods\r\n// }\r\n\r\n// if (stderr) {\r\n// console.warn(`Warnings/Errors:\\n${stderr}`);\r\n// return true;\r\n// }\r\n// console.log(`valid method analyze succeeded:\\n${stdout}`);\r\n// const contains = stdout.includes(\"true\");\r\n\r\n// return contains;\r\n// }\r\n\r\n\r\n// async function testMethod() {\r\n// const testFilePaths = [\r\n// \"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/EplantConstants.cs\",\r\n// \"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/EplantModels.cs\",\r\n// \"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/Conditions/EplantRequestCategoryCondition.cs\",\r\n// \"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/Conditions/EplantRequestTypeCondition.cs\",\r\n// \"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/DataModel/EplantEdgePart.cs\",\r\n// \"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/DataModel/EplantPostBodyContent.cs\",\r\n// \"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/DataModel/EplantRank.cs\",\r\n// \"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/DataModel/EplantRankRow.cs\",\r\n// \"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/DataModel/EplantTreeViewModel.cs\",\r\n// \"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/DataModel/EplantViewModel.cs\",\r\n// \"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/HttpRequestParser/EplantHttpRequestParser.cs\",\r\n// \"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/RequestBuilders/EplantUserRequestBuilder.cs\",\r\n// \"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/ResponseBuilders/EplantActionResponseBuilder.cs\",\r\n// \"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/ResponseBuilders/EplantPlantResponseBuilder.cs\",\r\n// \"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/ResponseBuilders/EplantTreeUpdateResponseBuilder.cs\",\r\n// \"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/ResponseBuilders/EplantUserUpdateResponseBuilder.cs\"\r\n// ];\r\n\r\n// for (const path of testFilePaths) {\r\n// const hasNonConstructorFunction = await containsValidMethods(path);\r\n// console.log(`${path} -> ${hasNonConstructorFunction}`);\r\n// }\r\n// }\r\n\r\n// testMethod();"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ // import * as fs from 'fs';
3
+ // import * as path from 'path';
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ // import { childProcessSet } from '../exit/childProcessManager';
6
+ // import { exec } from 'child_process';
7
+ // import { generateCodeSha256 } from '../utils/generateCodeSha256';
8
+ // const DepAnalyzerDir = "./deps/"
9
+ // export async function generateCodeDependency(sourceCodePath: string): Promise<string> {
10
+ // const startTime = Date.now();
11
+ // const normalizedPath = path.normalize(sourceCodePath);
12
+ // const codeDepsFileName = normalizedPath.replace(".cs", "").replace(":", "").replaceAll(".", "").split("\\").reverse().join("_");
13
+ // const codeDepsDir = getCodeDepsDir();
14
+ // const codeDepsFilePath = path.join(codeDepsDir, codeDepsFileName + ".deps");
15
+ // let depsStr;
16
+ // if (fs.existsSync(codeDepsFilePath)) {
17
+ // depsStr = getCachedCodeDeps(normalizedPath, codeDepsFilePath);
18
+ // }
19
+ // if (!depsStr) {
20
+ // const { success, message } = await runCsharpCodeAnalyzer(normalizedPath);
21
+ // if (!success) {
22
+ // console.error(`❌ Code analysis failed: ${message}`);
23
+ // return "";
24
+ // }
25
+ // depsStr = fs.readFileSync(codeDepsFilePath, 'utf-8')?.trim();
26
+ // }
27
+ // console.log(`Generate depencency time: ${(Date.now() - startTime) / 1000} seconds`);
28
+ // return depsStr;
29
+ // }
30
+ // function getCodeDepsDir() {
31
+ // try {
32
+ // const codeDepsDir = path.join(__dirname, DepAnalyzerDir);
33
+ // const resolvedPath = path.resolve(codeDepsDir);
34
+ // // Check if directory exists
35
+ // if (!fs.existsSync(resolvedPath)) {
36
+ // // Create directory recursively
37
+ // fs.mkdirSync(resolvedPath, { recursive: true });
38
+ // console.log(`Directory created: ${resolvedPath}`);
39
+ // } else {
40
+ // console.log(`Directory already exists: ${resolvedPath}`);
41
+ // }
42
+ // return codeDepsDir;
43
+ // } catch (error) {
44
+ // console.error('Error processing directory:', error);
45
+ // }
46
+ // }
47
+ // function runCsharpCodeAnalyzer(sourceCodePath: string): Promise<any> {
48
+ // return new Promise((resolve) => {
49
+ // const analyzerCmd = `ccanalyzer -c "${sourceCodePath}"`;
50
+ // console.log('📦 Running Csharp code analyzer...');
51
+ // const workDir = path.join(__dirname, DepAnalyzerDir);
52
+ // const startTime = Date.now();
53
+ // const codeAnalyzerProcess = exec(analyzerCmd, { cwd: workDir, maxBuffer: 1024 * 1024 * 50 }, (error, stdout, stderr) => {
54
+ // console.log(`Csharp code analyze time: ${(Date.now() - startTime) / 1000} seconds`);
55
+ // if (error) {
56
+ // console.error(`Analyze failed: ${error.message}`);
57
+ // resolve({ success: false, message: stdout });
58
+ // return;
59
+ // }
60
+ // if (stderr) {
61
+ // console.warn(`Warnings/Errors:\n${stderr}`);
62
+ // resolve({ success: false, message: stdout });
63
+ // return;
64
+ // }
65
+ // console.log(`Analyze succeeded:\n${stdout}`);
66
+ // resolve({ success: true, message: stdout });
67
+ // });
68
+ // childProcessSet.add(codeAnalyzerProcess.pid);
69
+ // });
70
+ // }
71
+ // function getCachedCodeDeps(sourceCodePath: string, depsFilePath: string) {
72
+ // try {
73
+ // const fileContent = fs.readFileSync(depsFilePath, 'utf-8');
74
+ // const lines = fileContent.split(/\r?\n/);
75
+ // const cachedSha256 = lines[0];
76
+ // const depsContent = lines.slice(1).join('\n');
77
+ // const currentSha256 = generateCodeSha256(sourceCodePath);
78
+ // if (currentSha256 === cachedSha256) {
79
+ // console.log('code unchanged, returning cached deps.');
80
+ // return depsContent;
81
+ // } else {
82
+ // console.log('code has changed.');
83
+ // return null;
84
+ // }
85
+ // } catch (err) {
86
+ // console.error('Error:', err);
87
+ // return null;
88
+ // }
89
+ // }
90
+ // // generateCodeDependency("D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\Conditions\\EplantRequestCategoryCondition.cs");
91
+ // // generateCodeDependency("D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\ResponseBuilders\\EplantMigrateResponseBuilder.cs");
92
+ // // generateCodeDependency("D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/EplantConfigManager.cs");
93
+ // // generateCodeDependency("C:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\ResponseBuilders\\EplantMeResponseBuilder.cs");
94
+ // // generateCodeDependency("D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\RequestBuilders\\EplantRankRequestBuilder.cs");
95
+ //# sourceMappingURL=generateCodeDependency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateCodeDependency.js","sourceRoot":"","sources":["../../../src/codebk/oldExec/generateCodeDependency.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,gCAAgC;;AAEhC,iEAAiE;AACjE,wCAAwC;AACxC,oEAAoE;AAEpE,mCAAmC;AAEnC,0FAA0F;AAC1F,oCAAoC;AAEpC,6DAA6D;AAC7D,uIAAuI;AACvI,4CAA4C;AAC5C,mFAAmF;AACnF,mBAAmB;AACnB,6CAA6C;AAC7C,yEAAyE;AACzE,QAAQ;AACR,sBAAsB;AACtB,oFAAoF;AACpF,0BAA0B;AAC1B,mEAAmE;AACnE,yBAAyB;AACzB,YAAY;AACZ,wEAAwE;AACxE,QAAQ;AAER,2FAA2F;AAE3F,sBAAsB;AACtB,IAAI;AAEJ,8BAA8B;AAC9B,YAAY;AACZ,oEAAoE;AACpE,0DAA0D;AAE1D,uCAAuC;AACvC,8CAA8C;AAC9C,8CAA8C;AAC9C,+DAA+D;AAC/D,iEAAiE;AACjE,mBAAmB;AACnB,wEAAwE;AACxE,YAAY;AACZ,8BAA8B;AAC9B,wBAAwB;AACxB,+DAA+D;AAC/D,QAAQ;AACR,IAAI;AAEJ,yEAAyE;AACzE,wCAAwC;AACxC,mEAAmE;AACnE,6DAA6D;AAC7D,gEAAgE;AAChE,wCAAwC;AACxC,oIAAoI;AACpI,mGAAmG;AACnG,2BAA2B;AAC3B,qEAAqE;AACrE,gEAAgE;AAChE,0BAA0B;AAC1B,gBAAgB;AAEhB,4BAA4B;AAC5B,+DAA+D;AAC/D,gEAAgE;AAChE,0BAA0B;AAC1B,gBAAgB;AAEhB,4DAA4D;AAC5D,2DAA2D;AAC3D,cAAc;AACd,wDAAwD;AACxD,UAAU;AACV,IAAI;AAEJ,6EAA6E;AAC7E,YAAY;AACZ,sEAAsE;AAEtE,oDAAoD;AAEpD,yCAAyC;AACzC,yDAAyD;AAEzD,oEAAoE;AAEpE,gDAAgD;AAChD,qEAAqE;AACrE,kCAAkC;AAClC,mBAAmB;AACnB,gDAAgD;AAChD,2BAA2B;AAC3B,YAAY;AACZ,sBAAsB;AACtB,wCAAwC;AACxC,uBAAuB;AACvB,QAAQ;AACR,IAAI;AAEJ,2LAA2L;AAC3L,+LAA+L;AAC/L,4JAA4J;AAC5J,0LAA0L;AAC1L,0LAA0L","sourcesContent":["// import * as fs from 'fs';\r\n// import * as path from 'path';\r\n\r\n// import { childProcessSet } from '../exit/childProcessManager';\r\n// import { exec } from 'child_process';\r\n// import { generateCodeSha256 } from '../utils/generateCodeSha256';\r\n\r\n// const DepAnalyzerDir = \"./deps/\"\r\n\r\n// export async function generateCodeDependency(sourceCodePath: string): Promise<string> {\r\n// const startTime = Date.now();\r\n\r\n// const normalizedPath = path.normalize(sourceCodePath);\r\n// const codeDepsFileName = normalizedPath.replace(\".cs\", \"\").replace(\":\", \"\").replaceAll(\".\", \"\").split(\"\\\\\").reverse().join(\"_\");\r\n// const codeDepsDir = getCodeDepsDir();\r\n// const codeDepsFilePath = path.join(codeDepsDir, codeDepsFileName + \".deps\");\r\n// let depsStr;\r\n// if (fs.existsSync(codeDepsFilePath)) {\r\n// depsStr = getCachedCodeDeps(normalizedPath, codeDepsFilePath);\r\n// }\r\n// if (!depsStr) {\r\n// const { success, message } = await runCsharpCodeAnalyzer(normalizedPath);\r\n// if (!success) {\r\n// console.error(`❌ Code analysis failed: ${message}`);\r\n// return \"\";\r\n// }\r\n// depsStr = fs.readFileSync(codeDepsFilePath, 'utf-8')?.trim();\r\n// }\r\n\r\n// console.log(`Generate depencency time: ${(Date.now() - startTime) / 1000} seconds`);\r\n\r\n// return depsStr;\r\n// }\r\n\r\n// function getCodeDepsDir() {\r\n// try {\r\n// const codeDepsDir = path.join(__dirname, DepAnalyzerDir);\r\n// const resolvedPath = path.resolve(codeDepsDir);\r\n\r\n// // Check if directory exists\r\n// if (!fs.existsSync(resolvedPath)) {\r\n// // Create directory recursively\r\n// fs.mkdirSync(resolvedPath, { recursive: true });\r\n// console.log(`Directory created: ${resolvedPath}`);\r\n// } else {\r\n// console.log(`Directory already exists: ${resolvedPath}`);\r\n// }\r\n// return codeDepsDir;\r\n// } catch (error) {\r\n// console.error('Error processing directory:', error);\r\n// }\r\n// }\r\n\r\n// function runCsharpCodeAnalyzer(sourceCodePath: string): Promise<any> {\r\n// return new Promise((resolve) => {\r\n// const analyzerCmd = `ccanalyzer -c \"${sourceCodePath}\"`;\r\n// console.log('📦 Running Csharp code analyzer...');\r\n// const workDir = path.join(__dirname, DepAnalyzerDir);\r\n// const startTime = Date.now();\r\n// const codeAnalyzerProcess = exec(analyzerCmd, { cwd: workDir, maxBuffer: 1024 * 1024 * 50 }, (error, stdout, stderr) => {\r\n// console.log(`Csharp code analyze time: ${(Date.now() - startTime) / 1000} seconds`);\r\n// if (error) {\r\n// console.error(`Analyze failed: ${error.message}`);\r\n// resolve({ success: false, message: stdout });\r\n// return;\r\n// }\r\n\r\n// if (stderr) {\r\n// console.warn(`Warnings/Errors:\\n${stderr}`);\r\n// resolve({ success: false, message: stdout });\r\n// return;\r\n// }\r\n\r\n// console.log(`Analyze succeeded:\\n${stdout}`);\r\n// resolve({ success: true, message: stdout });\r\n// });\r\n// childProcessSet.add(codeAnalyzerProcess.pid);\r\n// });\r\n// }\r\n\r\n// function getCachedCodeDeps(sourceCodePath: string, depsFilePath: string) {\r\n// try {\r\n// const fileContent = fs.readFileSync(depsFilePath, 'utf-8');\r\n\r\n// const lines = fileContent.split(/\\r?\\n/);\r\n\r\n// const cachedSha256 = lines[0];\r\n// const depsContent = lines.slice(1).join('\\n');\r\n\r\n// const currentSha256 = generateCodeSha256(sourceCodePath);\r\n\r\n// if (currentSha256 === cachedSha256) {\r\n// console.log('code unchanged, returning cached deps.');\r\n// return depsContent;\r\n// } else {\r\n// console.log('code has changed.');\r\n// return null;\r\n// }\r\n// } catch (err) {\r\n// console.error('Error:', err);\r\n// return null;\r\n// }\r\n// }\r\n\r\n// // generateCodeDependency(\"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\Conditions\\\\EplantRequestCategoryCondition.cs\");\r\n// // generateCodeDependency(\"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\ResponseBuilders\\\\EplantMigrateResponseBuilder.cs\");\r\n// // generateCodeDependency(\"D:/code/CS.Service.Fundamental/SharedSegments/SharedSegments/SharedSegments.Plugins/Workflows/Eplant/EplantConfigManager.cs\");\r\n// // generateCodeDependency(\"C:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\ResponseBuilders\\\\EplantMeResponseBuilder.cs\");\r\n// // generateCodeDependency(\"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\RequestBuilders\\\\EplantRankRequestBuilder.cs\");\r\n"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ // import * as path from 'path';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ // import { exec, spawn } from 'child_process';
5
+ // import { formatMsbuildResultToMarkdown, parseMsbuildErrors } from '../utils/parseBuildResult';
6
+ // import { childProcessSet } from '../exit/childProcessManager';
7
+ // import { msBuildPath } from './vsTools';
8
+ // // import { vsDevCmdPath } from './vsTools';
9
+ // export function runMsBuild(projectPath: string): Promise<any> {
10
+ // return new Promise((resolve) => {
11
+ // // in vsdevcmd env, MSBuild.exe is available
12
+ // const msbuildCommand = `"${msBuildPath}" "${projectPath}" /t:Build /m /nr:true /v:minimal`; // /p:Configuration=debug`;
13
+ // // const msbuildCommand = `"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\MSBuild\\Current\\Bin\\amd64\\MSBuild.exe" "${projectPath}" /t:Build /m /nr:true /v:minimal`; // /p:Configuration=debug`;
14
+ // // const fullCommand = `cmd /c "call "${vsDevCmdPath}" && ${msbuildCommand}"`;
15
+ // const workDir = path.join(__dirname, '../tools');
16
+ // console.log(`📦 Running MSBuild... \n ${msbuildCommand}`);
17
+ // const startTime = Date.now();
18
+ // const buildProcess = exec(msbuildCommand, { cwd: workDir, maxBuffer: 1024 * 1024 * 50 }, (error, stdout, stderr) => {
19
+ // console.log(`Build time: ${(Date.now() - startTime) / 1000} seconds`);
20
+ // if (error) {
21
+ // console.error(`❌ Build failed: ${error.message}`);
22
+ // const buildErrors = parseMsbuildErrors(stdout);
23
+ // const formattedBuildErrors = formatMsbuildResultToMarkdown(buildErrors);
24
+ // resolve({ success: false, message: formattedBuildErrors, buildErrors: buildErrors });
25
+ // return;
26
+ // }
27
+ // if (stderr) {
28
+ // console.warn(`⚠️ Warnings/Errors:\n${stdout}`);
29
+ // resolve({ success: false, message: stdout, buildErrors: null });
30
+ // return;
31
+ // }
32
+ // console.log(`✅ Build succeeded`);
33
+ // resolve({ success: true, message: stdout, buildErrors: null });
34
+ // });
35
+ // childProcessSet.add(buildProcess.pid);
36
+ // });
37
+ // }
38
+ // // setupSignalHandlers();
39
+ // // runMsBuild('D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\SharedSegments.Tests.csproj');
40
+ // // runMsBuild3('D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\SharedSegments.Tests.csproj');
41
+ // // devenv "D:\code\CS.Service.Fundamental\SharedSegments\SharedSegments\SharedSegments.Tests\SharedSegments.Tests.csproj" /build Debug // incremental compile
42
+ // // devenv.com "D:\code\CS.Service.Fundamental\SharedSegments\SharedSegments\SharedSegments.Tests\SharedSegments.Tests.csproj" /build Debug // incremental compile
43
+ // // devenv.com "D:\code\CS.Service.Fundamental\SharedSegments\SharedSegments\SharedSegments.Tests\SharedSegments.Tests.csproj" /build Debug // incremental compile
44
+ // // devenv.com "D:\code\CS.Service.Fundamental\SharedSegments\SharedSegments.sln" /build Debug // incremental compile
45
+ // // msbuild "D:\code\CS.Service.Fundamental\SharedSegments\SharedSegments\SharedSegments.Tests\SharedSegments.Tests.csproj" /t:Build /p:Configuration=Debug /m /v:minimal
46
+ // // msbuild "D:\code\CS.Service.Fundamental\SharedSegments\SharedSegments\SharedSegments.Tests\SharedSegments.Tests.csproj" /t:Build /p:Configuration=Debug /m /v:minimal
47
+ // // msbuild "D:\code\CS.Service.Fundamental\SharedSegments\SharedSegments\SharedSegments.Tests\SharedSegments.Tests.csproj" /t:Build /p:Configuration=Debug /m /v:minimal /nr:true
48
+ // // devenv.com "D:\code\CS.Service.Fundamental\SharedSegments\SharedSegments.sln" /project "D:\code\CS.Service.Fundamental\SharedSegments\SharedSegments\SharedSegments.Tests\SharedSegments.Tests.csproj" /build Debug
49
+ // // devenvexe.cmd "D:\code\CS.Service.Fundamental\SharedSegments\SharedSegments.sln" /build Debug /project "D:\code\CS.Service.Fundamental\SharedSegments\SharedSegments\SharedSegments.Tests\SharedSegments.Tests.csproj"
50
+ // // devenvcom.cmd "D:\code\CS.Service.Fundamental\SharedSegments\SharedSegments.sln" /build Debug /project "D:\code\CS.Service.Fundamental\SharedSegments\SharedSegments\SharedSegments.Tests\SharedSegments.Tests.csproj"
51
+ // // msbuildexe.cmd \"D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\SharedSegments.Tests.csproj\" /t:Build /m /nr:true /v:minimal
52
+ // // runMsBuild('D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\SharedSegments.Tests.csproj');
53
+ //# sourceMappingURL=msBuild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"msBuild.js","sourceRoot":"","sources":["../../../src/codebk/oldExec/msBuild.ts"],"names":[],"mappings":";AAAA,gCAAgC;;AAEhC,+CAA+C;AAC/C,iGAAiG;AAEjG,iEAAiE;AACjE,2CAA2C;AAE3C,+CAA+C;AAE/C,kEAAkE;AAClE,qCAAqC;AACrC,iDAAiD;AACjD,4HAA4H;AAC5H,wNAAwN;AAExN,mFAAmF;AAEnF,4DAA4D;AAC5D,+DAA+D;AAC/D,wCAAwC;AACxC,0HAA0H;AAC1H,qFAAqF;AACrF,kBAAkB;AAClB,yDAAyD;AACzD,kEAAkE;AAClE,2FAA2F;AAC3F,4FAA4F;AAC5F,cAAc;AACd,OAAO;AAEP,mBAAmB;AACnB,sDAAsD;AACtD,uEAAuE;AACvE,cAAc;AACd,OAAO;AAEP,uCAAuC;AACvC,sEAAsE;AACtE,QAAQ;AACR,iDAAiD;AACjD,OAAO;AACP,IAAI;AAEJ,4BAA4B;AAC5B,wIAAwI;AACxI,yIAAyI;AAEzI,kKAAkK;AAClK,sKAAsK;AACtK,sKAAsK;AACtK,yHAAyH;AACzH,2KAA2K;AAC3K,2KAA2K;AAC3K,oLAAoL;AAEpL,yNAAyN;AAEzN,4NAA4N;AAC5N,4NAA4N;AAE5N,4KAA4K;AAC5K,wIAAwI","sourcesContent":["// import * as path from 'path';\r\n\r\n// import { exec, spawn } from 'child_process';\r\n// import { formatMsbuildResultToMarkdown, parseMsbuildErrors } from '../utils/parseBuildResult';\r\n\r\n// import { childProcessSet } from '../exit/childProcessManager';\r\n// import { msBuildPath } from './vsTools';\r\n\r\n// // import { vsDevCmdPath } from './vsTools';\r\n\r\n// export function runMsBuild(projectPath: string): Promise<any> {\r\n// \treturn new Promise((resolve) => {\r\n// \t\t// in vsdevcmd env, MSBuild.exe is available\r\n// \t\tconst msbuildCommand = `\"${msBuildPath}\" \"${projectPath}\" /t:Build /m /nr:true /v:minimal`; // /p:Configuration=debug`;\r\n// \t\t// const msbuildCommand = `\"C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Enterprise\\\\MSBuild\\\\Current\\\\Bin\\\\amd64\\\\MSBuild.exe\" \"${projectPath}\" /t:Build /m /nr:true /v:minimal`; // /p:Configuration=debug`;\r\n\r\n// \t\t// const fullCommand = `cmd /c \"call \"${vsDevCmdPath}\" && ${msbuildCommand}\"`;\r\n\r\n// const workDir = path.join(__dirname, '../tools');\r\n// \t\tconsole.log(`📦 Running MSBuild... \\n ${msbuildCommand}`);\r\n// const startTime = Date.now();\r\n// \t\tconst buildProcess = exec(msbuildCommand, { cwd: workDir, maxBuffer: 1024 * 1024 * 50 }, (error, stdout, stderr) => {\r\n// console.log(`Build time: ${(Date.now() - startTime) / 1000} seconds`);\r\n// \t\t\tif (error) {\r\n// \t\t\t\tconsole.error(`❌ Build failed: ${error.message}`);\r\n// const buildErrors = parseMsbuildErrors(stdout);\r\n// const formattedBuildErrors = formatMsbuildResultToMarkdown(buildErrors);\r\n// \t\t\t\tresolve({ success: false, message: formattedBuildErrors, buildErrors: buildErrors });\r\n// \t\t\t\treturn;\r\n// \t\t\t}\r\n\r\n// \t\t\tif (stderr) {\r\n// \t\t\t\tconsole.warn(`⚠️ Warnings/Errors:\\n${stdout}`);\r\n// \t\t\t\tresolve({ success: false, message: stdout, buildErrors: null });\r\n// \t\t\t\treturn;\r\n// \t\t\t}\r\n\r\n// \t\t\tconsole.log(`✅ Build succeeded`);\r\n// \t\t\tresolve({ success: true, message: stdout, buildErrors: null });\r\n// \t\t});\r\n// childProcessSet.add(buildProcess.pid);\r\n// \t});\r\n// }\r\n\r\n// // setupSignalHandlers();\r\n// // runMsBuild('D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\SharedSegments.Tests.csproj');\r\n// // runMsBuild3('D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\SharedSegments.Tests.csproj');\r\n\r\n// // devenv \"D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\SharedSegments.Tests.csproj\" /build Debug // incremental compile\r\n// // devenv.com \"D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\SharedSegments.Tests.csproj\" /build Debug // incremental compile\r\n// // devenv.com \"D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\SharedSegments.Tests.csproj\" /build Debug // incremental compile\r\n// // devenv.com \"D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments.sln\" /build Debug // incremental compile\r\n// // msbuild \"D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\SharedSegments.Tests.csproj\" /t:Build /p:Configuration=Debug /m /v:minimal\r\n// // msbuild \"D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\SharedSegments.Tests.csproj\" /t:Build /p:Configuration=Debug /m /v:minimal\r\n// // msbuild \"D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\SharedSegments.Tests.csproj\" /t:Build /p:Configuration=Debug /m /v:minimal /nr:true\r\n\r\n// // devenv.com \"D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments.sln\" /project \"D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\SharedSegments.Tests.csproj\" /build Debug\r\n\r\n// // devenvexe.cmd \"D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments.sln\" /build Debug /project \"D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\SharedSegments.Tests.csproj\"\r\n// // devenvcom.cmd \"D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments.sln\" /build Debug /project \"D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\SharedSegments.Tests.csproj\"\r\n\r\n// // msbuildexe.cmd \\\"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\SharedSegments.Tests.csproj\\\" /t:Build /m /nr:true /v:minimal\r\n// // runMsBuild('D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\SharedSegments.Tests.csproj');"]}
@@ -0,0 +1 @@
1
+ export {};