Documentation ¶
Index ¶
- Constants
- Variables
- func Compile(packages *[]Package, src_file, output_dir string) bool
- func CopyDirectory(srcDir, dstDir string) ([]string, error)
- func CopyFile(src, dst string) error
- func CreateConfigFile(project_name, project_type string, targets []string) error
- func CreateDir(dir_path string) bool
- func DeleteFile(filePath string) bool
- func DetectCompiler(compiler string) bool
- func DetectInstalledCompilers(compilers []string) []string
- func DirExists(dir_path string) bool
- func FindPackage(package_name string) string
- func GetCompilerPath(compiler string) (string, error)
- func GetCompilerVersion(compiler string) (string, error)
- func GetInstalledPackages() *[]os.DirEntry
- func GetLogFile() *os.File
- func GetModLogs(log_file *os.File) *map[string]string
- func GetObjectFiles(object_files_dir string) *[]string
- func GetPackages(pkgconfig_dir_path string) (*[]Package, error)
- func GetVCPKG_ROOT() (string, error)
- func GetWorkDir() (string, error)
- func InstallPackage(package_name string)
- func IsCompiled(o_files []os.DirEntry, src_file_name string) bool
- func Link(project_type, target string, packages *[]Package, lib_dir_path string, ...) bool
- func PromptBool(question string) bool
- func PromptList(question string, options []string) string
- func PromptText(question string) string
- func SetGlobalPaths(pwd string)
- func SrcFileExist(src_files []os.DirEntry, o_file_name string) bool
- func UpdateConfigFile(project_config ProjectConfig) error
- type Package
- type ProjectConfig
Constants ¶
const ( O_EXT = ".o" C_EXT = ".c" CPP_EXT = ".cpp" TIME_FORMAT = "2006-01-02 15:04:05" DEFAULT_FILE_PERM = 0755 )
Variables ¶
var ( DefaultMainCPPFile = ` #include <iostream> int main(int argc, char** argv) { std::cout << "Hello, World!" << std::endl; return 0; } ` DefaultMainCFile = ` #include<stdio.h> int main(int argc, char** argv) { printf("Hello, World!"); return 0; } ` DefaultCommandGitignoreFile = ` build/* include/* lib/* ` )
file contents
var Dirs = map[string]string{
"Src_Dir_Path": "",
"Include_Dir_Path": "",
"Lib_Dir_Path": "",
"Lib_PkgConf_Dir_Path": "",
"Debug_Dir_Path": "",
"Debug_Lib_Dir_Path": "",
"Debug_Lib_PkgConf_Dir_Path": "",
"Debug_Bin_Dir_Path": "",
"Debug_Bin_O_Dir_Path": "",
"Debug_Bin_Out_Dir_Path": "",
"Build_Dir_Path": "",
"Build_Cache_Dir_Path": "",
"Build_Release_Dir_Path": "",
}
var Files = map[string]string{
"Debug_Bin_Log_File_Path": "",
"Config_File_Path": "",
}
var Work_Dir_Path = "" // ${Work_Dir_Path}
Functions ¶
func CopyDirectory ¶ added in v1.2.5
Copies and pastes all the contents inside of the directory from source to destination Args:
srcDir string source directory path dstDir string destination directory path
Returns:
array list of all items thats been copied error if error has occured while copying
func CopyFile ¶
Copies a file from source to destination Args:
src string source file path dst string destination file path
func CreateConfigFile ¶ added in v1.12.0
func CreateDir ¶ added in v1.12.0
Creates a directory in the specified path Args:
dir_path string the path where directory is supposed to be created
Returns:
true if directory created successfully false if error occured
func DeleteFile ¶ added in v1.14.0
Deletes a file Args:
filepath string path of the file thats supposed to be deleted
Returns:
true if file is succesfullly deleted false if not
func DetectCompiler ¶ added in v1.14.0
func DetectInstalledCompilers ¶ added in v1.12.0
Detects installed compilers Args:
compilers array list of compilers to detect Returns: array list of detected compilers
func DirExists ¶ added in v1.5.8
Checks it directory exists or not Returns:
true of directory exists false if not
func FindPackage ¶ added in v1.12.0
func GetCompilerPath ¶
Gets the compiler path Args:
compiler string compiler name Returns: string path of the compiler error if error occures
func GetCompilerVersion ¶
Get compiler version Args:
compiler string name of the compiler
Returns:
string version of the compiler error if error has occured
func GetInstalledPackages ¶ added in v1.12.0
func GetModLogs ¶ added in v1.12.0
Reads filemod.log file and maps the file names and their last modification time Args:
log_file *os.File
Returns:
map[file_name]last_modification_time
func GetPackages ¶ added in v1.12.0
func GetVCPKG_ROOT ¶ added in v1.12.0
func GetWorkDir ¶ added in v1.1.0
Gets the directory of the path where the application is running Returns:
string path error if error occurs
func InstallPackage ¶ added in v1.12.0
func InstallPackage(package_name string)
func IsCompiled ¶
Checks if file is present inside the list of object files Args:
o_files array list of object files src_file_name string name of the source file
Returns:
true if file is compiled false if not
func PromptBool ¶ added in v1.14.0
Prompts a question expects response to be in y or n
func PromptList ¶ added in v1.14.0
Prompts a list returns the selected item
func PromptText ¶ added in v1.14.0
Prompts a question expects the response to be a string
func SetGlobalPaths ¶ added in v1.12.0
func SetGlobalPaths(pwd string)
Sets all the paths of directories and files Args:
pwd string current directory path
func SrcFileExist ¶
Checks if file is present inside the list of source files Args:
src_files array list of source files o_file_name string name of the object file
Returns:
true if file is present false if not
func UpdateConfigFile ¶ added in v1.14.0
func UpdateConfigFile(project_config ProjectConfig) error
Types ¶
type Package ¶ added in v1.12.0
type Package struct { Name string `toml:"name"` Description string `toml:"description"` URL string `toml:"url"` Version string `toml:"version"` Libs string `toml:"libs"` Cflags string `toml:"cflags"` }
func ReadPCFile ¶ added in v1.12.0
type ProjectConfig ¶
type ProjectConfig struct { Project struct { Name string `toml:"name"` Description string `toml:"description"` Version string `toml:"version"` Type string `toml:"type"` } `toml:"project"` Build struct { OS string `toml:"os"` Arch string `toml:"arch"` Targets []string `toml:"targets"` } `toml:"build"` Packages []Package `toml:"packages"` }
func GetProjectConfig ¶ added in v1.3.1
func GetProjectConfig() (*ProjectConfig, error)