Browse Source

Upgrade to .NET Core

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/1433/head
Dimitar Dobrev 5 years ago
parent
commit
0726ec9ece
  1. 3
      appveyor.yml
  2. 2
      build/Compile.sh
  3. 2
      build/GenerateMake.bat
  4. 20
      build/GenerateProjects.bat
  5. 26
      build/Helpers.lua
  6. 49
      build/Tests.lua
  7. 7
      src/CLI/premake5.lua
  8. 6
      src/Core/premake5.lua
  9. 21
      src/Generator.Tests/premake5.lua
  10. 19
      src/Generator/premake5.lua

3
appveyor.yml

@ -48,7 +48,8 @@ install:
- build\premake5.exe --file=build\scripts\LLVM.lua download_llvm --arch=%PLATFORM% - build\premake5.exe --file=build\scripts\LLVM.lua download_llvm --arch=%PLATFORM%
build_script: build_script:
- build\premake5.exe --file=build\premake5.lua vs%VS_VERSION% --arch=%PLATFORM% - build\premake5.exe --netcore=true --file=build\premake5.lua vs%VS_VERSION% --arch=%PLATFORM%
- nuget restore ./build/vs%VS_VERSION%/CppSharp.sln
- msbuild %BUILD_PATH%\CppSharp.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /verbosity:minimal - msbuild %BUILD_PATH%\CppSharp.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /verbosity:minimal
#---------------------------------# #---------------------------------#

2
build/Compile.sh

@ -37,7 +37,7 @@ fi
export PATH=$PATH:$MONO_PATH export PATH=$PATH:$MONO_PATH
$PREMAKE --file=$CUR_DIR/premake5.lua gmake "$@" $PREMAKE --netcore=true --file=$CUR_DIR/premake5.lua gmake "$@"
if $DEBUG; then if $DEBUG; then
BUILD_CONF=debug_x64; BUILD_CONF=debug_x64;

2
build/GenerateMake.bat

@ -1,5 +1,5 @@
@echo off @echo off
premake5 --file=premake5.lua gmake premake5 --netcore=true --file=premake5.lua gmake
pause pause

20
build/GenerateProjects.bat

@ -25,31 +25,19 @@ if "%C%"=="1" goto vs2012
if "%C%"=="0" goto clean if "%C%"=="0" goto clean
:clean :clean
"premake5" --file=premake5.lua clean "premake5" --netcore=true --file=premake5.lua clean
goto quit
:vs2012
"premake5" --file=premake5.lua vs2012
goto quit
:vs2013
"premake5" --file=premake5.lua vs2013
goto quit
:vs2015
"premake5" --file=premake5.lua vs2015
goto quit goto quit
:vs2017 :vs2017
"premake5" --file=premake5.lua vs2017 "premake5" --netcore=true --file=premake5.lua vs2017
goto quit goto quit
:vs2019 :vs2019
"premake5" --file=premake5.lua vs2019 "premake5" --netcore=true --file=premake5.lua vs2019
goto quit goto quit
:gmake :gmake
"premake5" --file=premake5.lua gmake "premake5" --netcore=true --file=premake5.lua gmake
goto quit goto quit
:quit :quit

26
build/Helpers.lua

@ -10,6 +10,11 @@ newoption {
} }
} }
newoption {
trigger = "netcore",
description = "enable .NET Core"
}
newoption { newoption {
trigger = "no-cxx11-abi", trigger = "no-cxx11-abi",
description = "disable C++-11 ABI on GCC 4.9+" description = "disable C++-11 ABI on GCC 4.9+"
@ -168,7 +173,17 @@ function SetupManagedProject()
buildoptions {"/langversion:7.2"} buildoptions {"/langversion:7.2"}
buildoptions {"/platform:".._OPTIONS["arch"]} buildoptions {"/platform:".._OPTIONS["arch"]}
dotnetframework "4.7.2" if _OPTIONS.netcore then
dotnetframework "netcoreapp3.1"
else
dotnetframework "4.7.2"
end
nuget
{
"System.CodeDom:4.7.0",
"Microsoft.Win32.Registry:4.7.0"
}
if not os.istarget("macosx") then if not os.istarget("macosx") then
filter { "action:vs* or netcore" } filter { "action:vs* or netcore" }
@ -176,15 +191,6 @@ function SetupManagedProject()
filter {} filter {}
end end
filter { "action:netcore" }
dotnetframework "netstandard2.0"
filter { "action:vs2013" }
dotnetframework "4.5"
filter { "action:vs2012" }
dotnetframework "4.5"
filter {} filter {}
end end

49
build/Tests.lua

@ -59,7 +59,9 @@ function SetupTestGeneratorProject(name, depends)
"CppSharp.AST", "CppSharp.AST",
"CppSharp.Generator", "CppSharp.Generator",
"CppSharp.Generator.Tests", "CppSharp.Generator.Tests",
"CppSharp.Parser" "CppSharp.Parser",
"System",
"System.Core"
} }
if depends ~= nil then if depends ~= nil then
@ -70,15 +72,11 @@ function SetupTestGeneratorProject(name, depends)
SetupParser() SetupParser()
filter { "action:netcore" } if _OPTIONS.netcore then
dotnetframework "netcoreapp2.0" dotnetframework "netcoreapp3.1"
else
filter { "action:not netcore" } dotnetframework "4.7.2"
links end
{
"System",
"System.Core"
}
end end
local function get_mono_exe() local function get_mono_exe()
@ -128,25 +126,11 @@ end
function LinkNUnit() function LinkNUnit()
local c = filter() local c = filter()
filter { "action:not netcore"} nuget
libdirs {
{ "NUnit:3.12.0",
depsdir .. "/NUnit", "NSubstitute:4.2.2"
depsdir .. "/NSubstitute" }
}
links
{
"nunit.framework",
"NSubstitute"
}
filter { "action:netcore"}
nuget
{
"NUnit:3.11.0",
"NSubstitute:4.0.0-rc1"
}
filter(c) filter(c)
end end
@ -191,8 +175,11 @@ function SetupTestProjectsCSharp(name, depends, extraFiles, suffix)
LinkNUnit() LinkNUnit()
filter { "action:netcore" } if _OPTIONS.netcore then
dotnetframework "netcoreapp2.0" dotnetframework "netcoreapp3.1"
else
dotnetframework "4.7.2"
end
end end
function SetupTestProjectsCLI(name, extraFiles, suffix) function SetupTestProjectsCLI(name, extraFiles, suffix)

7
src/CLI/premake5.lua

@ -25,5 +25,8 @@ project "CppSharp.CLI"
"System.Core" "System.Core"
} }
filter { "action:netcore" } if _OPTIONS.netcore then
dotnetframework "netcoreapp2.0" dotnetframework "netcoreapp3.1"
else
dotnetframework "4.7.2"
end

6
src/Core/premake5.lua

@ -14,8 +14,4 @@ project "CppSharp"
depsdir .. "/vs2017/Microsoft.VisualStudio.Setup.Configuration.Interop" depsdir .. "/vs2017/Microsoft.VisualStudio.Setup.Configuration.Interop"
} }
filter { "action:netcore" } nuget { "Microsoft.Win32.Registry:4.7.0" }
nuget { "Microsoft.Win32.Registry:4.5.0" }
filter { "action:not netcore"}
links { "System", "System.Core" }

21
src/Generator.Tests/premake5.lua

@ -27,19 +27,8 @@ project "CppSharp.Generator.Tests"
"CppSharp.Parser", "CppSharp.Parser",
} }
filter { "action:netcore"} nuget
nuget {
{ "NUnit:3.12.0",
"NUnit:3.11.0", "NSubstitute:4.2.2"
"NSubstitute:4.0.0-rc1" }
}
filter { "action:not netcore"}
links
{
"System",
"System.Core",
"Microsoft.CSharp",
"nunit.framework",
"NSubstitute"
}

19
src/Generator/premake5.lua

@ -20,20 +20,11 @@ project "CppSharp.Generator"
SetupParser() SetupParser()
filter { "action:netcore"} nuget
nuget {
{ "System.CodeDom:4.7.0",
"System.CodeDom:4.5.0", "Microsoft.CSharp:4.7.0"
"Microsoft.CSharp:4.5.0" }
}
filter { "action:not netcore"}
links
{
"System",
"System.Core",
"Microsoft.CSharp"
}
filter { 'files:**verbs.txt' } filter { 'files:**verbs.txt' }
buildaction "Embed" buildaction "Embed"

Loading…
Cancel
Save