Skip to content

Commit da6f8fb

Browse files
committed
Add sources
1 parent 87d5195 commit da6f8fb

44 files changed

Lines changed: 3230 additions & 47 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
# We'll use defaults from the LLVM style, but with 4 columns indentation.
3+
BasedOnStyle: LLVM
4+
IndentWidth: 3
5+
ColumnLimit: 150

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
[*]
5+
end_of_line = crlf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
tab_width = 3
9+
10+
[{*.sh,dockcross,docker-wine}]
11+
end_of_line = lf
12+
13+
[*.{c,h,yml}]
14+
tab_width = 3

.github/workflows/CI.yml

Lines changed: 163 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,163 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
4-
name: Run FileOp CI
5-
6-
on:
7-
workflow_dispatch: # For manual triggering
8-
push:
9-
branches:
10-
- main
11-
pull_request:
12-
types: [opened, synchronize, reopened, edited]
13-
14-
jobs:
15-
16-
spell-check:
17-
runs-on: ubuntu-22.04
18-
steps:
19-
- uses: actions/checkout@v4
20-
- name: Install spellchecker
21-
run:
22-
npm install -g cspell@latest
23-
- name: Run spellchecker
24-
run: |
25-
cspell
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Run FileOp CI
5+
6+
on:
7+
workflow_dispatch: # For manual triggering
8+
push:
9+
branches:
10+
- main
11+
pull_request:
12+
types: [opened, synchronize, reopened, edited]
13+
14+
defaults:
15+
run:
16+
shell: bash
17+
18+
jobs:
19+
20+
spell-check:
21+
runs-on: ubuntu-22.04
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Install spellchecker
25+
run:
26+
npm install -g cspell@8.19.4
27+
- uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46
28+
id: changed-files
29+
with:
30+
separator: ","
31+
- name: Run spellchecker
32+
run: |
33+
# Run spellchecker with changed files
34+
mapfile -d ',' -t added_modified_files < <(printf '%s,' '${{ steps.changed-files.outputs.all_changed_and_modified_files }}')
35+
cspell --config cspell.json --color --show-suggestions "${added_modified_files[@]}"
36+
37+
container-build:
38+
needs:
39+
- spell-check
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
BuildType:
44+
- Profile
45+
- Release
46+
runs-on: ubuntu-24.04
47+
container:
48+
image: dockcross/windows-static-x64
49+
50+
steps:
51+
- name: Install git
52+
run: |
53+
export DEBIAN_FRONTEND=noninteractive
54+
apt update
55+
apt install -y git
56+
- uses: actions/checkout@v4
57+
58+
- name: Configure
59+
run: |
60+
git config --global --add safe.directory $PWD
61+
./scripts/cmake.configure.sh -DCMAKE_BUILD_TYPE=${{ matrix.BuildType }}
62+
- name: Build
63+
run:
64+
./scripts/cmake.build.sh
65+
66+
- name: Upload ZIP
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: app-container${{ matrix.BuildType == 'Profile' && '-profile' || ''}}
70+
path: build/FileOp.7z
71+
72+
build:
73+
needs:
74+
- spell-check
75+
strategy:
76+
fail-fast: false
77+
matrix:
78+
BuildType:
79+
- Profile
80+
- Release
81+
runs-on: Windows-latest
82+
83+
steps:
84+
- uses: actions/checkout@v4
85+
- name: Install ninja
86+
run: choco install ninja
87+
- name: Install gcovr
88+
if: ${{ matrix.BuildType == 'Profile' }}
89+
run: pip install git+https://github.com/gcovr/gcovr.git # gcovr==8.3
90+
91+
- name: Configure
92+
run: ./scripts/cmake.configure.sh -DCMAKE_BUILD_TYPE=${{ matrix.BuildType }}
93+
- name: Build
94+
run: ./scripts/cmake.build.sh
95+
- name: Test
96+
run: |
97+
./scripts/cmake.test.sh || ExitCode=$?
98+
echo "::group::build/Testing/Temporary/LastTest.log"
99+
cat build/Testing/Temporary/LastTest.log
100+
echo "::endgroup::"
101+
exit $ExitCode
102+
- name: Run performance test
103+
if: always()
104+
run: ./scripts/run_test_performance.sh 2>&1 | tee performance.txt
105+
106+
- name: Create coverage report
107+
if: ${{ matrix.BuildType == 'Profile' && always() }}
108+
run: |
109+
gcovr \
110+
--filter src/ \
111+
--exclude-noncode-lines build \
112+
--txt coverage.txt \
113+
--markdown coverage.md --markdown-title "Test coverage report" --markdown-file-link 'https://github.com/Spacetown/FileOp/blob/${{ github.sha }}/{file}' \
114+
--json coverage.json --json-pretty \
115+
--html-single-page --html-title "GCOVR report for $(git rev-parse HEAD)" --html-details coverage.html
116+
cat coverage.txt
117+
gcovr --fail-under-line 100.0 --add-tracefile coverage.json > /dev/null
118+
- name: Upload coverage report
119+
if: ${{ matrix.BuildType == 'Profile' && always() }}
120+
uses: actions/upload-artifact@v4
121+
with:
122+
name: coverage
123+
path: coverage.*
124+
125+
- name: Upload ZIP
126+
if: always()
127+
uses: actions/upload-artifact@v4
128+
with:
129+
name: app-windows${{ matrix.BuildType == 'Profile' && '-profile' || ''}}
130+
path: build/FileOp.7z
131+
132+
- name: Add job summary
133+
if: ${{ matrix.BuildType == 'Profile' && always() }}
134+
run: |
135+
(
136+
cat coverage.md
137+
echo ""
138+
cat performance.txt
139+
) >> $GITHUB_STEP_SUMMARY
140+
141+
deploy:
142+
needs:
143+
- container-build
144+
- build
145+
runs-on: Windows-latest
146+
steps:
147+
- name: Download artifacts
148+
uses: actions/download-artifact@v4
149+
with:
150+
pattern: app-*
151+
# cspell:ignore oapp
152+
- name: Test container release build
153+
run: |
154+
7z x -oapp-container app-container/FileOp.7z
155+
./app-container/FileOp.exe --help
156+
- name: Test windows release build
157+
run: |
158+
7z x -oapp-windows app-windows/FileOp.7z
159+
./app-windows/FileOp.exe --help
160+
- name: Test windows profile build
161+
run: |
162+
7z x -oapp-windows-profile app-windows-profile/FileOp.7z
163+
./app-windows-profile/FileOp.exe --help

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.venv/
2+
/build/
3+
/dockcross

Changelog.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
2+
# Changelog
3+
4+
<!-- cspell:ignore INFDTEP -->
5+
6+
## Unreleased
7+
8+
- First release under BSD 3-Clause License.
9+
- Use CMake and cross compiling with gcc-11.
10+
11+
## 1.8.0
12+
13+
- INFDTEP-2374
14+
- Always use English system error messages.
15+
- INFDTEP-2099
16+
- Add check for unique file names
17+
18+
## 1.7.3
19+
20+
- INFDTEP-2128
21+
- Fix crash if tool is called with /.
22+
23+
## 1.7.2
24+
25+
- INFDTEP-2097
26+
- Fix handling of response files bigger than buffer (0x1FFFF).
27+
28+
## 1.7.1
29+
30+
- INFDTEP-2088
31+
- Fix option `--touch` for `copy` and `move` command. If several
32+
files are copied or moved the target file of the operation was
33+
always the first target file.
34+
35+
## 1.7.0
36+
37+
- INFDTEP-1729
38+
- Add batch to tag tool.
39+
- Fix link to pull request.
40+
- INFDTEP-1992
41+
- Add support for response files.
42+
- INFDTEP-2081
43+
- Add touch command.
44+
- Add option `--touch` to `copy` and `move` commands.
45+
- Restructure tests.
46+
47+
## 1.6.1
48+
49+
- INFDTEP-1550
50+
- Fix crash if given command is unknown.
51+
52+
## 1.6.0
53+
54+
- INFDTEP-1424
55+
- Remove the flush of the buffer in the cat command.
56+
57+
## 1.5.0
58+
59+
- INFDTEP-1404
60+
- Implement option `--target-directory`.
61+
- Internal redesign: Put each command into a single source file.
62+
63+
## 1.4.0
64+
65+
- INFDTEP-1349
66+
- Implement `cat`, `type` and `move` command.
67+
68+
- INFDTEP-1350
69+
- Update to new version of 000_ToolCommon.
70+
71+
## 1.3.0
72+
73+
- INFDTEP-1261
74+
- Update help output and change documentation to markdown file.
75+
76+
- INFDTEP-1262
77+
- Add Jenkinsfile and shell scripts to build.
78+
79+
## 1.2.0
80+
81+
- INFDTEP-1140
82+
83+
- Add support for reparse points (junctions).
84+
- The `remove` command removes the reparse point. The `copy` command copies the content of the reparse point.
85+
86+
## 1.1.0
87+
88+
- INFDTEP-1077
89+
- Add support for wildcard in paths except `mkdir` command and the target for the `copy` command.
90+
- Add version information to PE header of executable.
91+
92+
## 1.0.0
93+
94+
- INFDTEP-1058
95+
- First implementation of FileOp.exe.

FileOp.code-workspace

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "."
5+
}
6+
],
7+
"settings": {
8+
"actionButtons": {
9+
"commands": [
10+
{
11+
"name": "Setup env",
12+
"command": "docker run --rm --platform linux/amd64 dockcross/windows-static-x64 > ./dockcross && chmod +x ./dockcross",
13+
"singleInstance": true
14+
},
15+
{
16+
"name": "Configure (Profile)",
17+
"command": "./dockcross --args '--platform linux/amd64' bash -c './scripts/cmake.configure.sh -DCMAKE_BUILD_TYPE=Profile'",
18+
"singleInstance": true
19+
},
20+
{
21+
"name": "Configure (Release)",
22+
"command": "./dockcross --args '--platform linux/amd64' bash -c './scripts/cmake.configure.sh -DCMAKE_BUILD_TYPE=Release'",
23+
"singleInstance": true
24+
},
25+
{
26+
"name": "Build",
27+
"command": "./dockcross --args '--platform linux/amd64' bash -c './scripts/cmake.build.sh'",
28+
"singleInstance": true
29+
}
30+
],
31+
"defaultColor": "white",
32+
"reloadButton": "",
33+
"loadNpmCommands": false
34+
},
35+
"editor.formatOnSave": true
36+
},
37+
"extensions": {
38+
// cspell:disable
39+
"recommendations": [
40+
"seunlanlege.action-buttons",
41+
"streetsidesoftware.code-spell-checker",
42+
"EditorConfig.EditorConfig",
43+
"ms-vscode.cpptools-extension-pack"
44+
]
45+
// cspell:enable
46+
}
47+
}

LICENSE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2024, ZF-Group
3+
Copyright (c) 2020-2025, ZF-Group
4+
Copyright (c) 2025, FileOp authors
45

56
Redistribution and use in source and binary forms, with or without
67
modification, are permitted provided that the following conditions are met:

0 commit comments

Comments
 (0)