diff --git a/.gitea/workflows/work.yml b/.gitea/workflows/work.yml index 3f49b89..9ccb7b8 100644 --- a/.gitea/workflows/work.yml +++ b/.gitea/workflows/work.yml @@ -38,7 +38,7 @@ jobs: mkdir artifacts mkdir build cd build - cmake -S .. -B . -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} + cmake -S .. -B . -DTESSESFRAMEWORK_STATIC=ON -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} make mv myapp ../artifacts/myapp-${{ matrix.arch }} - uses: akkuman/gitea-release-action@v1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c795b05 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 5be6c73..abf0d63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,4 +2,15 @@ cmake_minimum_required(VERSION 3.16) project(myapp) -add_executable(myapp myapp.c) \ No newline at end of file +include(FetchContent) + +FetchContent_Declare( + tessesframework + GIT_REPOSITORY https://git.tesses.org/tesses50/tessesframework.git +) + +FetchContent_MakeAvailable(tessesframework) + +add_executable(myapp myapp.cpp) + +target_link_libraries(myapp PRIVATE tessesframework) \ No newline at end of file diff --git a/myapp.c b/myapp.c deleted file mode 100644 index 0faa3e5..0000000 --- a/myapp.c +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int main(int argc, char** argv) -{ - printf("Hello, world\n"); - return 0; -} \ No newline at end of file diff --git a/myapp.cpp b/myapp.cpp new file mode 100644 index 0000000..1b57666 --- /dev/null +++ b/myapp.cpp @@ -0,0 +1,34 @@ +#include + +int main(int argc, char** argv) +{ + Tesses::Framework::TF_Init(); + + using namespace Tesses::Framework::Http; + using namespace Tesses::Framework::Serialization::Json; + + auto packages = DownloadToStringSimple("https://cpkg.tesseslanguage.com/api/v1/search"); + + auto json = Json::Decode(packages); + + JObject jdict; + JArray ja; + + if(TryGetJToken(json,jdict)) + { + if(jdict.TryGetValueAsType("packages",ja)) + { + for(auto item : ja) + { + if(TryGetJToken(item, jdict)) + { + std::string packageName; + if(jdict.TryGetValueAsType("packageName",packageName)) + { + std::cout << packageName << std::endl; + } + } + } + } + } +} \ No newline at end of file