Skip to content

Commit

Permalink
automate dev setup
Browse files Browse the repository at this point in the history
  - put setup steps in a Makefile `init` task
  - update Readme:
      - no longer need troubleshooting section
      - remove link to notion page i couldn't access
      - point out that `sentry-cli login` must have been run at some point and link to docs
  - add a Brewfile and Gemfile to declare dev tool dependencies
  - use a containerized Ruby
  - name the Xcode project's "Run Script" Build Phase for sentry-cli
  - remove a couple links to files in the Xcode project (.app/.xctest bundles)
  - add a link to .env for easier editing
  - set our codesign team
  • Loading branch information
armcknight committed Sep 6, 2023
1 parent bf5844a commit 69d3532
Show file tree
Hide file tree
Showing 9 changed files with 246 additions and 37 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.DS_Store
/EmpowerPlant.xcodeproj/xcuserdata
/EmpowerPlant.xcworkspace/xcuserdata
.env
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.2.2
3 changes: 3 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
brew 'rbenv'
brew 'ruby-build'
brew 'sentry-cli'
90 changes: 90 additions & 0 deletions Brewfile.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"entries": {
"brew": {
"rbenv": {
"version": "1.2.0",
"bottle": {
"rebuild": 0,
"root_url": "https://ghcr.io/v2/homebrew/core",
"files": {
"arm64_ventura": {
"cellar": ":any",
"url": "https://ghcr.io/v2/homebrew/core/rbenv/blobs/sha256:09bccc5974bd7b23f60a42c94bf7bc7d0e605cf4ef1f4068f63a1fe905bc5c74",
"sha256": "09bccc5974bd7b23f60a42c94bf7bc7d0e605cf4ef1f4068f63a1fe905bc5c74"
},
"arm64_monterey": {
"cellar": ":any",
"url": "https://ghcr.io/v2/homebrew/core/rbenv/blobs/sha256:dede9454bc8a665ac2b1858a0522fb77d95deebb5db7437918cfb056ff119b16",
"sha256": "dede9454bc8a665ac2b1858a0522fb77d95deebb5db7437918cfb056ff119b16"
},
"arm64_big_sur": {
"cellar": ":any",
"url": "https://ghcr.io/v2/homebrew/core/rbenv/blobs/sha256:d5e6168ad6ab8843946273319fc6949b322c80f2d666a6bdda62466e256e6746",
"sha256": "d5e6168ad6ab8843946273319fc6949b322c80f2d666a6bdda62466e256e6746"
},
"ventura": {
"cellar": ":any",
"url": "https://ghcr.io/v2/homebrew/core/rbenv/blobs/sha256:e654c2cf9b9966093b2d045cb9b12dbd32a7cd8926194838e13ee7d17184b1f5",
"sha256": "e654c2cf9b9966093b2d045cb9b12dbd32a7cd8926194838e13ee7d17184b1f5"
},
"monterey": {
"cellar": ":any",
"url": "https://ghcr.io/v2/homebrew/core/rbenv/blobs/sha256:42657e04e2d1e8bf9abb9c5f0ba50e567df95f93a2a212491f005e4bd0ad9cee",
"sha256": "42657e04e2d1e8bf9abb9c5f0ba50e567df95f93a2a212491f005e4bd0ad9cee"
},
"big_sur": {
"cellar": ":any",
"url": "https://ghcr.io/v2/homebrew/core/rbenv/blobs/sha256:8a1b159909d472cc461d0a9b85a192a31ab58860e34f022fcbb33175732d24aa",
"sha256": "8a1b159909d472cc461d0a9b85a192a31ab58860e34f022fcbb33175732d24aa"
},
"catalina": {
"cellar": ":any",
"url": "https://ghcr.io/v2/homebrew/core/rbenv/blobs/sha256:a2ca52c4fe3b7000d9f84f81836ddcb9b3aea9c20ee092dd71c1e10cf3a6a19a",
"sha256": "a2ca52c4fe3b7000d9f84f81836ddcb9b3aea9c20ee092dd71c1e10cf3a6a19a"
},
"mojave": {
"cellar": ":any",
"url": "https://ghcr.io/v2/homebrew/core/rbenv/blobs/sha256:87ca53a9f4f84aff56ccbf2f823f903d20bc6669dde548018892857cc8871936",
"sha256": "87ca53a9f4f84aff56ccbf2f823f903d20bc6669dde548018892857cc8871936"
},
"x86_64_linux": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/rbenv/blobs/sha256:f4be8e4efef32c1fcdaa585312b3262d33b3306d9d7d9c75abd1230227b10bb7",
"sha256": "f4be8e4efef32c1fcdaa585312b3262d33b3306d9d7d9c75abd1230227b10bb7"
}
}
}
},
"ruby-build": {
"version": "20230904",
"bottle": {
"rebuild": 0,
"root_url": "https://ghcr.io/v2/homebrew/core",
"files": {
"all": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/ruby-build/blobs/sha256:f4b871fa0694dba9f215df79959677c222e0d3c788fd9c1a1d1e07962487e650",
"sha256": "f4b871fa0694dba9f215df79959677c222e0d3c788fd9c1a1d1e07962487e650"
}
}
}
},
"sentry-cli": {
"version": "2.20.6",
"bottle": false
}
}
},
"system": {
"macos": {
"ventura": {
"HOMEBREW_VERSION": "4.1.9",
"HOMEBREW_PREFIX": "/opt/homebrew",
"Homebrew/homebrew-core": "api",
"CLT": "",
"Xcode": "15.0",
"macOS": "13.4"
}
}
}
}
36 changes: 26 additions & 10 deletions EmpowerPlant.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -38,8 +38,14 @@
/* Begin PBXFileReference section */
57BE79023D12DCDCB69BA73D /* Pods-EmpowerPlant.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EmpowerPlant.release.xcconfig"; path = "Target Support Files/Pods-EmpowerPlant/Pods-EmpowerPlant.release.xcconfig"; sourceTree = "<group>"; };
74014747DE857D26E9BD7B24 /* Pods_EmpowerPlant.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_EmpowerPlant.framework; sourceTree = BUILT_PRODUCTS_DIR; };
84A264182AA9155800A62A88 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
84A264192AA915B100A62A88 /* Brewfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Brewfile; sourceTree = "<group>"; };
84A2641A2AA915B100A62A88 /* Gemfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Gemfile; sourceTree = "<group>"; };
84A2641B2AA915D800A62A88 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
84A2641C2AA9165A00A62A88 /* EmpowerPlant.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EmpowerPlant.app; sourceTree = BUILT_PRODUCTS_DIR; };
84A2641D2AA9165A00A62A88 /* EmpowerPlantTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EmpowerPlantTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
84A2641E2AA926A300A62A88 /* .env */ = {isa = PBXFileReference; lastKnownFileType = text; path = .env; sourceTree = "<group>"; };
8B21663B29D3F8C80009C890 /* RandomErrors.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RandomErrors.swift; sourceTree = "<group>"; };
8BA3AB2C2A201FE900BE1EA8 /* EmpowerPlantTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EmpowerPlantTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
8BA3AB372A20212C00BE1EA8 /* CartViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartViewControllerTests.swift; sourceTree = "<group>"; };
CC58FA1A8A084A40FC763820 /* Pods-EmpowerPlant.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EmpowerPlant.debug.xcconfig"; path = "Target Support Files/Pods-EmpowerPlant/Pods-EmpowerPlant.debug.xcconfig"; sourceTree = "<group>"; };
D15EDF11282BF7FB00FC13D6 /* Product+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Product+CoreDataProperties.swift"; sourceTree = "<group>"; };
Expand All @@ -55,7 +61,6 @@
D17C73CB27D82EB8006650AF /* EmpowerPlantViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmpowerPlantViewController.swift; sourceTree = "<group>"; };
D17C73CE27D82ED1006650AF /* CartViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartViewController.swift; sourceTree = "<group>"; };
D17C73D127D83321006650AF /* ListAppViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListAppViewController.swift; sourceTree = "<group>"; };
D191948627E011F2007845C5 /* EmpowerPlant.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EmpowerPlant.app; sourceTree = BUILT_PRODUCTS_DIR; };
D19EBE6E2805ED52007022DC /* ShoppingCart.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingCart.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -97,12 +102,17 @@
D17C73A627D8291D006650AF = {
isa = PBXGroup;
children = (
84A2641E2AA926A300A62A88 /* .env */,
84A264192AA915B100A62A88 /* Brewfile */,
84A2641A2AA915B100A62A88 /* Gemfile */,
84A264182AA9155800A62A88 /* Makefile */,
84A2641B2AA915D800A62A88 /* README.md */,
D17C73B127D8291D006650AF /* EmpowerPlant */,
DBBFE14A41453664EF0F8F57 /* Pods */,
8BA3AB2D2A201FE900BE1EA8 /* EmpowerPlantTests */,
A2BF5384A6D041CDB3FCA8D9 /* Frameworks */,
D191948627E011F2007845C5 /* EmpowerPlant.app */,
8BA3AB2C2A201FE900BE1EA8 /* EmpowerPlantTests.xctest */,
DBBFE14A41453664EF0F8F57 /* Pods */,
84A2641C2AA9165A00A62A88 /* EmpowerPlant.app */,
84A2641D2AA9165A00A62A88 /* EmpowerPlantTests.xctest */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -155,7 +165,7 @@
);
name = EmpowerPlantTests;
productName = EmpowerPlantTests;
productReference = 8BA3AB2C2A201FE900BE1EA8 /* EmpowerPlantTests.xctest */;
productReference = 84A2641D2AA9165A00A62A88 /* EmpowerPlantTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
D17C73AE27D8291D006650AF /* EmpowerPlant */ = {
Expand All @@ -167,15 +177,15 @@
D17C73AC27D8291D006650AF /* Frameworks */,
D17C73AD27D8291D006650AF /* Resources */,
64CD5DF2D474DFE9B615DAE0 /* [CP] Embed Pods Frameworks */,
21715E6128A2D59700248175 /* ShellScript */,
21715E6128A2D59700248175 /* [Sentry] Upload debug symbols */,
);
buildRules = (
);
dependencies = (
);
name = EmpowerPlant;
productName = EmpowerPlant;
productReference = D191948627E011F2007845C5 /* EmpowerPlant.app */;
productReference = 84A2641C2AA9165A00A62A88 /* EmpowerPlant.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
Expand Down Expand Up @@ -236,8 +246,9 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
21715E6128A2D59700248175 /* ShellScript */ = {
21715E6128A2D59700248175 /* [Sentry] Upload debug symbols */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand All @@ -246,6 +257,7 @@
inputPaths = (
"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}",
);
name = "[Sentry] Upload debug symbols";
outputFileListPaths = (
);
outputPaths = (
Expand Down Expand Up @@ -426,6 +438,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 97JCY7859U;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -487,6 +500,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 97JCY7859U;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -514,6 +528,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 97JCY7859U;
INFOPLIST_FILE = EmpowerPlant/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -534,6 +549,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 97JCY7859U;
INFOPLIST_FILE = EmpowerPlant/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "https://rubygems.org"

gem "bundler", ">= 2"
gem "cocoapods", ">= 1.9.1"
96 changes: 96 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.6)
rexml
activesupport (7.0.7.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.1.0)
cocoapods (1.12.1)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.12.1)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.6.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.21.0, < 2.0)
cocoapods-core (1.12.1)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.6.3)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.2.2)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.15.5)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.3)
minitest (5.20.0)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
public_suffix (4.0.7)
rexml (3.2.6)
ruby-macho (2.5.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.22.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)

PLATFORMS
arm64-darwin-22

DEPENDENCIES
bundler (>= 2)
cocoapods (>= 1.9.1)

BUNDLED WITH
2.4.19
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.PHONY: init
init:
# ensure Homebrew is installed
which brew || /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# set up dev tools
brew bundle

# set up ruby environment
rbenv install --skip-existing
rbenv exec gem update bundler
rbenv exec bundle update

# install app dependencies via CocoaPods
rbenv exec bundle exec pod update

# ensure there's a .env file present
stat .env 2>/dev/null || echo "SENTRY_ORG=<your org slug>\nSENTRY_PROJECT=<your project slug>" > .env
34 changes: 7 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,15 @@
## Overview
This app uses UIKit

## Setup
- install XCode
- iPhone 11 tested
- iPhone 14.4

`pod install`

Add `.env` file with the following in it:
```
SENTRY_ORG=<your org slug>
SENTRY_PROJECT=<your project slug>
```
An iOS app integrating Sentry to demo its various product features.

Make sure `sentry-cli info` succeeds, i.e. you have SENTRY_AUTH_TOKEN set somewhere.
## Setup
- Install XCode
- In a terminal, run:
- `make init`
- `sentry-cli login` (see [`sentry-cli` docs](https://docs.sentry.io/product/cli/) for more info)

## Run
Click Play button

## Bootstrapping iOS App
Want to know how this app was originally set up? See https://www.notion.so/sentry/Bootstrapping-iOS-app-abcd0da2bca64cbcbf6d086fa5188caf

## Troubleshooting
### Unable to load contents of file list: 'xxxxx/Pods/Target Support Files/... .xcfilelist'
- `sudo gem update cocoapods --pre`
- `pod update`
- Product -> Clean Build Folder...
- Product -> Build
### [!] CocoaPods could not find compatible versions for pod "SentryPrivate":
Run `pod repo update` then try again
Open Xcode and click the "Play" button or press ⌘R

## Creating release and uploading app

Expand Down

0 comments on commit 69d3532

Please sign in to comment.