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. 24
      build/Helpers.lua
  6. 43
      build/Tests.lua
  7. 7
      src/CLI/premake5.lua
  8. 6
      src/Core/premake5.lua
  9. 15
      src/Generator.Tests/premake5.lua
  10. 13
      src/Generator/premake5.lua

3
appveyor.yml

@ -48,7 +48,8 @@ install: @@ -48,7 +48,8 @@ install:
- build\premake5.exe --file=build\scripts\LLVM.lua download_llvm --arch=%PLATFORM%
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
#---------------------------------#

2
build/Compile.sh

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

2
build/GenerateMake.bat

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

20
build/GenerateProjects.bat

@ -25,31 +25,19 @@ if "%C%"=="1" goto vs2012 @@ -25,31 +25,19 @@ if "%C%"=="1" goto vs2012
if "%C%"=="0" goto clean
:clean
"premake5" --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
"premake5" --netcore=true --file=premake5.lua clean
goto quit
:vs2017
"premake5" --file=premake5.lua vs2017
"premake5" --netcore=true --file=premake5.lua vs2017
goto quit
:vs2019
"premake5" --file=premake5.lua vs2019
"premake5" --netcore=true --file=premake5.lua vs2019
goto quit
:gmake
"premake5" --file=premake5.lua gmake
"premake5" --netcore=true --file=premake5.lua gmake
goto quit
:quit

24
build/Helpers.lua

@ -10,6 +10,11 @@ newoption { @@ -10,6 +10,11 @@ newoption {
}
}
newoption {
trigger = "netcore",
description = "enable .NET Core"
}
newoption {
trigger = "no-cxx11-abi",
description = "disable C++-11 ABI on GCC 4.9+"
@ -168,7 +173,17 @@ function SetupManagedProject() @@ -168,7 +173,17 @@ function SetupManagedProject()
buildoptions {"/langversion:7.2"}
buildoptions {"/platform:".._OPTIONS["arch"]}
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
filter { "action:vs* or netcore" }
@ -176,15 +191,6 @@ function SetupManagedProject() @@ -176,15 +191,6 @@ function SetupManagedProject()
filter {}
end
filter { "action:netcore" }
dotnetframework "netstandard2.0"
filter { "action:vs2013" }
dotnetframework "4.5"
filter { "action:vs2012" }
dotnetframework "4.5"
filter {}
end

43
build/Tests.lua

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

7
src/CLI/premake5.lua

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

6
src/Core/premake5.lua

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

15
src/Generator.Tests/premake5.lua

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

13
src/Generator/premake5.lua

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

Loading…
Cancel
Save