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

Tools: Add a script to initialize quickly and easily the project #4596

Merged
merged 9 commits into from
Aug 9, 2021
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Changes to be released in next version
* Room: Added support for Voice Messages (#4090, #4091, #4092, #4094, #4095, #4096)
* Remove the directory section from the Rooms tab.
* Notifications: Show decrypted content is enabled by default (#4519).
* Tools: Add a script to initialize quickly and easily the project.

🐛 Bugfix
* Room: Fixed mentioning users from room info member details (#4583)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ You can try last beta build by accessing our [TestFlight Public Link](https://te
If you have already everything installed, opening the project workspace in Xcode should be as easy as:

```
$ xcodegen # Create the xcodeproj with all project source files
$ pod install # Create the xcworkspace with all project dependencies
$ ./setup_project.sh # Local script that creates the xcodeproj and xcworkspace with all source files and dependencies
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer to keep using the "xcodegen / pod install" combo here for simplicity and for easy understanding of what is happening.

I never needed to use more complex setup. You could mention setup_project.sh in INSTALL.md for advanced usage. While possible, I prefer to keep thing simple at first place.

$ open Riot.xcworkspace # Open Xcode
```

Expand Down
30 changes: 30 additions & 0 deletions setup_project.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Use this script to setup the Xcode project

# Remove existing project file if any
rm -r Riot.xcodeproj

# Create the xcodeproj with all project source files
xcodegen

# Use appropriated dependencies

# Check if Podfile changed in unstaged
git diff --exit-code --quiet --name-only Podfile
PODFILE_HAS_CHANGED_UNSTAGED=$?
# Check if Podfile changed in staged
git diff --staged --exit-code --quiet --name-only Podfile
PODFILE_HAS_CHANGED_STAGED=$?

# If Podfile has changed locally do not modify it
# otherwise use the appropriated dependencies according to the current branch
if [[ "$PODFILE_HAS_CHANGED_UNSTAGED" -eq 1 || "$PODFILE_HAS_CHANGED_STAGED" -eq 1 ]]; then
echo "Podfile has been changed locally do not modify it"
else
echo "Podfile has not been changed locally, use appropriated dependencies according to the current branch"
bundle exec fastlane point_dependencies_to_same_feature
fi

# Create the xcworkspace with all project dependencies
pod install