update mocha-dotnet-new; this actually works
This commit is contained in:
parent
32ecee29a4
commit
f92c2040d8
@ -4,6 +4,63 @@
|
|||||||
# creates a new DotNet project and adds all the references needed to use
|
# creates a new DotNet project and adds all the references needed to use
|
||||||
# Mocha from within .NET
|
# Mocha from within .NET
|
||||||
|
|
||||||
|
MOCHA_DOTNET_LIBRARIES_PATH=/usr/lib/mocha/dotnet
|
||||||
|
MOCHA_MOCHA_LIBRARIES_PATH=/home/beckermj/Documents/Projects/mochapowered/mocha-dotnet/mocha-common/mocha-common/output
|
||||||
|
|
||||||
dotnet new console
|
dotnet new console
|
||||||
dotnet add reference /usr/lib/mocha/dotnet/Mocha.Core.dll
|
# dotnet add reference /usr/lib/mocha/dotnet/Mocha.Core.dll
|
||||||
dotnet add reference /usr/lib/mocha/dotnet/MBS.Core.dll
|
# dotnet add reference /usr/lib/mocha/dotnet/MBS.Core.dll
|
||||||
|
|
||||||
|
# link a reference to mocha system libraries
|
||||||
|
ln -s $MOCHA_MOCHA_LIBRARIES_PATH system
|
||||||
|
|
||||||
|
# since we cannot 'dotnet add reference', do it manually - it still works
|
||||||
|
FILE=*.csproj
|
||||||
|
|
||||||
|
ROOT_NAMESPACE=MochaTest1
|
||||||
|
|
||||||
|
echo """
|
||||||
|
<Project Sdk=\"Microsoft.NET.Sdk\">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<RootNamespace>$ROOT_NAMESPACE</RootNamespace>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include=\"MBS.Core\">
|
||||||
|
<HintPath>$MOCHA_DOTNET_LIBRARIES_PATH/MBS.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include=\"Mocha.Core\">
|
||||||
|
<HintPath>$MOCHA_DOTNET_LIBRARIES_PATH/Mocha.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include=\"Mocha.Plugins.Libraries.McxMini\">
|
||||||
|
<HintPath>$MOCHA_DOTNET_LIBRARIES_PATH/Mocha.Plugins.Libraries.McxMini.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include=\"system\\net.alcetech.Mocha.System.mcl\" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
|
""" > $FILE
|
||||||
|
|
||||||
|
FILE=Program.cs
|
||||||
|
|
||||||
|
echo """
|
||||||
|
// See https://get.mochapowered.com/mocha-dotnet-new for more information
|
||||||
|
|
||||||
|
Mocha.Core.OmsImplementations.EmbeddedMiniOms oms = new Mocha.Core.OmsImplementations.EmbeddedMiniOms();
|
||||||
|
oms.SystemLibraryResourceName = null; // \"mocha_test.resources.net.alcetech.Mocha.System.mcl\";
|
||||||
|
|
||||||
|
oms.Initialize();
|
||||||
|
|
||||||
|
Mocha.Core.LibraryHandle lh = oms.LoadLibrary(\"system/net.alcetech.Mocha.System.mcl\");
|
||||||
|
oms.AddLibraryReference(lh);
|
||||||
|
|
||||||
|
Mocha.Core.InstanceHandle ih = oms.GetInstance(Mocha.Core.KnownInstanceGuids.Classes.Class);
|
||||||
|
|
||||||
|
Console.WriteLine(\"Hello, World! The \`Class\` GID is {0}\", oms.GetGlobalIdentifier(ih));
|
||||||
|
""" > $FILE
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user