@@ -17,7 +17,7 @@ def write_csproj_prefix(ioWrapper):
1717
1818
1919print ('Script to generate stub file from a nuget package' )
20- print (' Usage: python ' + sys .argv [0 ] +
20+ print (' Usage: python3 ' + sys .argv [0 ] +
2121 ' NUGET_PACKAGE_NAME [VERSION=latest] [WORK_DIR=tempDir]' )
2222print (' The script uses the dotnet cli, codeql cli, and dotnet format global tool' )
2323
@@ -57,7 +57,7 @@ def write_csproj_prefix(ioWrapper):
5757version = helpers .get_argv (2 , "latest" )
5858
5959print ("\n * Creating new input project" )
60- helpers .run_cmd (['dotnet' , 'new' , 'classlib' , "--language" , "C#" , '--name' ,
60+ helpers .run_cmd (['dotnet' , 'new' , 'classlib' , "-f" , "net5.0" , "- -language" , "C#" , '--name' ,
6161 projectNameIn , '--output' , projectDirIn ])
6262helpers .remove_files (projectDirIn , '.cs' )
6363
@@ -68,9 +68,13 @@ def write_csproj_prefix(ioWrapper):
6868 cmd .append (version )
6969helpers .run_cmd (cmd )
7070
71+ sdk_version = '5.0.402'
72+ print ("\n * Creating new global.json file and setting SDK to " + sdk_version )
73+ helpers .run_cmd (['dotnet' , 'new' , 'globaljson' , '--force' , '--sdk-version' , sdk_version ])
74+
7175print ("\n * Creating DB" )
7276helpers .run_cmd (['codeql' , 'database' , 'create' , dbDir , '--language=csharp' ,
73- '--command' , 'dotnet build /t:rebuild ' + projectDirIn ])
77+ '--command' , 'dotnet build /t:rebuild /p:UseSharedCompilation=false ' + projectDirIn ])
7478
7579if not os .path .isdir (dbDir ):
7680 print ("Expected database directory " + dbDir + " not found." )
0 commit comments