Skip to content

Commit fe6786b

Browse files
committed
added DrString for framework projects
1 parent 2b9c9f1 commit fe6786b

4 files changed

Lines changed: 70 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
# Copies the DrString configuration to the projects base folder
3+
#
4+
# Author Pierre Rothmaler
5+
#
6+
# Last revised 23/09/2020
7+
8+
#
9+
# Constants
10+
#
11+
12+
readonly scriptBaseFolderPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
13+
14+
#
15+
# Variables
16+
#
17+
18+
projectDir="$1"
19+
20+
#
21+
# Check requirements
22+
#
23+
24+
# Check if project directory is provided. If not: Use the scripts base directory.
25+
if [ -z "$1" ]; then
26+
projectDir="$scriptBaseFolderPath"
27+
fi
28+
29+
#
30+
# Logic
31+
#
32+
33+
# Go the folder which contains this script
34+
cd "$scriptBaseFolderPath"
35+
36+
# Copy the DrString file to the projects base folder
37+
cp "drstring.toml" "$projectDir/.drstring.toml"
38+
39+
# Go to the project folder and run DrString from there
40+
cd "$projectDir"
41+
42+
DRSTRING_EXECUTABLE="$scriptBaseFolderPath/drstring"
43+
echo "FOUND PIERRE $DRSTRING_EXECUTABLE"
44+
echo "PIERRE AGAIN $projectDir/.drstring.toml"
45+
46+
47+
theDir="$( pwd )"
48+
49+
echo "PIERRE? $theDir"
50+
51+
if [ -f "$DRSTRING_EXECUTABLE" ]; then
52+
"$DRSTRING_EXECUTABLE" check --config-file $projectDir/.drstring.toml || true
53+
else
54+
echo "warning: DrString not installed."
55+
exit 1
56+
fi

DrString/drstring

12.4 MB
Binary file not shown.

DrString/drstring.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
include = [
2+
'Core/**/*.swift',
3+
]
4+
5+
exclude = [
6+
'*/*.generated.swift',
7+
]
8+
9+
ignore-throws = true
10+

setup-common-project-files.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ if [ $callSwiftlint = true ]; then
130130
./SwiftLint/copy-and-run-swiftlint-config.sh "$projectDir" $isFramework $isSwiftUIProject || exit 1;
131131
fi
132132

133+
if [ $isFramework = true ]; then
134+
./DrString/copy-and-run-DrString-config.sh "$projectDir" || exit 1;
135+
fi
136+
133137
if [ $copyPRTemplate = true ]; then
134138

135139
mkdir -p "$projectDir/.github"

0 commit comments

Comments
 (0)