Skip to content
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

Merged
merged 1 commit into from Nov 30, 2023

Conversation

kakcy
Copy link
Contributor

@kakcy kakcy commented Nov 21, 2023

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

  • Change Swiftlint not running when Carthage builds.

Copy link
Contributor Author

@kakcy kakcy left a 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";
Copy link
Contributor Author

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

...

Copy link
Collaborator

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-11-29 at 21 52 01

@@ -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";
Copy link
Collaborator

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";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-11-29 at 21 52 01

@kakcy
Copy link
Contributor Author

kakcy commented Nov 30, 2023

Thank you for your review!

@kakcy kakcy merged commit 29938c9 into bucketeer-io:main Nov 30, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants