summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal <amlal@zka.com>2024-07-11 23:51:17 +0200
committerAmlal <amlal@zka.com>2024-07-11 23:51:17 +0200
commit4c52feb57fda9e9ee29c1f5310ec19d8cd9e4ca8 (patch)
tree92cafaed135e4d79913d2064ee9e2592c8cd0a3a
parenta45e660211b0e262a53047ac09426fd736d6ef9c (diff)
[IMP] libzpt-core shared library and ManifestBuilder class.
Signed-off-by: Amlal <amlal@zka.com>
-rw-r--r--.gitignore225
-rw-r--r--ReadMe.md10
-rw-r--r--buildme.xcodeproj/project.pbxproj290
-rw-r--r--buildme.xcodeproj/project.xcworkspace/contents.xcworkspacedata7
-rw-r--r--buildme.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist8
-rw-r--r--buildme.xcodeproj/xcuserdata/amlal.xcuserdatad/xcschemes/xcschememanagement.plist14
-rw-r--r--buildme/build.json11
-rw-r--r--inc/json.hxx (renamed from buildme/json.hpp)0
-rw-r--r--inc/json_fwd.hxx (renamed from buildme/json_fwd.hpp)0
-rw-r--r--inc/manifest_builder.hxx17
-rw-r--r--makefile3
-rw-r--r--src/manifest_builder.cxx (renamed from buildme/main.cpp)31
-rw-r--r--tests/build.json6
13 files changed, 278 insertions, 344 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c0f6293
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,225 @@
+syntax: glob
+
+html/
+latex/
+
+.cmake/
+.qtc_clangd/
+CMakeCache.txt
+CMakeFiles/
+build.ninja
+cmake_install.cmake
+qtcsettings.cmake
+
+*.exec
+*.rom
+
+NvVars
+
+x86_64/
+
+*.epm
+*.app
+
+*.com
+*.log
+*.slo
+*.lo
+*.o
+*.a
+*.la
+*.lai
+*.so
+*.so.*
+*.dll
+*.dylib
+
+build
+
+# Qt-es
+object_script.*.Release
+object_script.*.Debug
+*_plugin_import.cpp
+/.qmake.cache
+/.qmake.stash
+*.pro.user
+*.pro.user.*
+*.qbs.user
+*.qbs.user.*
+*.moc
+moc_*.cpp
+moc_*.h
+qrc_*.cpp
+ui_*.h
+*.qmlc
+*.jsc
+*build-*
+*.qm
+*.prl
+
+# Qt unit tests
+target_wrapper.*
+
+# QtCreator
+*.autosave
+
+# QtCreator Qml
+*.qmlproject.user
+*.qmlproject.user.*
+
+# QtCreator CMake
+CMakeLists.txt.user*
+
+# QtCreator 4.8< compilation database
+compile_commands.json
+
+# QtCreator local machine specific files for imported projects
+*creator.user*
+
+*_qmlcache.qrc
+
+
+CMakeLists.txt.user
+
+limine-deploy
+
+.DS_Store
+
+### Eclipse ###
+.metadata
+bin/
+tmp/
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.settings/
+.loadpath
+.recommenders
+
+.vscode/settings.json
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# PyDev specific (Python IDE for Eclipse)
+*.pydevproject
+
+# CDT-specific (C/C++ Development Tooling)
+.cproject
+
+# CDT- autotools
+.autotools
+
+# Java annotation processor (APT)
+.factorypath
+
+# PDT-specific (PHP Development Tools)
+.buildpath
+
+# sbteclipse plugin
+.target
+
+# Tern plugin
+.tern-project
+
+# TeXlipse plugin
+.texlipse
+
+# STS (Spring Tool Suite)
+.springBeans
+
+# Code Recommenders
+.recommenders/
+
+# Annotation Processing
+.apt_generated/
+.apt_generated_test/
+
+# Scala IDE specific (Scala & Java development for Eclipse)
+.cache-main
+.scala_dependencies
+.worksheet
+
+# Uncomment this line if you wish to ignore the project description file.
+# Typically, this file would be tracked if it contains build/dependency configurations:
+#.project
+
+### Eclipse Patch ###
+# Spring Boot Tooling
+.sts4-cache/
+
+# End of https://www.toptal.com/developers/gitignore/api/eclipse
+
+# Prerequisites
+*.d
+
+.vs/
+.idea/
+*.out
+*.iso
+
+# Object files
+*.bin
+*.o
+*.ko
+*.obj
+*.elf
+*.sys
+
+*.fd
+*.EFI
+
+# Launch executable
+*.iso
+*.img
+
+# Linker output
+*.ilk
+*.map
+*.exp
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Libs
+*.lib
+*.a
+*.la
+*.lo
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.out
+*.app
+*.i*86
+*.x86_64
+*.hex
+
+# Debug files
+*.dSYM/
+*.su
+*.idb
+*.pdb
+
+# Dyld Module Compile Results
+*.mod*
+*.cmd
+.tmp_versions/
+modules.order
+Module.symvers
+Mkfile.old
+dkms.conf
+
+.fleet/
diff --git a/ReadMe.md b/ReadMe.md
new file mode 100644
index 0000000..2a8ad90
--- /dev/null
+++ b/ReadMe.md
@@ -0,0 +1,10 @@
+# ZPT
+
+A tool used to build libraries/programs and fetch them.
+
+## Installation
+
+- You need GCC
+- You need Make
+
+- Run make `build-zpt` and that's it!
diff --git a/buildme.xcodeproj/project.pbxproj b/buildme.xcodeproj/project.pbxproj
deleted file mode 100644
index ed13951..0000000
--- a/buildme.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,290 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 56;
- objects = {
-
-/* Begin PBXBuildFile section */
- 1D52DE062C240E3B00FB5EA7 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1D52DE052C240E3B00FB5EA7 /* main.cpp */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 1D52DE002C240E3B00FB5EA7 /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = /usr/share/man/man1/;
- dstSubfolderSpec = 0;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 1;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 1D52DE022C240E3B00FB5EA7 /* buildme */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = buildme; sourceTree = BUILT_PRODUCTS_DIR; };
- 1D52DE052C240E3B00FB5EA7 /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
- 1D52DE0C2C240EAA00FB5EA7 /* json.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = json.hpp; sourceTree = "<group>"; };
- 1D52DE0D2C240ECE00FB5EA7 /* json_fwd.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = json_fwd.hpp; sourceTree = "<group>"; };
- 1D52DE0E2C24105D00FB5EA7 /* build.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = build.json; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 1D52DDFF2C240E3B00FB5EA7 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 1D52DDF92C240E3B00FB5EA7 = {
- isa = PBXGroup;
- children = (
- 1D52DE042C240E3B00FB5EA7 /* buildme */,
- 1D52DE032C240E3B00FB5EA7 /* Products */,
- );
- sourceTree = "<group>";
- };
- 1D52DE032C240E3B00FB5EA7 /* Products */ = {
- isa = PBXGroup;
- children = (
- 1D52DE022C240E3B00FB5EA7 /* buildme */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 1D52DE042C240E3B00FB5EA7 /* buildme */ = {
- isa = PBXGroup;
- children = (
- 1D52DE052C240E3B00FB5EA7 /* main.cpp */,
- 1D52DE0C2C240EAA00FB5EA7 /* json.hpp */,
- 1D52DE0D2C240ECE00FB5EA7 /* json_fwd.hpp */,
- 1D52DE0E2C24105D00FB5EA7 /* build.json */,
- );
- path = buildme;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 1D52DE012C240E3B00FB5EA7 /* buildme */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 1D52DE092C240E3B00FB5EA7 /* Build configuration list for PBXNativeTarget "buildme" */;
- buildPhases = (
- 1D52DDFE2C240E3B00FB5EA7 /* Sources */,
- 1D52DDFF2C240E3B00FB5EA7 /* Frameworks */,
- 1D52DE002C240E3B00FB5EA7 /* CopyFiles */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = buildme;
- productName = buildme;
- productReference = 1D52DE022C240E3B00FB5EA7 /* buildme */;
- productType = "com.apple.product-type.tool";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 1D52DDFA2C240E3B00FB5EA7 /* Project object */ = {
- isa = PBXProject;
- attributes = {
- BuildIndependentTargetsInParallel = 1;
- LastUpgradeCheck = 1540;
- TargetAttributes = {
- 1D52DE012C240E3B00FB5EA7 = {
- CreatedOnToolsVersion = 15.4;
- };
- };
- };
- buildConfigurationList = 1D52DDFD2C240E3B00FB5EA7 /* Build configuration list for PBXProject "buildme" */;
- compatibilityVersion = "Xcode 14.0";
- developmentRegion = en;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- Base,
- );
- mainGroup = 1D52DDF92C240E3B00FB5EA7;
- productRefGroup = 1D52DE032C240E3B00FB5EA7 /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 1D52DE012C240E3B00FB5EA7 /* buildme */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
- 1D52DDFE2C240E3B00FB5EA7 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 1D52DE062C240E3B00FB5EA7 /* main.cpp in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 1D52DE072C240E3B00FB5EA7 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_ENABLE_OBJC_WEAK = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = dwarf;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_TESTABILITY = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = YES;
- GCC_C_LANGUAGE_STANDARD = gnu17;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
- MACOSX_DEPLOYMENT_TARGET = 14.3;
- MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
- MTL_FAST_MATH = YES;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = macosx;
- };
- name = Debug;
- };
- 1D52DE082C240E3B00FB5EA7 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_ENABLE_OBJC_WEAK = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- ENABLE_NS_ASSERTIONS = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = YES;
- GCC_C_LANGUAGE_STANDARD = gnu17;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
- MACOSX_DEPLOYMENT_TARGET = 14.3;
- MTL_ENABLE_DEBUG_INFO = NO;
- MTL_FAST_MATH = YES;
- SDKROOT = macosx;
- };
- name = Release;
- };
- 1D52DE0A2C240E3B00FB5EA7 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CODE_SIGN_STYLE = Automatic;
- PRODUCT_NAME = "$(TARGET_NAME)";
- };
- name = Debug;
- };
- 1D52DE0B2C240E3B00FB5EA7 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CODE_SIGN_STYLE = Automatic;
- PRODUCT_NAME = "$(TARGET_NAME)";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 1D52DDFD2C240E3B00FB5EA7 /* Build configuration list for PBXProject "buildme" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1D52DE072C240E3B00FB5EA7 /* Debug */,
- 1D52DE082C240E3B00FB5EA7 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 1D52DE092C240E3B00FB5EA7 /* Build configuration list for PBXNativeTarget "buildme" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1D52DE0A2C240E3B00FB5EA7 /* Debug */,
- 1D52DE0B2C240E3B00FB5EA7 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 1D52DDFA2C240E3B00FB5EA7 /* Project object */;
-}
diff --git a/buildme.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/buildme.xcodeproj/project.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 919434a..0000000
--- a/buildme.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Workspace
- version = "1.0">
- <FileRef
- location = "self:">
- </FileRef>
-</Workspace>
diff --git a/buildme.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/buildme.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644
index 18d9810..0000000
--- a/buildme.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IDEDidComputeMac32BitWarning</key>
- <true/>
-</dict>
-</plist>
diff --git a/buildme.xcodeproj/xcuserdata/amlal.xcuserdatad/xcschemes/xcschememanagement.plist b/buildme.xcodeproj/xcuserdata/amlal.xcuserdatad/xcschemes/xcschememanagement.plist
deleted file mode 100644
index 38c3157..0000000
--- a/buildme.xcodeproj/xcuserdata/amlal.xcuserdatad/xcschemes/xcschememanagement.plist
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>SchemeUserState</key>
- <dict>
- <key>buildme.xcscheme_^#shared#^_</key>
- <dict>
- <key>orderHint</key>
- <integer>0</integer>
- </dict>
- </dict>
-</dict>
-</plist>
diff --git a/buildme/build.json b/buildme/build.json
deleted file mode 100644
index 8d6ab71..0000000
--- a/buildme/build.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "compiler_path": "cplusplus",
- "compiler_std": "c++20",
- "headers_path": [
- "C:\\App\\Tests\\",
- "C:\\App\\Headers\\"
- ],
- "sources_path": [
- "C:\\App\\Sources\\*.cxx"
- ]
-}
diff --git a/buildme/json.hpp b/inc/json.hxx
index a858728..a858728 100644
--- a/buildme/json.hpp
+++ b/inc/json.hxx
diff --git a/buildme/json_fwd.hpp b/inc/json_fwd.hxx
index 29a6036..29a6036 100644
--- a/buildme/json_fwd.hpp
+++ b/inc/json_fwd.hxx
diff --git a/inc/manifest_builder.hxx b/inc/manifest_builder.hxx
new file mode 100644
index 0000000..4276ee2
--- /dev/null
+++ b/inc/manifest_builder.hxx
@@ -0,0 +1,17 @@
+#pragma once
+
+class ManifestBuilder;
+
+class ManifestBuilder final
+{
+public:
+ explicit ManifestBuilder() = default;
+ ~ManifestBuilder() = default;
+
+ ManifestBuilder& operator=(const ManifestBuilder&) = default;
+ ManifestBuilder(const ManifestBuilder&) = default;
+
+public:
+ int buildJson(int argc, const char * argv[]);
+
+};
diff --git a/makefile b/makefile
new file mode 100644
index 0000000..69cfe1d
--- /dev/null
+++ b/makefile
@@ -0,0 +1,3 @@
+.PHONY: build-zpt-core
+build-zpt-core:
+ g++ -I./inc $(wildcard src/*.cxx) -fPIC -shared -o libzpt-core.so
diff --git a/buildme/main.cpp b/src/manifest_builder.cxx
index b91bd98..ec60028 100644
--- a/buildme/main.cpp
+++ b/src/manifest_builder.cxx
@@ -5,18 +5,21 @@
// Created by Amlal on 6/20/24.
//
+#include <sstream>
#include <iostream>
#include <fstream>
-#include "json.hpp"
+#include <manifest_builder.hxx>
+
+#include <json.hxx>
using json = nlohmann::json;
-int main(int argc, const char * argv[])
+int ManifestBuilder::buildJson(int argc, const char * argv[])
{
std::cout << "buildme: ";
std::string path;
-
+
if (argc == 1)
{
std::cout << "no files, defaulting to build.json\n";
@@ -26,43 +29,43 @@ int main(int argc, const char * argv[])
{
path = argv[1];
}
-
+
try
{
std::ifstream fJson(path);
json buildme = json::parse(fJson);
-
+
std::string compiler = buildme["compiler_path"].get<std::string>();
std::cout << "choose toolchain: " << compiler << std::endl;
-
+
json headerSearchPath = buildme["headers_path"];
std::cout << "search path: " << headerSearchPath.dump() << std::endl;
-
+
json sourceFiles = buildme["sources_path"];
std::cout << "source files: " << sourceFiles.dump() << std::endl;
-
+
std::string cmdLine = compiler + " ";
-
+
for (auto sources : sourceFiles)
{
cmdLine += sources.get<std::string>() + " ";
}
-
+
for (auto sources : sourceFiles)
{
cmdLine += "-include=" + sources.get<std::string>() + " ";
}
-
+
cmdLine += "-std=" + buildme["compiler_std"].get<std::string>() + " ";
-
+
std::cout << "running: " << cmdLine << std::endl;
-
+
std::system(cmdLine.c_str());
}
catch (...)
{
return 1;
}
-
+
return 0;
}
diff --git a/tests/build.json b/tests/build.json
new file mode 100644
index 0000000..8a1ee45
--- /dev/null
+++ b/tests/build.json
@@ -0,0 +1,6 @@
+{
+ "compiler_path": "cplusplus",
+ "compiler_std": "c++20",
+ "headers_path": ["/App/Modules/", "/App/Headers/"],
+ "sources_path": ["/App/Sources/*.cxx"]
+}