Skip to content

Commit

Permalink
回滚
Browse files Browse the repository at this point in the history
有个dll就有个吧(
  • Loading branch information
undefined-ux committed Dec 16, 2023
1 parent b146662 commit 68208dd
Show file tree
Hide file tree
Showing 23 changed files with 1,599 additions and 1,600 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,18 @@ jobs:
- name: set up Msys2
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
msystem: ucrt64
install: >-
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-cmake
libiconv-devel
cmake
gcc
ninja
pkg-config
- name: build
shell: msys2 {0}
run: |
mkdir build && cd build
export CC=gcc
cmake -G Ninja -DCMAKE_BUILD_TYPE=DEBUG .. && cmake --build .
- uses: actions/upload-artifact@v3
Expand Down
134 changes: 67 additions & 67 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
on:
workflow_dispatch:
push:
branches:
- master


jobs:
check-release:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Check Release Commit
run: |
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/master" ]]; then
releaseField=$(git log -1 --pretty=format:'%B' | grep -oE 'RELEASE: [^\n]+' | cut -d' ' -f2)
if [[ -n "$releaseField" ]]; then
echo "Release field found. Continuing with subsequent jobs."
else
echo "No release field found. Exiting with code 78."
exit 78 # Exit code 78 skips subsequent jobs
fi
else
echo "Not a push to master branch. Exiting with code 78."
exit 78 # Exit code 78 skips subsequent jobs
fi
shell: bash
build-linux:
needs: check-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: build
run: |
mkdir build && cd build && cmake -G Ninja -DCMAKE_BUILD_TYPE=RELEASE .. && cmake --build .
- uses: actions/upload-artifact@v3
with:
name: linux
path: build/json
build-windows:
needs: check-release
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: set up Msys2
uses: msys2/setup-msys2@v2
with:
msystem: ucrt64
install: >-
libiconv-devel
cmake
gcc
ninja
pkg-config
- name: build
shell: msys2 {0}
run: |
mkdir build && cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=RELEASE .. && cmake --build .
- uses: actions/upload-artifact@v3
with:
name: windows
on:
workflow_dispatch:
push:
branches:
- master


jobs:
check-release:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Check Release Commit
run: |
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/master" ]]; then
releaseField=$(git log -1 --pretty=format:'%B' | grep -oE 'RELEASE: [^\n]+' | cut -d' ' -f2)
if [[ -n "$releaseField" ]]; then
echo "Release field found. Continuing with subsequent jobs."
else
echo "No release field found. Exiting with code 78."
exit 78 # Exit code 78 skips subsequent jobs
fi
else
echo "Not a push to master branch. Exiting with code 78."
exit 78 # Exit code 78 skips subsequent jobs
fi
shell: bash
build-linux:
needs: check-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: build
run: |
mkdir build && cd build && cmake -G Ninja -DCMAKE_BUILD_TYPE=RELEASE .. && cmake --build .
- uses: actions/upload-artifact@v3
with:
name: linux
path: build/json
build-windows:
needs: check-release
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: set up Msys2
uses: msys2/setup-msys2@v2
with:
msystem: ucrt64
install: >-
libiconv-devel
cmake
gcc
ninja
pkg-config
- name: build
shell: msys2 {0}
run: |
mkdir build && cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=RELEASE .. && cmake --build .
- uses: actions/upload-artifact@v3
with:
name: windows
path: build/json.exe
22 changes: 11 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.vs/
.idea/
x64/
cmake-build-debug/
cmake-build-release/
cmake-build-debug-mingw/
*.pdb

lcui-quick-start.zip
package-lock.json
-g/
.vs/
.idea/
x64/
cmake-build-debug/
cmake-build-release/
cmake-build-debug-mingw/
*.pdb

lcui-quick-start.zip
package-lock.json
-g/
build/
114 changes: 56 additions & 58 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,59 +1,57 @@
cmake_minimum_required(VERSION 3.27)

PROJECT(JsonParser C)
set(CMAKE_C_STANDARD 17)

find_package(Iconv REQUIRED)
add_definitions(-DLOCALEDIR="\"${CMAKE_INSTALL_PREFIX}/share/locale\"")


add_library(jsonParserLib
core/Json.h
core/parser/parser.h
core/types/JsonValue.h
core/types/JsonArray.h
core/types/JsonObject.h
core/types/JsonString.h
core/utils/outputer.h
core/utils/outputer.c
core/parser/parser.c
core/types/JsonValue.c
core/types/JsonArray.c
core/types/JsonObject.c
core/types/JsonString.c
)
target_link_libraries(jsonParserLib PRIVATE Iconv::Iconv)

add_executable(json
cli/main.c
)
target_include_directories(json PRIVATE
core
)
target_link_libraries(json PRIVATE
jsonParserLib
)

add_library(cutest
cutest/CuTest.h
cutest/CuTest.c
)

add_executable(string_test
test/stringTest.c
)

target_include_directories(string_test PRIVATE
core
cutest
)
target_link_libraries(string_test PRIVATE
cutest
jsonParserLib
)

enable_testing()
add_test(
NAME "String Test"
COMMAND string_test
cmake_minimum_required(VERSION 3.27)

PROJECT(JsonParser C)
set(CMAKE_C_STANDARD 17)

find_package(Iconv REQUIRED)

add_library(jsonParserLib
core/Json.h
core/parser/parser.h
core/types/JsonValue.h
core/types/JsonArray.h
core/types/JsonObject.h
core/types/JsonString.h
core/utils/outputer.h
core/utils/outputer.c
core/parser/parser.c
core/types/JsonValue.c
core/types/JsonArray.c
core/types/JsonObject.c
core/types/JsonString.c
)
target_link_libraries(jsonParserLib PRIVATE Iconv::Iconv)

add_executable(json
cli/main.c
)
target_include_directories(json PRIVATE
core
)
target_link_libraries(json PRIVATE
jsonParserLib
)

add_library(cutest
cutest/CuTest.h
cutest/CuTest.c
)

add_executable(string_test
test/stringTest.c
)

target_include_directories(string_test PRIVATE
core
cutest
)
target_link_libraries(string_test PRIVATE
cutest
jsonParserLib
)

enable_testing()
add_test(
NAME "String Test"
COMMAND string_test
)
50 changes: 25 additions & 25 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
The MIT License (MIT)
=====================
Copyright © `2023` `undefined-ux`


Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
The MIT License (MIT)
=====================
Copyright © `2023` `undefined-ux`


Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# 大一 C语言大作业

## json解析器

[下载](https://github.com/undefined-ux/json-parser-homework/releases) [CI构建](https://github.com/undefined-ux/json-parser-homework/actions)

[文档](https://undefined-ux.github.io/json-parser-homework)
### 命令行版本
#### 使用
```
如果未指定输入或输出文件,则程序将默认使用标准输入或标准输出。
注意:-c / --compress 和 -f / --format 选项不能同时使用
-if, --input 指定输入文件(默认为标准输入)
-of, --output 指定输出文件(默认为标准输出)
-f, --format 使用树形缩进输出格式化的JSON
-h, --help 显示此帮助并退出
-c, --compress 输出压缩的JSON
-u, --utf 启用utf-8编码支持
```

### GUI
<del>GUI目前仍然是饼, 没做</del>
# 大一 C语言大作业

## json解析器

[下载](https://github.com/undefined-ux/json-parser-homework/releases) [CI构建](https://github.com/undefined-ux/json-parser-homework/actions)

[文档](https://undefined-ux.github.io/json-parser-homework)
### 命令行版本
#### 使用
```
如果未指定输入或输出文件,则程序将默认使用标准输入或标准输出。
注意:-c / --compress 和 -f / --format 选项不能同时使用
-if, --input 指定输入文件(默认为标准输入)
-of, --output 指定输出文件(默认为标准输出)
-f, --format 使用树形缩进输出格式化的JSON
-h, --help 显示此帮助并退出
-c, --compress 输出压缩的JSON
-u, --utf 启用utf-8编码支持
```

### GUI
<del>GUI目前仍然是饼, 没做</del>
Loading

0 comments on commit 68208dd

Please sign in to comment.