-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Makefile #49
Add Makefile #49
Changes from all commits
4e68b4b
9c7169d
137a26f
2d6dc7e
0f6ee94
1e9a932
ebfe3c9
afe8a01
7d7cac1
eb0cfff
a698e94
323259f
6aaf770
3d01567
3025b2c
7da4ecc
6bfeb63
9160da5
173f363
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add this file to the xcode group, so that it is visible inside the project. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in 323259f |
||
|
||
FAILED=false | ||
|
||
if ! which xcodebuild >/dev/null; then | ||
echo "xcodebuild does not seem to be installed. You can install it by installing Xcode from the App Store." | ||
FAILED=true | ||
fi | ||
|
||
if ! which pod >/dev/null; then | ||
echo "Cocoapods does not seem to be installed. You may need to run 'gem install cocoapods'." | ||
FAILED=true | ||
fi | ||
|
||
if ! which xcpretty >/dev/null; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These tools are all mostly dead :( |
||
echo "xcpretty does not seem to be installed. You may need to run 'gem install xcpretty'." | ||
FAILED=true | ||
fi | ||
|
||
if ! command -v Pods/SwiftLint/swiftlint &> /dev/null; then | ||
echo "Swiftlint does not seem to be installed. You may need to run 'pod install'." | ||
FAILED=true | ||
fi | ||
|
||
if ! which oclint >/dev/null; then | ||
echo "oclint does not seem to be installed. You may need to run 'brew tap oclint/formulae && brew install oclint'." | ||
FAILED=true | ||
fi | ||
|
||
if $FAILED; then | ||
exit 1 | ||
fi | ||
|
||
echo "All required dependencies are installed!" |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
WORKSPACE ?= VelocidiSDK.xcworkspace | ||
TEST_SDK ?= 14.4 | ||
TEST_DEVICE ?= iPhone 11 Pro Max | ||
|
||
XCARGS := -workspace $(WORKSPACE) \ | ||
-sdk "iphonesimulator$(TEST_SDK)" \ | ||
-destination "platform=iOS Simulator,OS=$(TEST_SDK),name=$(TEST_DEVICE)" \ | ||
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | ||
|
||
build: | ||
set -o pipefail && xcodebuild $(XCARGS) -scheme VelocidiSDK build | xcpretty | ||
|
||
# we have to clean schemas independently because xcode does not allow to clean all schemes in a workspace | ||
clean: | ||
xcodebuild $(XCARGS) -scheme VelocidiSDK clean | xcpretty && \ | ||
xcodebuild $(XCARGS) -scheme ObjcExample clean | xcpretty && \ | ||
xcodebuild $(XCARGS) -scheme SwiftExample clean | xcpretty | ||
|
||
test: build | ||
set -o pipefail && xcodebuild $(XCARGS) -scheme VelocidiSDK test | xcpretty | ||
|
||
examples: install-examples build-objc-example build-swift-example | ||
|
||
install-examples: build | ||
pod install --project-directory=Examples/ | ||
|
||
build-objc-example: install-examples | ||
set -o pipefail && xcodebuild $(XCARGS) -scheme ObjcExample clean build | xcpretty | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't these examples depend on the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 173f363 |
||
|
||
build-swift-example: install-examples | ||
set -o pipefail && xcodebuild $(XCARGS) -scheme SwiftExample clean build | xcpretty | ||
|
||
install: | ||
pod install | ||
|
||
prerequisites: | ||
.scripts/prerequisites.sh | ||
|
||
oclint-examples: | ||
set -o pipefail && \ | ||
xcodebuild -scheme ObjcExample -sdk iphonesimulator -workspace VelocidiSDK.xcworkspace COMPILER_INDEX_STORE_ENABLE=NO clean build | xcpretty -r json-compilation-database --output compile_commands.json && \ | ||
oclint-json-compilation-database -exclude Pods -exclude build -- -report-type xcode -max-priority-3=15000 | ||
|
||
oclint: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've had some challenges running this.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think I ever had this problem. I tried uninstalling and installing oclint and I could not replicate this issue. I don't use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regardless of The second problem is not related to python. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this oclint run also for the examples? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a command for this in 3025b2c |
||
set -o pipefail && \ | ||
xcodebuild -scheme VelocidiSDK -sdk iphonesimulator -workspace VelocidiSDK.xcworkspace COMPILER_INDEX_STORE_ENABLE=NO clean build | xcpretty -r json-compilation-database --output compile_commands.json && \ | ||
oclint-json-compilation-database -exclude Pods -exclude build -- -report-type xcode -max-priority-3=15000 | ||
|
||
swiftlint: | ||
Pods/SwiftLint/swiftlint lint --fix && Pods/SwiftLint/swiftlint lint --strict | ||
|
||
podlint: | ||
pod lib lint --verbose |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels a bit strange to have all the build commands inside the
Makefile
and then the still use the./.github/workflows/xcodebuild.sh
file in the tests.Can't we use the
make
there too? I think it is possible to import env vars intoMakefile
s.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 9160da5