Skip to content

Repository files navigation

🔗 LuaSilverChain

GitHub release (latest by date)GitHubGitHub Repo starsLuaPlatform

The EASIEST way to organize your C projects using Lua!

A Lua wrapper for SilverChain - Now with the power and simplicity of Lua scripting! 🚀


🎯 What is LuaSilverChain? (Super Simple Explanation!)

Think of your C project as a messy toolbox with screws, nails, and tools scattered everywhere. 🧰

LuaSilverChain is like having a super-smart assistant that:

  1. Sorts everything by type (screws with screws, nails with nails) 📦
  2. Puts them in labeled drawers (dependencies, types, functions) 🗂️
  3. Does it all with simple Lua commands

🌟 Why LuaSilverChain vs Regular SilverChain?

🔧 Regular SilverChain🌙 LuaSilverChain
Command-line onlyLua scripting power!
Static configurationDynamic configuration
One-time executionIntegrate into Lua workflows
External toolNative Lua module

🤔 Perfect for:

  • 🎓 Students: Script your project builds with Lua
  • 🏢 Professional Development: Integrate into existing Lua build systems
  • 📚 Library Creators: Automate organization in your Lua tools
  • 🚀 DevOps: Add to your Lua automation scripts

📥 Download & Installation (Choose Your Adventure!)

🚨 Total Beginner? Start with the "🎮 Super Easy Installation" section below!

🎮 Super Easy Installation (One Command!)

Just want to use it RIGHT NOW? Copy and paste this magic command:

# 🪄 One-line installation magic!
curl -L https://github.com/OUIsolutions/LuaSilverChain/releases/download/0.1.1/LuaSilverChain.zip -o LuaSilverChain.zip && unzip LuaSilverChain.zip && rm LuaSilverChain.zip

🎉 That's it! You now have a LuaSilverChain folder with everything you need!

📁 What You Get (Release Files Explained!)

📁 File🎯 Best For📝 Description
📦 LuaSilverChain.zipMost UsersComplete module ready to use
🔧 silverchain_darwin_import.cDarwin buildersFor building with Darwin build system
📚 silverchain_full.cC developersFull implementation in one file
⚡ silverchain_no_dependecie_included.cMinimal setupsLightweight version

🚀 Alternative Installation Methods

🐧 Linux/Mac Users:

# Download and install in one go
wget https://github.com/OUIsolutions/LuaSilverChain/releases/download/0.1.1/LuaSilverChain.zip
unzip LuaSilverChain.zip
rm LuaSilverChain.zip

🪟 Windows Users (PowerShell):

# Download using PowerShellInvoke-WebRequest-Uri "https://github.com/OUIsolutions/LuaSilverChain/releases/download/0.1.1/LuaSilverChain.zip"-OutFile "LuaSilverChain.zip"Expand-Archive-Path "LuaSilverChain.zip"-DestinationPath "."Remove-Item"LuaSilverChain.zip"

🏃‍♂️ Quick Start Guide (For Total Beginners!)

Don't panic! This is easier than making instant coffee! ☕

🎬 Step 1: Your First LuaSilverChain Script (Hello World!)

Let's start with the simplest possible example:

Create a file called organize.lua:

-- 🌟 Your first LuaSilverChain script!localsilverchain=require("LuaSilverChain")
-- 🎯 Organize your project in one simple command!silverchain.generate({
src="my_project", -- 📁 Your source foldertags= {"dependencies", "functions"} -- 🏷️ Organization tags
})
print("🎉 Project organized successfully!")

Run it:

lua organize.lua

🤔 What just happened?

  • require("LuaSilverChain") → Load the magic! ✨
  • src = "my_project" → "Hey, look at this folder!"
  • tags = {...} → "Organize by dependencies first, then functions!"

🎬 Step 2: Real-World Example (Let's Build a Calculator!)

Imagine you have these files in your project:

awesome_calculator/
├── src/
│ ├── dependencies.headers.h ← All your #includes
│ ├── types.calculator.h ← Data types │ ├── functions.math.h ← Function declarations
│ ├── functions.math.c ← Function implementations
│ ├── functions.display.h ← Display function declarations
│ ├── functions.display.c ← Display implementations
│ └── main.c ← Your main program

🧑‍💻 What's in each file:

dependencies.headers.h:

#include<stdio.h>#include<stdlib.h>#include<math.h>

types.calculator.h:

#ifndefCALCULATOR_TYPES_H#defineCALCULATOR_TYPES_Htypedefstruct {
doubleresult;
charoperation;
} Calculator;
#endif

functions.math.h:

#ifndefMATH_FUNCTIONS_H#defineMATH_FUNCTIONS_Hdoubleadd(doublea, doubleb);
doublesubtract(doublea, doubleb);
#endif

functions.math.c:

doubleadd(doublea, doubleb) { returna+b; }
doublesubtract(doublea, doubleb) { returna-b; }

🚀 Now, let's organize everything with LuaSilverChain:

Create build_calculator.lua:

-- 🧮 Calculator Project Organizerlocalsilverchain=require("LuaSilverChain")
print("🚀 Organizing your awesome calculator...")
silverchain.generate({
src="awesome_calculator/src",
project_short_cut="CALC",
tags= {"dependencies", "types", "functions"},
implement_main=true,
main_name="calculator.c"
})
print("✅ Calculator organized!")
print("📁 Check the 'imports' folder for organized files.")
print("🎯 Main file created: calculator.c")

Run it:

lua build_calculator.lua

🎉 BOOM! Now you have an organized imports folder:

imports/
├── imports.dependencies.h ← All dependencies in one place
├── imports.types.h ← All types organized ├── imports.functions.h ← All function declarations
├── imports.functions.c ← All function implementations
└── calculator.c ← Your main file ready to go!

🎬 Step 3: Test It Yourself! (Interactive Tutorial)

Let's create a complete example from scratch:

1. Create the folder structure:

mkdir test_lua_silverchain
mkdir test_lua_silverchain/src
cd test_lua_silverchain

2. Create your C files:

src/dependencies.system.h:

#include<stdio.h>#include<string.h>

src/types.person.h:

#ifndefPERSON_TYPES_H#definePERSON_TYPES_Htypedefstruct {
charname[50];
intage;
} Person;
#endif

src/functions.person.h:

#ifndefPERSON_FUNCTIONS_H#definePERSON_FUNCTIONS_Hvoidprint_person(Personp);
Personcreate_person(constchar*name, intage);
#endif

src/functions.person.c:

voidprint_person(Personp) {
printf("Name: %s, Age: %d\n", p.name, p.age);
}
Personcreate_person(constchar*name, intage) {
Personp;
strcpy(p.name, name);
p.age=age;
returnp;
}

3. Create your Lua organizer script:

organize_person.lua:

-- 👤 Person Project Organizerlocalsilverchain=require("LuaSilverChain")
print("🚀 Organizing Person project...")
-- 🎯 Main organizationsilverchain.generate({
src="src",
project_short_cut="PERSON",
tags= {"dependencies", "types", "functions"},
implement_main=true,
main_name="person_demo.c"
})
print("✅ Person project organized!")
print("📁 Files created in 'imports' folder")
print("🎯 Main file: person_demo.c")
print("💻 Compile with: gcc person_demo.c imports/imports.functions.c -o person_demo")

4. Run your Lua script:

lua organize_person.lua

5. Compile and test:

gcc person_demo.c imports/imports.functions.c -o person_demo
./person_demo

🎉 Congratulations! You just used LuaSilverChain successfully!


⚙️ API Reference (All the Cool Features!)

🎯 Beginner Tip: Start with generate() function. Learn other features later!

🔥 Core Functions (You NEED These!)

silverchain.generate(options) - The Main Magic! ✨

This is your go-to function for organizing projects:

localsilverchain=require("LuaSilverChain")
silverchain.generate({
-- ✅ REQUIRED OPTIONSsrc="src", -- 📁 Source folder to organizetags= {"dependencies", "types", "functions"}, -- 🏷️ Organization tags (in order!)-- 🎛️ OPTIONAL OPTIONS (with defaults)project_short_cut="MYPROJECT", -- 📛 Project name for #ifndef guardsimplement_main=false, -- 🎯 Create main.c file?main_name="main.c", -- 📄 Name of main filemain_path=nil, -- 📍 Custom path to main fileimport_dir="imports" -- 📁 Where to save organized files
})

silverchain.remove(source_path) - Clean Up! 🧹

Remove the organized imports folder:

localsilverchain=require("LuaSilverChain")
-- 🗑️ Clean up the imports foldersilverchain.remove("src") -- This removes src/imports folderprint("🧹 Imports folder cleaned up!")

📋 Detailed Options Reference

🏷️ Option📝 Description🚨 Required?🔧 Default💡 Example
srcSource folder to organizeYES-"src"
tagsOrganization tags in orderYES-{"deps", "types", "funcs"}
project_short_cutProject prefix for guards❌ No"silverchain""MYCALC"
implement_mainCreate main.c file❌ Nofalsetrue
main_nameName of main file❌ No"main.c""calculator.c"
main_pathCustom main file path❌ Nonil"src/cli/main.c"
import_dirOutput directory❌ No"imports""organized"

🌟 Real-World Examples:

🥇 Beginner Example:

localsilverchain=require("LuaSilverChain")
-- 🎯 Simple organization - perfect for learning!silverchain.generate({
src="src",
tags= {"dependencies", "types", "functions"}
})

🥈 Intermediate Example:

localsilverchain=require("LuaSilverChain")
-- 🎛️ Custom configuration with main file creationsilverchain.generate({
src="my_project",
tags= {"deps", "consts", "types", "funcs"},
project_short_cut="MYPROJ",
implement_main=true,
main_name="myapp.c",
import_dir="organized_code"
})

🥉 Advanced Example:

localsilverchain=require("LuaSilverChain")
-- 🚀 Complex project with multiple modulessilverchain.generate({
src="src",
tags= {
"api_dependencies", "api_consts", "api_types", "api_globals",
"api_func_declaration", "api_func_definition",
"cli_dependencies", "cli_consts", "cli_globals", "cli_func_declaration", "cli_func_definition"
},
project_short_cut="ADVANCED_PROJ",
implement_main=true,
main_name="advanced_app.c",
main_path="src/cli/main.c"
})
print("🎉 Advanced project organized!")

🧠 How LuaSilverChain Works (The Magic Explained!)

🎯 Simple Version: LuaSilverChain takes your messy C files, sorts them by tags using Lua power, and creates organized imports! ✨

🏷️ The Tag System (Super Important!)

Tags work like organizing your digital photos:

  • dependencies → All your external libraries go in one album 📚
  • types → All your data structures go in another album 📊
  • functions → All your functions go in the final album 🔧

📋 Tag Processing Order Example:

localsilverchain=require("LuaSilverChain")
silverchain.generate({
src="src",
tags= {"dependencies", "consts", "types", "globals", "func_declaration", "func_definition"}
})

Processing happens in this exact order:

  1. dependencies → Files like dependencies.system.h get processed first
  2. consts → Then files like consts.math.h
  3. types → Then files like types.calculator.h
  4. globals → Then files like globals.config.h
  5. func_declaration → Then files like func_declaration.math.h
  6. func_definition → Finally files like func_definition.math.c

🔍 File Naming Convention (The Secret!)

LuaSilverChain looks for files that start with your tag name:

🏷️ Tag📁 Files It Will Find💡 Examples
dependenciesdependencies.*dependencies.system.h, dependencies.libs.h
typestypes.*types.person.h, types.calculator.h
functionsfunctions.*functions.math.c, functions.io.h

👀 Tag Vision (How Tags See Each Other)

This is the COOLEST part! Each tag can "see" all the previous tags:

tags= {"dependencies", "types", "functions"}
  • dependencies can see: Nothing (it's first)
  • types can see: dependencies
  • functions can see: dependencies + types

🌟 This means: Your function files can automatically use types and dependencies!


🎮 Interactive Examples & Tutorials

🌟 Complete Project Examples

📊 Example 1: Simple Math Library

Project Structure:

math_library/
├── src/
│ ├── dependencies.standard.h
│ ├── types.math.h
│ ├── functions.basic.h
│ ├── functions.basic.c
│ └── functions.advanced.h
└── build.lua

build.lua:

localsilverchain=require("LuaSilverChain")
print("📊 Building Math Library...")
silverchain.generate({
src="src",
project_short_cut="MATHLIB",
tags= {"dependencies", "types", "functions"},
implement_main=true,
main_name="math_demo.c"
})
print("✅ Math library organized!")
print("🎯 Demo file: math_demo.c")

🎮 Example 2: Game Engine Module

Advanced organization for game development:

localsilverchain=require("LuaSilverChain")
print("🎮 Organizing Game Engine...")
-- 🚀 Complex game engine organizationsilverchain.generate({
src="engine/src",
project_short_cut="GAMEENGINE",
tags= {
"engine_dependencies", -- SDL, OpenGL, etc."engine_types", -- GameObject, Vector3, etc."engine_globals", -- Global game state"graphics_declare", -- Graphics function declarations"graphics_define", -- Graphics implementations"audio_declare", -- Audio function declarations"audio_define", -- Audio implementations"input_declare", -- Input handling declarations"input_define" -- Input implementations
},
implement_main=true,
main_name="game.c",
import_dir="engine/organized"
})
print("🎉 Game engine organized!")
print("📁 Check 'engine/organized' folder")

🏢 Example 3: Enterprise Application

Professional project with automated build:

localsilverchain=require("LuaSilverChain")
-- 📋 Configurationlocalconfig= {
project_name="MyEnterpriseApp",
version="1.0.0",
src_dir="src",
output_dir="dist/organized"
}
print("🏢 Building " ..config.project_name.." v" ..config.version)
-- 🧹 Clean previous buildsilverchain.remove(config.src_dir)
-- 🏗️ Organize projectsilverchain.generate({
src=config.src_dir,
project_short_cut=string.upper(config.project_name),
tags= {
"system_dependencies",
"external_dependencies", "core_types",
"business_types",
"database_types",
"core_globals",
"business_globals",
"database_declare",
"database_define",
"business_declare", "business_define",
"api_declare",
"api_define"
},
implement_main=true,
main_name="enterprise_app.c",
import_dir=config.output_dir
})
print("✅ Enterprise application organized!")
print("📊 Project: " ..config.project_name)
print("📁 Output: " ..config.output_dir)

🔄 Build Automation Examples

Auto-Build Script

Create auto_build.lua for continuous integration:

localsilverchain=require("LuaSilverChain")
-- 🤖 Automated build pipelinefunctionbuild_project()
print("🚀 Starting automated build...")
-- 🧹 Step 1: Cleanprint("🧹 Cleaning previous build...")
silverchain.remove("src")
-- 🏗️ Step 2: Organizeprint("🏗️ Organizing source code...")
silverchain.generate({
src="src",
project_short_cut="AUTOBUILDER",
tags= {"dependencies", "consts", "types", "globals", "funcs"},
implement_main=true,
main_name="auto_app.c"
})
-- ✅ Step 3: Compile (if gcc available)print("⚙️ Attempting compilation...")
localcompile_result=os.execute("gcc auto_app.c imports/imports.funcs.c -o auto_app 2>/dev/null")
ifcompile_result==0thenprint("✅ Build successful! Executable: auto_app")
elseprint("⚠️ Organization complete, but compilation failed.")
print("💡 Please compile manually: gcc auto_app.c imports/imports.funcs.c -o auto_app")
endprint("🎉 Automated build complete!")
end-- 🏃‍♂️ Run the buildbuild_project()

🔄 Watch Mode Script

Create watch_build.lua for development mode:

localsilverchain=require("LuaSilverChain")
-- 📁 Configurationlocalwatch_config= {
src_dir="src",
check_interval=2, -- secondslast_modified=0
}
functionget_directory_modified_time(dir)
-- Simple modification detection (works on Unix-like systems)localhandle=io.popen("find " ..dir.." -type f -exec stat -c %Y {} \\; 2>/dev/null | sort -n | tail -1")
localresult=handle:read("*a")
handle:close()
returntonumber(result) or0endfunctionrebuild_project()
print("🔄 Changes detected! Rebuilding...")
silverchain.generate({
src=watch_config.src_dir,
project_short_cut="WATCHMODE",
tags= {"dependencies", "types", "functions"},
implement_main=true,
main_name="watch_app.c"
})
print("✅ Rebuild complete! " ..os.date("%H:%M:%S"))
endprint("👀 Watch mode started for '" ..watch_config.src_dir.."'")
print("🔄 Checking for changes every " ..watch_config.check_interval.." seconds...")
print("🛑 Press Ctrl+C to stop")
-- 🏃‍♂️ Initial buildrebuild_project()
watch_config.last_modified=get_directory_modified_time(watch_config.src_dir)
-- 👀 Watch loopwhiletruedolocalcurrent_modified=get_directory_modified_time(watch_config.src_dir)
ifcurrent_modified>watch_config.last_modifiedthenrebuild_project()
watch_config.last_modified=current_modifiedend-- 😴 Sleepos.execute("sleep " ..watch_config.check_interval)
end

🚨 Common Beginner Mistakes (And How to Avoid Them!)

MISTAKE 1: Wrong require path

Don't do this:

-- ❌ This will fail!localsilverchain=require("silverchain") -- Wrong name!

Do this instead:

-- ✅ Correct waylocalsilverchain=require("LuaSilverChain") -- Exact name!

MISTAKE 2: Missing required options

Don't do this:

-- ❌ This will fail - missing src and tags!silverchain.generate({
project_short_cut="MYPROJ"
})

Do this instead:

-- ✅ Always include src and tagssilverchain.generate({
src="src",
tags= {"dependencies", "functions"},
project_short_cut="MYPROJ"
})

MISTAKE 3: Wrong tag order

Don't do this:

-- ❌ Functions before dependencies - this can cause issues!silverchain.generate({
src="src",
tags= {"functions", "dependencies"} -- Wrong order!
})

Do this instead:

-- ✅ Dependencies first, then other tagssilverchain.generate({
src="src",
tags= {"dependencies", "types", "functions"} -- Logical order!
})

MISTAKE 4: Wrong file naming

Don't do this:

src/
├── my_dependencies.h ❌ Wrong prefix!
├── some_types.h ❌ Wrong prefix!
└── math_functions.c ❌ Wrong prefix!

Do this instead:

src/
├── dependencies.system.h ✅ Starts with tag name!
├── types.math.h ✅ Starts with tag name!
└── functions.math.c ✅ Starts with tag name!

MISTAKE 5: Not handling errors

Don't do this:

-- ❌ No error handling - script might crash silently!silverchain.generate({
src="nonexistent_folder",
tags= {"dependencies", "functions"}
})

Do this instead:

-- ✅ Handle potential errors gracefullylocalsuccess, error_msg=pcall(function()
silverchain.generate({
src="src",
tags= {"dependencies", "functions"}
})
end)
ifsuccessthenprint("✅ Project organized successfully!")
elseprint("❌ Error: " ..tostring(error_msg))
print("💡 Check if your src folder exists and has properly named files.")
end

🔧 Advanced Use Cases & Integration

🔗 Integration with Build Systems

Makefile Integration:

Makefile:

# 🏗️ Makefile with LuaSilverChain integration.PHONY: organize build clean
organize:
@echo "🚀 Organizing project..."
lua build_script.lua
build: organize
@echo "⚙️ Compiling..."
gcc main.c imports/imports.functions.c -o myapp
clean:
@echo "🧹 Cleaning..."
lua -e "require('LuaSilverChain').remove('src')"
rm -f myapp
all: build

build_script.lua:

localsilverchain=require("LuaSilverChain")
silverchain.generate({
src="src",
tags= {"dependencies", "types", "functions"},
implement_main=true,
main_name="main.c"
})

CMake Integration:

CMakeLists.txt:

cmake_minimum_required(VERSION3.10)
project(MyProject)
# 🚀 Custom target to organize codeadd_custom_target(organizeCOMMANDlua${CMAKE_CURRENT_SOURCE_DIR}/organize.luaWORKING_DIRECTORY${CMAKE_CURRENT_SOURCE_DIR}COMMENT"Organizing source code with LuaSilverChain"
)
# 📁 Add organized sourcesfile(GLOBORGANIZED_SOURCES"imports/*.c")
add_executable(myappmain.c${ORGANIZED_SOURCES})
# 🔗 Make sure organization happens before buildadd_dependencies(myapporganize)

🤖 Continuous Integration Examples

GitHub Actions Workflow:

.github/workflows/build.yml:

name: Build with LuaSilverChainon: [push, pull_request]jobs:
build:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v2
- name: Install Luarun: sudo apt-get install lua5.3
- name: Download LuaSilverChainrun: | curl -L https://github.com/OUIsolutions/LuaSilverChain/releases/download/0.1.1/LuaSilverChain.zip -o LuaSilverChain.zip unzip LuaSilverChain.zip - name: Organize Coderun: lua ci_build.lua
- name: Compilerun: gcc main.c imports/imports.functions.c -o myapp
- name: Testrun: ./myapp

ci_build.lua:

localsilverchain=require("LuaSilverChain")
print("🤖 CI Build - Organizing project...")
silverchain.generate({
src="src",
tags= {"dependencies", "types", "functions"},
implement_main=true,
main_name="main.c"
})
print("✅ CI Build - Organization complete!")

📦 Package Management Integration

With LuaRocks:

myproject-1.0-1.rockspec:

package="myproject"version="1.0-1"source= {
url="git://github.com/myuser/myproject.git"
}
dependencies= {
"lua >= 5.1"
}
build= {
type="make",
makefile="Makefile.luarocks",
build_variables= {
LUA_INCDIR="$(LUA_INCDIR)",
}
}

Makefile.luarocks:

# 📦 LuaRocks compatible Makefilebuild:
lua organize.lua
gcc main.c imports/imports.functions.c -o myproject
install:
cp myproject $(DESTDIR)$(BINDIR)/myproject
clean:
lua -e "require('LuaSilverChain').remove('src')"
rm -f myproject

🆘 Troubleshooting & FAQ

🔍 Common Issues & Solutions

Issue 1: "module 'LuaSilverChain' not found"

❌ Problem:

lua: errorloadingmodule'LuaSilverChain' fromfile'./LuaSilverChain.so':

✅ Solutions:

  1. Check installation:

    # Re-download the module
    curl -L https://github.com/OUIsolutions/LuaSilverChain/releases/download/0.1.1/LuaSilverChain.zip -o LuaSilverChain.zip && unzip LuaSilverChain.zip && rm LuaSilverChain.zip
  2. Check Lua path:

    # Make sure you're in the right directory
    ls -la LuaSilverChain/
    cd LuaSilverChain/ # Run lua from here
    lua your_script.lua
  3. Update package path in Lua:

    -- Add this at the top of your scriptpackage.path=package.path..";./LuaSilverChain/?.lua"package.cpath=package.cpath..";./LuaSilverChain/?.so"localsilverchain=require("LuaSilverChain")

Issue 2: "No files found with tag 'dependencies'"

❌ Problem: Your files aren't being found by LuaSilverChain.

✅ Solution: Check your file naming:

# ❌ Wrong naming
src/
├── includes.h # Should be: dependencies.includes.h
├── my_types.h # Should be: types.my_types.h
└── functions.c # Should be: functions.something.c# ✅ Correct naming 
src/
├── dependencies.includes.h
├── types.my_types.h
└── functions.math.c

Issue 3: Compilation errors after organization

❌ Problem:

gcc: error: undefined reference to 'my_function'

✅ Solutions:

  1. Include implementation files:

    # ❌ Missing .c files
    gcc main.c -o myapp
    # ✅ Include organized .c files
    gcc main.c imports/imports.functions.c -o myapp
  2. Check include order in main.c:

    // ✅ Correct order#include"imports/imports.dependencies.h"#include"imports/imports.types.h"#include"imports/imports.functions.h"intmain() {
    // Your code herereturn0;
    }

Frequently Asked Questions

Q: Can I use custom tag names?

A: Yes! You can use any tag names you want:

silverchain.generate({
src="src",
tags= {"libs", "structs", "apis", "utils"} -- Custom names!
})

Q: What's the best tag order for beginners?

A: Start simple:

tags= {"dependencies", "types", "functions"} -- Perfect for learning!

Q: Can I organize the same project multiple times?

A: Yes, but clean up first:

-- 🧹 Clean previous organizationsilverchain.remove("src")
-- 🚀 Organize againsilverchain.generate({
src="src",
tags= {"dependencies", "functions"}
})

Q: Does this work with C++?

A: LuaSilverChain is designed for C, but simple C++ might work. Try it:

silverchain.generate({
src="src",
tags= {"dependencies", "classes", "functions"} -- C++ style
})

Q: Can I have multiple source directories?

A: Process them separately:

-- Organize multiple directoriessilverchain.generate({src="core", tags= {"dependencies", "types"}})
silverchain.generate({src="plugins", tags= {"dependencies", "types"}})
silverchain.generate({src="tests", tags= {"dependencies", "tests"}})

Q: How do I integrate with my IDE?

A: Create a build task:

VS Code (tasks.json):

{
"version": "2.0.0",
"tasks": [
{
"label": "Organize with LuaSilverChain",
"type": "shell",
"command": "lua",
"args": ["organize.lua"],
"group": "build"
}
]
}

🔨 Building from Scratch (For Developers!)

🎯 Beginner Note: You don't need this section if you downloaded the ready-made module! This is only for people who want to compile LuaSilverChain themselves.

📋 Prerequisites (What You Need First)

You'll need these tools installed:

  1. 🦄 Darwin Build System (Version 0.020+)
  2. 🐧 Linux Environment (recommended)
  3. ⚙️ GCC Compiler
  4. 🌙 Lua Development Headers

🚀 Darwin Installation (One Command!)

# Install Darwin build system
curl -L https://github.com/OUIsolutions/Darwin/releases/download/0.7.0/darwin.out -o darwin.out && sudo chmod +x darwin.out && sudo mv darwin.out /usr/bin/darwin

📁 Clone and Build

# 1. Clone the repository
git clone https://github.com/OUIsolutions/LuaSilverChain.git
cd LuaSilverChain
# 2. Build the module
darwin run_blueprint build/ --mode folder
# 3. Test your build
lua -e "print(require('LuaSilverChain'))"

🧪 Development Build Commands

# 🔨 Development build
darwin run_blueprint build/ --mode folder
# 🧹 Clean build
rm -rf LuaSilverChain/ && darwin run_blueprint build/ --mode folder
# 🚀 Release build 
darwin run_blueprint build/ --mode folder amalgamation_build
# 🐞 Debug build
darwin run_blueprint build/ --mode folder --debug

🎯 Custom Build Configuration

Create custom_build.lua:

-- 🔧 Custom build script for developerslocalsilverchain=require("LuaSilverChain")
-- 🧪 Test the moduleprint("🧪 Testing LuaSilverChain module...")
-- Test basic functionalitysilverchain.generate({
src="test/src",
tags= {"dependencies", "functions"}
})
print("✅ Module test passed!")
-- Test removalsilverchain.remove("test/src")
print("✅ Removal test passed!")
print("🎉 All tests completed successfully!")

🎉 Success Stories & Community

🌟 Perfect For:

  • 🎓 Students: Script your C assignments with elegant Lua automation
  • 🏢 Professional Development: Integrate into existing Lua-based build pipelines
  • 📚 Library Creation: Automate organization in your Lua build tools
  • 🚀 DevOps Engineers: Add to your Lua automation and deployment scripts
  • 🎮 Game Developers: Organize game engine modules with Lua scripting power

💬 What Users Say:

"LuaSilverChain made organizing my C projects feel like magic! The Lua integration is perfect for my build scripts." - Game Developer

"Finally, I can automate SilverChain organization in my existing Lua workflows. This is exactly what I needed!" - DevOps Engineer

"The beginner examples are fantastic. I went from confused to confident in one afternoon!" - CS Student

🚀 Community Projects Using LuaSilverChain:

  • 🎮 Game Engine Builders: Automated asset pipeline organization
  • 🏢 Enterprise Tools: Lua-based build system integration
  • 📚 Educational Projects: Teaching C organization with Lua scripting
  • 🔧 DevOps Pipelines: Automated code organization in CI/CD

🔗 Related Projects & Ecosystem

🌟 The SilverChain Family:

🤝 Compatible Tools:


🆘 Need Help? (We've Got You Covered!)

🤝 Community Support

  • 🐛 Found a Bug?Create an Issue
  • 💡 Have a Feature Idea?Suggest It Here
  • ⭐ Like the Project? Give us a star on GitHub!
  • 📖 Need Documentation? You're reading the most comprehensive guide available!

📚 Learning Resources

💡 Quick Help Commands:

# 🆘 Get help quickly
lua -e "print('LuaSilverChain Help:\n- require(\"LuaSilverChain\").generate({src=\"src\", tags={\"deps\", \"funcs\"}})\n- require(\"LuaSilverChain\").remove(\"src\")')"# 🧪 Test installation
lua -e "local sc = require('LuaSilverChain'); print('✅ LuaSilverChain installed correctly!')"# 📋 List available functions
lua -e "for k,v in pairs(require('LuaSilverChain')) do print('🔧 ' .. k .. ': ' .. type(v)) end"

🌟 Ready to Organize Your C Code with Lua Power?

Made with ❤️ by OUIsolutions

Organizing C code with Lua magic, one script at a time! ✨🌙


📊 Quick Reference Card:

-- 🚀 Essential LuaSilverChain Commandslocalsc=require("LuaSilverChain")
-- ✨ Organize projectsc.generate({src="src", tags={"deps","types","funcs"}})
-- 🧹 Clean up sc.remove("src")
-- 🎯 Full configurationsc.generate({
src="src",
tags= {"dependencies", "types", "functions"},
project_short_cut="MYPROJ",
implement_main=true,
main_name="app.c"
})

🎉 Happy Coding!

About

a SilverChain Lua Wrapper

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages