Skip to content

Commit

Permalink
Cleaned up the helper scripts, added a brief README. (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekazakov authored May 6, 2024
1 parent 92bd84e commit 796b929
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 144 deletions.
50 changes: 50 additions & 0 deletions Scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Helper Scripts
The `Scripts` directory contains a set of useful scripts to be used during development, continuous integration, testing and packaging.

## `build_for_codeql.sh`
Builds tests and the main application without running so that CodeQL can intercept the commands and perform its analysis afterwards.
`xcodebuild` and `xcpretty` must be available in the environment in order for this script to run.

## `build_nightly.sh`
Builds Nimble Commander with the `NimbleCommander-NonMAS` scheme / `Release` configuration, signs it, packages the runnable build into a `.dmg` image and notarizes the final image.
`xcodebuild`, `xcpretty` and `create-dmg` must be available in the environment in order for this script to run.
It also requires the codesigning certificate to be properly signed.

## `build_unsigned.sh`
Builds Nimble Commander with the `NimbleCommander-Unsigned` scheme / `Release` configuration and packages the runnable build into a `.dmg` image.
`xcodebuild`, `xcpretty` and `create-dmg` must be available in the environment in order for this script to run.

## `build_unsigned_and_run.sh`
Builds Nimble Commander with the `NimbleCommander-Unsigned` scheme / `Debug` configuration and runs it afterwards.
`xcodebuild` must be available in the environment in order for this script to run.

## `run_all_integration_tests.sh`
Builds and executes all integration tests with the Debug/ASAN configuration.
`xcodebuild` and `xcpretty` must be available in the environment in order for this script to run.
`docker` must be available to run the VMs required for NC's virtual file systems.

## `run_all_unit_tests.sh [Debug|Release|ASAN|UBSAN]`
Builds and executes all unit tests with the specified configuration.
`xcodebuild` and `xcpretty` must be available in the environment in order for this script to run.

## `run_clang_format.sh`
Executes `clang-format` against all source files in the `Source` directory, re-formatting them in-place if necessary.
Rules from `Source/.clang-format` are used in the process.
`clang-format` must be available in order for this script to run.

## `run_clang_tidy.sh`
Executes `clang-tidy` against all source files in the `Source` directory, updating them in-place if necessary.
`xcodebuild`, `xcpretty` and `jq` must be available in the environment in order for this script to run.
`clang-tidy` must be installed via Brew and is expected to be located at `/usr/local/opt/llvm/bin/`.
Rules from `Source/.clang-tidy` are used in the process.
It's recommended to execute `run_clang_format.sh` afterwards.

## Dependencies installation:
* xcodebuild:
* XCode: https://download.developer.apple.com/Developer_Tools/Xcode_15.1/Xcode_15.1.xip
* Or just build tools: https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_15.1/Command_Line_Tools_for_Xcode_15.1.dmg
* [xcpretty](https://github.com/xcpretty/xcpretty): `gem install xcpretty`
* [clang-format](https://clang.llvm.org/docs/ClangFormat.html): `brew install clang-format`
* [clang-tidy](https://clang.llvm.org/extra/clang-tidy/): `brew install llvm`
* [jq](https://jqlang.github.io/jq/): `brew install jq`
* [create-dmg](https://github.com/create-dmg/create-dmg): `brew install create-dmg`
10 changes: 0 additions & 10 deletions Scripts/archive_all_versions.sh

This file was deleted.

30 changes: 0 additions & 30 deletions Scripts/build_all_versions.sh

This file was deleted.

9 changes: 0 additions & 9 deletions Scripts/build_nightly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ BUILT_PATH="${BUILD_DIR}/built"
mkdir -p "${BUILD_DIR}"
mkdir -p "${ARCHIVE_PATH}"

# Enable caching with ccache if it's available in the system
if type -p /usr/local/bin/ccache >/dev/null 2>&1; then
echo Using ccache
export CCACHE_BASEDIR="${ROOT_DIR}"
export CCACHE_SLOPPINESS=time_macros,include_file_mtime,include_file_ctime,file_stat_matches
export CC="${SCRIPTS_DIR}/ccache-clang"
export CXX="${SCRIPTS_DIR}/ccache-clang++"
fi

# Gather common flags in the XC variable
XC="xcodebuild \
-project ${XCODEPROJ} \
Expand Down
24 changes: 0 additions & 24 deletions Scripts/build_preview.sh

This file was deleted.

8 changes: 0 additions & 8 deletions Scripts/build_unsigned.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ XCODEPROJ="../Source/NimbleCommander/NimbleCommander.xcodeproj"

PBUDDY=/usr/libexec/PlistBuddy

if type -p /usr/local/bin/ccache >/dev/null 2>&1; then
echo Using ccache
export CCACHE_BASEDIR="${ROOT_DIR}"
export CCACHE_SLOPPINESS=time_macros,include_file_mtime,include_file_ctime,file_stat_matches
export CC="${SCRIPTS_DIR}/ccache-clang"
export CXX="${SCRIPTS_DIR}/ccache-clang++"
fi

XC="xcodebuild \
-project ${XCODEPROJ} \
-scheme NimbleCommander-NonMAS \
Expand Down
2 changes: 0 additions & 2 deletions Scripts/ccache-clang

This file was deleted.

2 changes: 0 additions & 2 deletions Scripts/ccache-clang++

This file was deleted.

48 changes: 0 additions & 48 deletions Scripts/run_all_tests.sh

This file was deleted.

8 changes: 0 additions & 8 deletions Scripts/run_all_unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ XCODEPROJ="../Source/NimbleCommander/NimbleCommander.xcodeproj"

LOG_FILE=${BUILD_DIR}/xcodebuild.log

if type -p /usr/local/bin/ccache >/dev/null 2>&1; then
echo Using ccache
export CCACHE_BASEDIR="${ROOT_DIR}"
export CCACHE_SLOPPINESS=time_macros,include_file_mtime,include_file_ctime,file_stat_matches
export CC="${SCRIPTS_DIR}/ccache-clang"
export CXX="${SCRIPTS_DIR}/ccache-clang++"
fi

build_target()
{
TARGET=$1
Expand Down
3 changes: 0 additions & 3 deletions Scripts/sloc.sh

This file was deleted.

0 comments on commit 796b929

Please sign in to comment.