Initial commit
This commit is contained in:
6
Setup/.gitignore
vendored
Normal file
6
Setup/.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
build
|
||||
recovery
|
||||
BeefSpace_User.toml
|
||||
|
||||
# lock ignored by default to make template is always on the latest version
|
||||
BeefSpace_Lock.toml
|
||||
67
Setup/BeefProj.toml
Normal file
67
Setup/BeefProj.toml
Normal file
@@ -0,0 +1,67 @@
|
||||
FileVersion = 1
|
||||
Dependencies = {corlib = "*", "Clang-C.git" = "*", "Cpp2Beef.git" = {Git = "https://git.unicon-gmbh.de/BeefBindings/Cpp2Beef.git"}}
|
||||
|
||||
[Project]
|
||||
Name = "<ProjectName>.Setup"
|
||||
StartupObject = "<ProjectName>.Setup.Program"
|
||||
DefaultNamespace = "<ProjectName>.Setup"
|
||||
|
||||
[Configs.Debug.Win32]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Debug.Win64]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Debug.Linux32]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Debug.Linux64]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Debug.macOS]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Release.Win32]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Release.Win64]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Release.Linux32]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Release.Linux64]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Release.macOS]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Paranoid.Win32]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Paranoid.Win64]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Paranoid.Linux32]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Paranoid.Linux64]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Paranoid.macOS]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Test.Win32]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Test.Win64]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Test.Linux32]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Test.Linux64]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
|
||||
[Configs.Test.macOS]
|
||||
PreBuildCmds = ["cp $(ProjectDir Cpp2Beef.git)/CxxBuilder/dist/CxxBuilderPath.txt ../CxxBuilderPath.txt"]
|
||||
6
Setup/BeefSpace.toml
Normal file
6
Setup/BeefSpace.toml
Normal file
@@ -0,0 +1,6 @@
|
||||
FileVersion = 1
|
||||
Projects = {"<ProjectName>.Setup" = {Path = "."}, "Cpp2Beef.git" = {Git = "https://git.unicon-gmbh.de/BeefBindings/Cpp2Beef.git"}}
|
||||
ExtraPlatforms = ["Linux32", "Linux64", "macOS"]
|
||||
|
||||
[Workspace]
|
||||
StartupProject = "<ProjectName>.Setup"
|
||||
52
Setup/src/Program.bf
Normal file
52
Setup/src/Program.bf
Normal file
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using System.Diagnostics;
|
||||
|
||||
using Cpp2Beef;
|
||||
using LibClang;
|
||||
|
||||
namespace <ProjectName>.Setup;
|
||||
|
||||
class <ProjectName>Generator : Cpp2BeefGenerator, this(Span<char8*> args)
|
||||
{
|
||||
protected override Span<char8*> Args => args;
|
||||
protected override Flags Flags => .None;
|
||||
|
||||
StreamWriter writer = new .()..Create(TODO)..Write("""
|
||||
// This file was generated by Cpp2Beef
|
||||
|
||||
using System;
|
||||
using System.Interop;
|
||||
|
||||
namespace <ProjectName>;
|
||||
|
||||
|
||||
""");
|
||||
|
||||
protected override StreamWriter GetWriterForHeader(StringView header)
|
||||
{
|
||||
if (header.EndsWith(TODO))
|
||||
return writer;
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Program
|
||||
{
|
||||
[CLink] static extern int32 system(char8*);
|
||||
private static mixin RunCommand(char8* cmd)
|
||||
{
|
||||
Console.WriteLine($"> {StringView(cmd)}");
|
||||
int32 rcode = system(cmd);
|
||||
if (rcode != 0)
|
||||
return rcode;
|
||||
}
|
||||
|
||||
public static int Main(String[] args)
|
||||
{
|
||||
scope <ProjectName>Generator(char8*[?]("--language=c")).Generate(TODO, null);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user