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
build: change Swiftlint not running when Carthage builds #54
Conversation
8b384ac
to
0ec653c
Compare
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.
Hi @cre8ivejp,
I confirmed that Bucketeer in the Main branch is successfully available via CocoaPods and Swift Package Manager.
Please check this PR while you are free.
@@ -1075,7 +1075,7 @@ | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
shellPath = /bin/sh; | |||
shellScript = "#Run this script if not in a CI environment.\nif [ -n $CI ] && [ $CI = \"true\" ]; then\n echo \"Run this script if not in a CI environment.\"\n exit 0\nfi\n\n#Workaround: Add Homebrew Path for M1 Mac.\nif [ $(uname -m) = \"arm64\" ]; then\n export PATH=\"/opt/homebrew/bin:/opt/homebrew/sbin:${PATH+:$PATH}\";\nfi\n\nif which mint >/dev/null; then\n make run-lint\nelse\n echo \"Warning: Mint is not installed. Please run make install-mint.\"\nfi\n"; | |||
shellScript = "#Run this script if not in a CI environment or Carthage build.\nif [ -n $CI ] && [ \"$CI\" = \"true\" ]; then\n echo \"Run this script if not in a CI environment.\"\n exit 0\nelif [ -n \"$CARTHAGE\" ]; then\n echo \"Run this script if not in Carthage build.\"\n exit 0\nfi\n\n#Workaround: Add Homebrew Path for M1 Mac.\nif [ $(uname -m) = \"arm64\" ]; then\n export PATH=\"/opt/homebrew/bin:/opt/homebrew/sbin:${PATH+:$PATH}\";\nfi\n\nif which mint >/dev/null; then\n make run-lint\nelse\n echo \"Warning: Mint is not installed. Please run make install-mint.\"\nfi\n"; |
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.
Since "CARTHAGE=YES" is set as a parameter when building Carthage, I have modified it so that it is used to judge the execution of Swiftlint.
Run Script(linter)
#Run this script if not in a CI environment or Carthage build.
if [ -n $CI ] && [ "$CI" = "true" ]; then
echo "Run this script if not in a CI environment."
exit 0
elif [ -n "$CARTHAGE" ]; then
echo "Run this script if not in Carthage build."
exit 0
fi
...
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.
thanks @kakcy
I tried your solution and it works 👍🏻.
this changes are nice to have
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.
@@ -1075,7 +1075,7 @@ | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
shellPath = /bin/sh; | |||
shellScript = "#Run this script if not in a CI environment.\nif [ -n $CI ] && [ $CI = \"true\" ]; then\n echo \"Run this script if not in a CI environment.\"\n exit 0\nfi\n\n#Workaround: Add Homebrew Path for M1 Mac.\nif [ $(uname -m) = \"arm64\" ]; then\n export PATH=\"/opt/homebrew/bin:/opt/homebrew/sbin:${PATH+:$PATH}\";\nfi\n\nif which mint >/dev/null; then\n make run-lint\nelse\n echo \"Warning: Mint is not installed. Please run make install-mint.\"\nfi\n"; | |||
shellScript = "#Run this script if not in a CI environment or Carthage build.\nif [ -n $CI ] && [ \"$CI\" = \"true\" ]; then\n echo \"Run this script if not in a CI environment.\"\n exit 0\nelif [ -n \"$CARTHAGE\" ]; then\n echo \"Run this script if not in Carthage build.\"\n exit 0\nfi\n\n#Workaround: Add Homebrew Path for M1 Mac.\nif [ $(uname -m) = \"arm64\" ]; then\n export PATH=\"/opt/homebrew/bin:/opt/homebrew/sbin:${PATH+:$PATH}\";\nfi\n\nif which mint >/dev/null; then\n make run-lint\nelse\n echo \"Warning: Mint is not installed. Please run make install-mint.\"\nfi\n"; |
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.
thanks @kakcy
I tried your solution and it works 👍🏻.
this changes are nice to have
@@ -1075,7 +1075,7 @@ | |||
); | |||
runOnlyForDeploymentPostprocessing = 0; | |||
shellPath = /bin/sh; | |||
shellScript = "#Run this script if not in a CI environment.\nif [ -n $CI ] && [ $CI = \"true\" ]; then\n echo \"Run this script if not in a CI environment.\"\n exit 0\nfi\n\n#Workaround: Add Homebrew Path for M1 Mac.\nif [ $(uname -m) = \"arm64\" ]; then\n export PATH=\"/opt/homebrew/bin:/opt/homebrew/sbin:${PATH+:$PATH}\";\nfi\n\nif which mint >/dev/null; then\n make run-lint\nelse\n echo \"Warning: Mint is not installed. Please run make install-mint.\"\nfi\n"; | |||
shellScript = "#Run this script if not in a CI environment or Carthage build.\nif [ -n $CI ] && [ \"$CI\" = \"true\" ]; then\n echo \"Run this script if not in a CI environment.\"\n exit 0\nelif [ -n \"$CARTHAGE\" ]; then\n echo \"Run this script if not in Carthage build.\"\n exit 0\nfi\n\n#Workaround: Add Homebrew Path for M1 Mac.\nif [ $(uname -m) = \"arm64\" ]; then\n export PATH=\"/opt/homebrew/bin:/opt/homebrew/sbin:${PATH+:$PATH}\";\nfi\n\nif which mint >/dev/null; then\n make run-lint\nelse\n echo \"Warning: Mint is not installed. Please run make install-mint.\"\nfi\n"; |
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.
Thank you for your review! |
As a result of changing Swiftlint to run at build time, an error occurs when building with Carthage on the main branch.
The cause is that Swiftlint is executed when building with Carthage.
Changes