Home

Awesome

Covariant Script Build System

schedule_release schedule
CSBuild is a system used for parallel building, automatic releasing and continues integration of official maintained packages.

Latest Release

v3.4.3-patch3 (updated on 2024.08.10)

Supported Operating System

PlatformArchitecturalToolchainInstallerBuild ToolPackage Tool
Microsoft Windowsx86, x86_64MinGW-w64Microsoft Installerauto-build.batpackage_tools/wix/make.bat
Canonical Ubuntux86, x86_64, ARM, MIPS64ELGCC, LLVM ClangDebian Packagerauto-build.shpackage_tools/deb/make.sh
Apple macOSx86_64Apple ClangApple Disk Imageauto-build.shpackage_tools/dmg/make.sh [--no-gui]

To build release version rather than nightly version, please add release argument when running build tool command.

Setup build environment

Windows

You need to install Git and CMake on your system first.

For building environment, please download official maintained MinGW-w64 environment.

Otherwise, you need to install libffi, libglfw3 and libcurl manually.

Linux

sudo apt install -y git cmake p7zip build-essential
sudo apt install -y libffi-dev unixodbc-dev libglfw3-dev libcurl4-openssl-dev

macOS

brew install git cmake wget p7zip
brew install glfw libffi unixodbc

Build your package with CSBuild

Step 1: Write your Package Description File

Package Description File Template:

{
    "Type": "Package",
    "Name": "test",
    "Info": "Test Package",
    "Author": "Anonymous",
    "Version": "1.0.0",
    "Target": "Path to your package(*.cse|*.csp)",
    "Source": "Path to your source file(*.cpp)",
    "Dependencies": []
}

Example:

{
    "Type": "Extension",
    "Name": "analysis_impl",
    "Info": "Data Analysis Implementation",
    "Author": "CovScript Organization",
    "Version": "1.1.0",
    "Source": "analysis_impl.cpp",
    "Target": "analysis_impl.cse",
    "Dependencies": []
}

Step 2: Put your json file into the csbuild folder of your repository

An legal csbuild folder should contains following files:

Step 3: Write your build script (for Extensions)

Build scripts are variable between different projects, but at least you should follow these basic rules:

Based on basic rules, a good build script should follow these rules additionally:

Example of CMakeLists.txt for CovScript Extension

cmake_minimum_required(VERSION 3.10)

project(covscript-regex)

if(DEFINED ENV{CS_DEV_PATH})
    include_directories($ENV{CS_DEV_PATH}/include)
    link_directories($ENV{CS_DEV_PATH}/lib)
endif()

if(DEFINED ENV{CS_DEV_OUTPUT})
    set(LIBRARY_OUTPUT_PATH $ENV{CS_DEV_OUTPUT})
    set(EXECUTABLE_OUTPUT_PATH $ENV{CS_DEV_OUTPUT})
endif()

# Compiler Options
set(CMAKE_CXX_STANDARD 14)

if (MSVC)
    set(CMAKE_CXX_FLAGS "/O2 /EHsc /utf-8 /w")
    set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
elseif (CMAKE_COMPILER_IS_GNUCXX)
    if (WIN32)
        set(CMAKE_C_FLAGS "--static -fPIC -s -O3")
        set(CMAKE_CXX_FLAGS "--static -fPIC -s -O3")
    else ()
        set(CMAKE_C_FLAGS "-fPIC -s -O3")
        set(CMAKE_CXX_FLAGS "-fPIC -s -O3")
    endif ()
else ()
    set(CMAKE_C_FLAGS "-fPIC -O3")
    set(CMAKE_CXX_FLAGS "-fPIC -O3")
endif ()

add_library(regex SHARED regex.cpp)

target_link_libraries(regex covscript)

set_target_properties(regex PROPERTIES OUTPUT_NAME regex)
set_target_properties(regex PROPERTIES PREFIX "")
set_target_properties(regex PROPERTIES SUFFIX ".cse")

We usually locate the development files via CS_DEV_PATH environment variable. If you are using Windows or Linux, the CS_DEV_PATH should be placed correctly with official CovScript Runtime Installer.

Step 4: Configure CSBuild

CSBuild have 3 phases: Fetch -> Build -> Install

1. Add your package to each phase of CSBuild

2. Test CSBuild script

Run auto-build.bat in Windows or auto-build.sh in Unix, wait for final output.

If CSBuild was configured correctly, you can see these output without error report.

...
csbuild: building package csdbc(1.0.1)...
...

Step 5: Submit to official CSBuild repository(Optional)

If your test runs smoothly and you want Official release including your package, you can submit your package to our official CSBuild repository via Pull Request.