Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #46

Merged
merged 33 commits into from
Nov 7, 2023
Merged

Dev #46

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8276b72
Working on the new prompt api
DeaSTL Nov 4, 2023
c01eb1d
adding tab completion
sakheli Nov 4, 2023
591e32c
Finished implementation of cli api
DeaSTL Nov 4, 2023
13893ce
cli api works
DeaSTL Nov 4, 2023
51ab178
Merge pull request #40 from sakheli/main
DeaSTL Nov 4, 2023
d605336
Added man page
sakheli Nov 4, 2023
db1b651
Merge pull request #41 from sakheli/main
DeaSTL Nov 4, 2023
527e1c9
added functioning options to the cli promp api
DeaSTL Nov 5, 2023
f8940e3
added functioning options I guess again
DeaSTL Nov 5, 2023
c94977f
Merge branch 'dev' of github.com:DeaSTL/cmake-generator into dev
DeaSTL Nov 5, 2023
096534e
fixed cli api without options not working
DeaSTL Nov 5, 2023
38ac141
github actions fix
lsproule Nov 5, 2023
71ebab2
add nice json parsing?idkwhattocallit
lsproule Nov 5, 2023
0b91c28
add nice json parsing?idkwhattocallit
lsproule Nov 5, 2023
ef177cd
refactored Context to project
DeaSTL Nov 5, 2023
071de19
refactored tests
DeaSTL Nov 5, 2023
697ee95
did some refactors
DeaSTL Nov 5, 2023
8df56a8
just for diesel
Nov 5, 2023
1ff6be2
Delete DartConfiguration.tcl
DeaSTL Nov 5, 2023
257f0ec
added exit on failure to prompt api
DeaSTL Nov 5, 2023
affe841
Merge branch 'dev' of github.com:DeaSTL/cmake-generator into dev
DeaSTL Nov 5, 2023
231af02
added search command
DeaSTL Nov 5, 2023
d8450d9
added search command docs
DeaSTL Nov 5, 2023
a9e2bcd
Added git ignore and git init to init command
DeaSTL Nov 5, 2023
ab3afb3
fix clean script
lsproule Nov 5, 2023
1e7d7b5
Added debug mode for git init and gitignore for new projects
DeaSTL Nov 5, 2023
0f8fb26
fixed release build issue and refactored stuff
DeaSTL Nov 5, 2023
be6d33b
fix clean script
lsproule Nov 5, 2023
7afc8f7
remote builds templated out
lsproule Nov 6, 2023
5897052
remote builds templated out
lsproule Nov 6, 2023
c9ff583
remote builds templated out
lsproule Nov 6, 2023
2e3e12d
added project type
DeaSTL Nov 7, 2023
cb89ce0
templating stuff I guess
lsproule Nov 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dev-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: CMake on a single platform

on:
push:
pull_request:
branches: [ "dev" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
install_manifest.txt
build/*
build
.cache
.cache/*
.cmake
Makefile
DartConfiguration.txt
config.toml
CMakeFiles
CMakeCache.txt
Expand Down
2 changes: 1 addition & 1 deletion CLEAN_EVERYTHIN.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rm -rf ./_deps ./CMakeCache.txt ./CMakeFiles
rm -rf ./_deps ./CMakeCache.txt ./CMakeFiles build/*
make clean
rm -rf ./Makefile
sudo xargs rm -rf < install_manifest.txt
25 changes: 19 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,18 @@ FetchContent_Declare(
GIT_REPOSITORY "https://github.com/curl/curl.git"
GIT_TAG "curl-8_3_0"
)

FetchContent_Declare(
termcolor
GIT_REPOSITORY "https://github.com/ikalnytskyi/termcolor.git"
GIT_TAG "v2.1.0"
)
)

FetchContent_MakeAvailable(nlohmann_json)
FetchContent_MakeAvailable(cxxopts)
FetchContent_MakeAvailable(curl)
FetchContent_MakeAvailable(termcolor)




file(GLOB_RECURSE SOURCES RELATIVE ${CMAKE_SOURCE_DIR}
"src/**.cpp"
"src/**.c"
Expand Down Expand Up @@ -98,12 +96,27 @@ else()
endif()
endif()

target_link_libraries(${PROJECT_NAME} curl)
target_link_libraries(${PROJECT_NAME} libcurl)
target_link_libraries(${PROJECT_NAME} cxxopts)
target_link_libraries(${PROJECT_NAME} nlohmann_json)
target_link_libraries(${PROJECT_NAME} termcolor::termcolor)

set(SOURCE_DIR src)
set(BUILD_DIR build)
set_target_properties(cmaker PROPERTIES RUNTIME_OUTPUT_DIRECTORY build)
install(TARGETS cmaker DESTINATION bin)
install(FILES ./completions/cmaker-completion.zsh
DESTINATION /usr/local/share/zsh/site-functions/
RENAME _cmaker)
install(FILES ./completions/cmaker-completion.bash
DESTINATION /etc/bash_completion.d/
RENAME cmaker)
install(FILES ./completions/cmaker-completion.fish
DESTINATION /usr/share/fish/vendor_completions.d
RENAME cmaker.fish)

if(NOT DEFINED MAN_INSTALL_DIR)
set(MAN_INSTALL_DIR "share/man/man1")
endif()

add_custom_target(man ALL DEPENDS docs/man/cmaker.1)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/docs/man/cmaker.1" DESTINATION "${MAN_INSTALL_DIR}")
1 change: 0 additions & 1 deletion CTestTestfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# testing this directory and lists subdirectories to be tested as well.
subdirs("_deps/nlohmann_json-build")
subdirs("_deps/cxxopts-build")
subdirs("_deps/tomlplusplus-build")
subdirs("_deps/curl-build")
subdirs("_deps/termcolor-build")
subdirs("_deps/catch2-build")
106 changes: 0 additions & 106 deletions DartConfiguration.tcl

This file was deleted.

33 changes: 33 additions & 0 deletions completions/cmaker-completion.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
_cmaker() {
local cur prev words cword
_get_comp_words_by_ref -n : cur prev words cword

local commands="init run watch add ftp help"
local add_subcommands="dep lib flags"

case "${prev}" in
add)
COMPREPLY=($(compgen -W "${add_subcommands}" -- "${cur}"))
return 0
;;
esac

case "${words[1]}" in
add)
if [ "$cword" -eq 2 ]; then
COMPREPLY=($(compgen -W "${add_subcommands}" -- "${cur}"))
return 0
fi
;;
*)
if [ "$cword" -eq 1 ]; then
COMPREPLY=($(compgen -W "${commands}" -- "${cur}"))
return 0
fi
;;
esac

COMPREPLY=()
}

complete -F _cmaker cmaker
27 changes: 27 additions & 0 deletions completions/cmaker-completion.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
function __fish_cmaker_needs_command
set -l cmd (commandline -opc)
if test (count $cmd) -eq 1
return 0
end
return 1
end

function __fish_cmaker_using_command
set -l cmd (commandline -opc)
set -e cmd[1]
if contains -- $argv[1] $cmd
return 0
end
return 1
end

function __fish_cmaker_needs_subcommand
set -l cmd (commandline -opc)
if test (count $cmd) -eq 2
return 0
end
return 1
end

complete -c cmaker -n '__fish_cmaker_needs_command' -a 'init run watch add ftp help' -f
complete -c cmaker -n '__fish_cmaker_using_command add' -a 'dep lib flags' -f
44 changes: 44 additions & 0 deletions completions/cmaker-completion.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#compdef cmaker

_cmaker() {
local state
local -a options
local -a cmd

_arguments -C \
'1: :->command' \
'2: :->subcommand' \
'*::arg:->args'

options=(
'init:Initializes your project'
'run:Builds and runs your project'
'watch:Watches builds and runs your project on changes'
'add:[dep, lib, flags] Add library, dependecy or flags to your project'
'ftp:Delets the entire project (F*ck this project)'
'help:Print help'
)

add_options=(
'dep:Add a dependecy <dep>'
'lib:Add a library <lib>'
'flags:Add a flag <flag>'
)

case $state in
command)
_describe -t commands "command" options
;;
subcommand)
case $words[2] in
add)
_describe -t subcommands "subcommand" add_options
esac
;;
args)
# Leaving empty for now
;;
esac
}

_cmaker "$@"
61 changes: 61 additions & 0 deletions docs/man/cmaker.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.TH "cmaker" "1" "2023-11-05" "cmaker" "cmaker manual"
.SH "NAME"
\fBcmaker - c/cpp package manager\fR
.SH SYNOPSIS
.P
\fBcmaker <sub\-command>\fR
.SH DESCRIPTION
.P
\fBCmaker\fR came to fruition out of the desperate hopes and dreams of a few people looking to softly lighten their suffering while using c++\.
.SH init
.P
Initializes your project\. You'll be prompted with information to enter and cmaker will take care of the rest\.
.br
This will create a cmake file, 1 source file in src directory and config\.toml, where cmaker specific configuration is stored\.
.SS options
.SS \-y | \-\-skip\-init
.P
Skips initialization\.
.SS \-n | \-\-name example\-name
.P
Name of your project
.SS \-l | \-\-language cpp/c
.P
Language of your choice, c or cpp\.
.SH run
.P
Builds and runs your project\.
.SH watch
.P
Same a run command, but also watches file changes and rebuilds your project accordingly\.
.SH add
.P
This command adds a dependency, library or flag to your project\.
.br
\fBSubcommands:\fR
.SS dep
.P
Searches and adds dependency to your project\.
.br
Example:
.RS 2
.nf
cmaker add dep sdl
.fi
.RE
.P
You'll be shown found results and will be promted to choose from the list\.
.SS lib
.P
Searches and adds library to your project\.
.SS flags
.P
Adds flag to your project\.
.SH ftp
.P
Deletes the entire project :)\.
.br
Why?
.br
Why not?

Loading