Преглед изворни кода

Merge branch 'setup-branch' of public/ls-standard-library into development

patrick-christopher.mattulat пре 1 година
родитељ
комит
46dabf0bf9
4 измењених фајлова са 126 додато и 3 уклоњено
  1. 9 3
      README.md
  2. 29 0
      config/scripts/init.ps1
  3. 44 0
      config/scripts/init.sh
  4. 44 0
      config/scripts/init.zsh

+ 9 - 3
README.md

@@ -1,6 +1,6 @@
 # Lynar Studios - Standard Library 2023.3.0 #
 
-This is a cross-platform standard library written in C++ offering functionalities you would usually miss in C++'s standard template library (STL), especially if you would search for cross-platform implementations.  
+This is a cross-platform standard library written in C++ offering functionalities you would usually miss in C++'s standard library, especially if you would search for cross-platform implementations.  
 This library has been tested on __Windows__, __Linux__ and __MacOS__ systems.
 Following a modularized approach the following independent submodules are defined in scope of this library:
  
@@ -34,11 +34,11 @@ A __Date__ class comes with this submodule, which you can use to represent a dat
 
 #### Features ####
 
-- Section Pair values now support backslash characters, which are common on Windows to describe a file path
+- none
 
 #### Improvements ####
 
-- solved more than 400 SonarLint findings, which were mostly on critical level
+- an OS-specific initialization-script is now being provided for setting up the project and preparing it for the developer for code-contribution
 
 #### Fixes ####
 
@@ -142,6 +142,12 @@ target_link_libraries(... ls-std-core ls-std-boxing ...)
 
 ---
 
+### Project Contribution ###
+
+#### Initialization ####
+
+To initialize this project and prepare it for local development, an OS-specific init-script must be executed. This script is located in __config/scripts__ location of the projects' root folder. Choose the OS-specific script (e.g. init.sh for Linux) and execute it via CLI.
+
 ### Run Automated Tests ###
 
 When enabling test build CMake flag during CMake project generation, executable test suite binaries will be generated during project compilation.  

+ 29 - 0
config/scripts/init.ps1

@@ -0,0 +1,29 @@
+$project_name = "Lynar Studios - Standard Library"
+
+$script_directory=$PWD
+$root_directory=(Split-Path -Parent (Split-Path -Parent $script_directory))
+$test_directory="$root_directory\test"
+$test_resources_directory="$test_directory\resources"
+$test_file_name="no-writable-windows.txt"
+$test_file_path="$test_resources_directory\$test_file_name"
+
+$indentation="  -->"
+
+########################################
+# script execution
+########################################
+
+Write-Host "Setting up project '$project_name' for development on Windows environment ...
+"
+
+# list variables
+
+Write-Host "$indentation script directory identified as '$script_directory' ..."
+Write-Host "$indentation root directory identified as '$root_directory' ..."
+Write-Host "$indentation test directory identified as '$test_directory' ..."
+Write-Host "$indentation test resources directory identified as '$test_resources_directory' ..."
+
+# prepare test files
+
+Write-Host "$indentation changing permissions for '$test_file_path' file ..."
+Set-ItemProperty -Path $test_file_path -Name Attributes -Value ([System.IO.FileAttributes]::ReadOnly)

+ 44 - 0
config/scripts/init.sh

@@ -0,0 +1,44 @@
+#!/bin/bash
+
+project_name="Lynar Studios - Standard Library"
+
+script_directory="$PWD"
+root_directory=$(dirname $(dirname $script_directory))
+test_directory="$root_directory/test"
+test_resources_directory="$test_directory/resources"
+test_file_name="no-writable.txt"
+test_file_path="$test_resources_directory/$test_file_name"
+
+indentation="  -->"
+error_level="[ERROR]"
+
+########################################
+# script execution
+########################################
+
+echo "Setting up project '$project_name' for development on Linux environment ...
+"
+
+# check if rights are sufficient
+
+echo "$indentation checking rights ..."
+
+if ! sudo -v; then
+  echo "$indentation $error_level no sufficient rights, must be executed as sudo-user ..."
+else
+  echo "$indentation user is sudo ..."
+fi
+
+# list variables
+
+echo "$indentation script directory identified as '$script_directory' ..."
+echo "$indentation root directory identified as '$root_directory' ..."
+echo "$indentation test directory identified as '$test_directory' ..."
+echo "$indentation test resources directory identified as '$test_resources_directory' ..."
+
+# prepare test files
+
+if sudo -v; then
+  echo "$indentation changing permissions for '$test_file_path' file ..."
+  chmod -w "$test_file_path"
+fi

+ 44 - 0
config/scripts/init.zsh

@@ -0,0 +1,44 @@
+#!/bin/zsh
+
+project_name="Lynar Studios - Standard Library"
+
+script_directory="$PWD"
+root_directory=$(dirname $(dirname $script_directory))
+test_directory="$root_directory/test"
+test_resources_directory="$test_directory/resources"
+test_file_name="no-writable.txt"
+test_file_path="$test_resources_directory/$test_file_name"
+
+indentation="  -->"
+error_level="[ERROR]"
+
+########################################
+# script execution
+########################################
+
+echo "Setting up project '$project_name' for development on MacOS environment ...
+"
+
+# check if rights are sufficient
+
+echo "$indentation checking rights ..."
+
+if ! sudo -v; then
+  echo "$indentation $error_level no sufficient rights, must be executed as sudo-user ..."
+else
+  echo "$indentation user is sudo ..."
+fi
+
+# list variables
+
+echo "$indentation script directory identified as '$script_directory' ..."
+echo "$indentation root directory identified as '$root_directory' ..."
+echo "$indentation test directory identified as '$test_directory' ..."
+echo "$indentation test resources directory identified as '$test_resources_directory' ..."
+
+# prepare test files
+
+if sudo -v; then
+  echo "$indentation changing permissions for '$test_file_path' file ..."
+  chmod -w "$test_file_path"
+fi