Skip to content

Commit

Permalink
Merge pull request #34 from wsjcpp/version-0.2.2
Browse files Browse the repository at this point in the history
Version 0.2.2
  • Loading branch information
sea-kg authored Sep 5, 2021
2 parents 8cf7f98 + dd9b0a7 commit b445f0c
Show file tree
Hide file tree
Showing 16 changed files with 398 additions and 120 deletions.
10 changes: 2 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ branches:
only:
- master

dist: bionic
dist: focal

addons:
apt:
Expand All @@ -16,10 +16,4 @@ addons:

# Build steps
script:
- mkdir -p tmp
- cd tmp
- cmake ..
- make
- cd ../unit-tests.wsjcpp
- ./build_simple.sh
- ./run_unit-tests.sh
- ./ci/travis/run.sh
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Changelog

All notable changes to wsjcpp-core project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [v0.2.2] - 2021-09-04 (2021 Sept 4)

### Added

- Added test for normalize path
- Added test case for replace all
- Added build_simple.bat for windows
- Added WsjcppCore::makeDirsPath
- Added WsjcppCore::extractDirpath

### Changed

- Up c++ to version 17 (need for std::filesystem)
- Redesign getListOfDisrs to using crossplatform std::filesystem

### Fixed

- Fixed setFilePermissions
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/src.wsjcpp/CMakeLists.txt)
#### BEGIN_WSJCPP_APPEND
#### END_WSJCPP_APPEND

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(EXECUTABLE_OUTPUT_PATH ${wsjcpp-core_SOURCE_DIR})

# Sources
Expand Down
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,21 @@ std::string sPath = WsjcppCore::doNormalizePath(".//../bin/some/../");
Extract base filename from fullpath.

```
std::string sFilename = WsjcppCore::doNormalizePath(".//../bin/some/../file.txt");
std::string sFilename = WsjcppCore::extractFilename(".//../bin/some/../file.txt");
```

Variable `sFilename` will has value `file.txt`

### extractDirpath

Extract base dir path from fullpath.

```
std::string sDirpath = WsjcppCore::extractDirpath(".//../bin/some/../file.txt");
```

Variable `sDirpath` will has value `.//../bin/some/..`

### getCurrentDirectory

```
Expand Down Expand Up @@ -181,6 +193,16 @@ if (WsjcppCore::makeDir(sDirname)) {
}
```

### makeDirsPath

Create a new directories full path
```
std::string sDirsPath = "./data/dir1/dir1/dir3";
if (WsjcppCore::makeDirsPath(sDirname)) {
std::cout << " Created '" << sDirsPath << "'" << std::endl;
}
```

### writeFile

```
Expand Down
19 changes: 19 additions & 0 deletions build_simple.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@echo off

endlocal
setlocal

echo Prepare configuration
cmake -H. -Btmp
if %ERRORLEVEL% GEQ 1 (
echo "cmake configure"
EXIT /B 1
)

cmake --build tmp
if %ERRORLEVEL% GEQ 1 (
echo "cmake build"
EXIT /B 1
)

endlocal
28 changes: 28 additions & 0 deletions ci/travis/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

check_ret() {
if [ $1 -ne 0 ]; then
echo ""
echo "!!! FAIL: $2"
echo "********************************************************************************"
echo ""
exit $1
else
echo ""
echo "*** SUCCESS: $2"
echo "********************************************************************************"
echo ""
fi
}

rm -rf tmp
./build_simple.sh
check_ret $? "build"

cd ./unit-tests.wsjcpp
rm -rf tmp
check_ret $? "cd tests"
./build_simple.sh
check_ret $? "build tests"
./run_unit-tests.sh
check_ret $? "run unit-tests"
2 changes: 1 addition & 1 deletion src.wsjcpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(MACOSX TRUE)
endif()

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

set (WSJCPP_LIBRARIES "")
set (WSJCPP_INCLUDE_DIRS "")
Expand Down
Loading

0 comments on commit b445f0c

Please sign in to comment.