You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a significant number of .mustache files which have the literal string src instead of the {{sourceFolder}} macro; replacing these should fix the issue [not tested]:
Search "src" (12 hits in 5 files)
compile-mono.sh.mustache (2 hits)
Line 43: ${nuget_cmd} install src/{{packageName}}/packages.config -o packages;
Line 68: -recurse:'src/{{packageName}}/*.cs'
compile.mustache (2 hits)
Line 14: .\nuget.exe install src{{packageName}}\packages.config -o packages
Line 26: %CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin{{packageName}}.dll /recurse:src{{packageName}}*.cs /doc:bin{{packageName}}.xml
mono_nunit_test.mustache (3 hits)
Line 10: rm src/{{{packageName}}}.Test/bin/Debug/{{{packageName}}}.Test.dll 2> /dev/null
Line 15: mono nuget.exe install src/{{{packageName}}}.Test/packages.config -o packages
Line 22: mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe src/{{{packageName}}}.Test/bin/Debug/{{{packageName}}}.Test.dll
nuspec.mustache (3 hits)
Line 46: <file src="....\README.md" target="" />
Line 47: <file src="....\docs**." target="docs" />
Line 49: <file src="....\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets" target="build" />
Solution.mustache (2 hits)
Line 5: Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "src{{packageName}}{{packageName}}.csproj", "{{packageGuid}}"
Line 7: {{^excludeTests}}Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{testPackageName}}", "src{{testPackageName}}{{testPackageName}}.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
The text was updated successfully, but these errors were encountered:
I found something slightly related to this issue, There is a bit of an inconsistency on how the test folders are generated when the sourceFolder property is provided. For example:
Set the option sourceFolder to anything other than src.
In this case, I left it empty: --additional-properties=sourceFolder=""
Generate the client
See that the client was generated in the provided sourceFolder... but the tests where generated in src:
In the AbstractCSharpCodegen.java, there is a TODO a few years old saying that a separate option for testFolder could be added:
Description
If the source folder setting is changed via a configuration file, csharp client generation still generates some files with references to 'src'.
openapi-generator version
main
OpenAPI declaration file content or url
Not applicable. Configuration file, for -c option:
or any sourceFolder setting other than
src
.Command line used for generation
java -jar openapi-generator-cli.jar generate -i swagger.json -l csharp -o ClientAPI -c .\openapi-generation-parameters.json
Steps to reproduce
Generate code. Try to build; it will fail.
Related issues/PRs
None.
Suggest a fix/enhancement
There are a significant number of .mustache files which have the literal string
src
instead of the{{sourceFolder}}
macro; replacing these should fix the issue [not tested]:Search "src" (12 hits in 5 files)
compile-mono.sh.mustache (2 hits)
Line 43: ${nuget_cmd} install src/{{packageName}}/packages.config -o packages;
Line 68: -recurse:'src/{{packageName}}/*.cs'
compile.mustache (2 hits)
Line 14: .\nuget.exe install src{{packageName}}\packages.config -o packages
Line 26: %CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin{{packageName}}.dll /recurse:src{{packageName}}*.cs /doc:bin{{packageName}}.xml
mono_nunit_test.mustache (3 hits)
Line 10: rm src/{{{packageName}}}.Test/bin/Debug/{{{packageName}}}.Test.dll 2> /dev/null
Line 15: mono nuget.exe install src/{{{packageName}}}.Test/packages.config -o packages
Line 22: mono ./packages/NUnit.Runners.2.6.4/tools/nunit-console.exe src/{{{packageName}}}.Test/bin/Debug/{{{packageName}}}.Test.dll
nuspec.mustache (3 hits)
Line 46: <file src="....\README.md" target="" />
Line 47: <file src="....\docs**." target="docs" />
Line 49: <file src="....\packages\Fody.1.29.4\build\portable-net+sl+win+wpa+wp\Fody.targets" target="build" />
Solution.mustache (2 hits)
Line 5: Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "src{{packageName}}{{packageName}}.csproj", "{{packageGuid}}"
Line 7: {{^excludeTests}}Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{testPackageName}}", "src{{testPackageName}}{{testPackageName}}.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
The text was updated successfully, but these errors were encountered: