You need:
- nodejs 18 or higher (with corepack enabled)
- yarn 1 or higher
- yalc (can be installed with
yarn global add yalc
) - http-server
- ionic
First install dependencies of the SDK (the root of the repository) This is only needed if dependencies are added/removed.
yarn
Once deps are installed, you can build the project:
yarn build
# Or in watch mode, for development
yarn watch
- Go to android/build.gradle and update the version of
io.sentry:sentry-android
.
- Basically you'll need to edit SentryCapacitor.podspec and ios/Porfile updating the Sentry dependency and validate it on one of the examples apps on this project.
- Run 'pod install --repo-update' on the ios folder and then 'yarn build' on the root folder.
We use yalc
to serve the local package builds to our example apps. You can run the bump
scripts such as bump:v3
to package the SDK and sync the latest version to the example apps.
See the readmes in the specific example app folders for individual instructions:
yarn test
# Or the watcher when writing tests:
yarn test:watch
We'd love for users to update the SDK everytime and as soon as we make a new release. But in reality most users rarely update the SDK. To help users see value in updating the SDK, we maintain a changelog file with entries split between two headings:
### Features
### Fixes
We add the heading in the first PR that's adding either a feature or fixes in the current release. After a release, the changelog file will contain only the last release entries.
When you open a PR in such case, you need to add a heading 2 named ## Unreleased
, which is replaced during release with the version number chosen.
Below that, you'll add the heading 3 mentioned above. For example, if you're adding a feature "Attach screenshots when capturing errors on iOS", right after a release, and the pull request number is 123
, you'd add to the changelog:
## Unreleased
### Features
* Attach screenshots when capturing errors on iOS ([#123](https://github.com/getsentry/sentry-capacitor/pull/123))
There's a GitHub action check to verify if an entry was added. If the entry isn't a user-facing change, you can skip the verification with #skip-changelog
written to the PR description. The bot writes a comment in the PR with a suggestion entry to the changelog based on the PR title.
Here are step on how to test your changes in sentry-cocoa
with sentry-capacitor
. We assume you have both repositories cloned in siblings folders.
- Build
sentry-cocoa
.
cd sentry-cocoa
make init
make build-xcframework
- Link local
sentry-cocoa
build insentry-capacitor
cd sentry-capacitor
Comment out sentry dependency in SentryCapacitor.podspec
.
- s.dependency 'Sentry', '7.31.0'
+ # s.dependency 'Sentry', '7.31.0'
Add local pods to example/ionic-angular/ios/App/Podfile
.
target 'sample' do
# ... capacitor config
+ pod 'Sentry/HybridSDK', :path => '../../../sentry-cocoa'
+ pod 'SentryPrivate', :path => '../../../sentry-cocoa/SentryPrivate.podspec'
# ... rest of the configuration
end
Here are step on how to test your changes in sentry-java
with sentry-capacitor
. We assume that you have sentry-java
setup, Android SDK installed, correct JAVA version etc.
- Build and publish
sentry-java
locally.
cd sentry-java
make dryRelease
ls ~/.m2/repository/io/sentry/sentry-android # check that `sentry-java` was published
- Add local maven to the sample project.
cd sentry-capacitor/example
Add local maven to example/sample-project/android/build.gradle
.
allprojects {
repositories {
+ mavenLocal()
Update sentry-android
version, to the one locally published, in android/build.gradle
.
dependencies {
implementation project(':capacitor-android')+'
- implementation 'io.sentry:sentry-android:5.4.0'
+ implementation 'io.sentry:sentry-android:6.7.7-my-local-version'
}
When bumping the dependency of Capacitor, always have a look on the following link to see any changes required on the SDK in order to support the latest versions of Capacitor: https://capacitorjs.com/docs/updating/plugins/6-0