Skip to content

Latest commit

 

History

History
147 lines (98 loc) · 4.5 KB

File metadata and controls

147 lines (98 loc) · 4.5 KB

Contributing

If you would like to contribute to this SDK's development, please follow these steps.

Requisites

Pull requests

If you'd like to contribute some code, please feel free to open a pull request.

Here are some tips for your PR to be successful:

  • Contact Bugfender beforehand with your proposal, to align on the changes needed and how you're planning to implement them.
  • Avoid breaking the end user's API if not necessary.
  • Align the style of your code with the code of the rest of the repository.
  • Make the minimal changes necessary, for example, avoid changing parts of the code you're not touching or avoid changing code only because of style.
  • Provide some proof of testing: for example, with screenshots of your code working or with unit/integration tests.
  • Avoid using external libraries whenever possible.
  • Read the project's license.

If you open a pull request, you're granting the project maintainers the right to use your code, under the current or any other license.

Common tasks

Updating the native libraries

This repository contains the Bugfender iOS and Android SDKs, which can be updated anytime and maybe are not updated here. At the moment of writing this, the SDKs used are:

  • Android 3.6.0
  • iOS 2.2.0

Updating iOS

Follow these steps for updating:

  • Download the latest version of the iOS SDK from GitHub; you need the .framework file. Add it to the Binding.iOS project.
  • Update Binding.iOS/ApiDefinition.cs by using Objective Sharpie. Manually check which are the methods updated and merge them. For reference, the invocation looks something like this: sharpie bind BugfenderSDK.framework/Headers/BugfenderSDK.h -scope BugfenderSDK.framework/Headers/ -sdk iphoneos12.1
  • Update the Binding.Sdk.iOS/BugfenderBinding.cs file if the API changed.
  • Update this file to reflect the version.

Updating Android

Follow these steps:

  • Download the latest version of the Android SDK from Maven Central; you need the aar file. Add it to the Binding.Android project.
  • Update the Binding.Sdk.Android/BugfenderBinding.cs file if the API changed.
  • Update this file to reflect the version.

Building the project

Go to the SDK folder:

cd SDK

To build the new project you should run:

./build.sh Release
./pack.sh

If you get any error mentioning the workload needs to be restored run:

./workload.sh

Testing with local sample

Build the code and pack the package with:

./build.sh
./pack.sh

Add it to a local repo to later import it from the Sample application for testing:

./local-push.sh

The script will automatically check if the nugetrepo source exists, create the folder if needed, add the source if missing, and push the packages.

Now change the version in the Sample/Sample.csproj file to the new version.

Checking the version on a real device

Android

Once you have the new NuGet package, you can test it on a real device using the Sample application.

dotnet build -t:Run -f net10.0-android -p:DeviceId=<device_id>
# or for .NET 9:
# dotnet build -t:Run -f net9.0-android -p:DeviceId=<device_id>

If you need to find the device id, you can use the following command:

adb devices

iOS

Once you have the new NuGet package, you can test it on an iOS simulator or device using the Sample application.

On iOS Simulator:

dotnet build -t:Run -f net10.0-ios
# or for .NET 9:
# dotnet build -t:Run -f net9.0-ios

This will automatically launch the default simulator. To specify a particular simulator:

dotnet build -t:Run -f net10.0-ios -p:_DeviceName=:v2:udid=<simulator_udid>

On iOS Device:

dotnet build -t:Run -f net10.0-ios -p:_DeviceName=:v2:udid=<device_udid>
# or for .NET 9:
# dotnet build -t:Run -f net9.0-ios -p:_DeviceName=:v2:udid=<device_udid>

To find available simulators and devices, you can use:

xcrun xctrace list devices

This will list all available iOS simulators and connected devices with their UDIDs.

Removing the NuGet package from the local repo

Remove from the local repo and clean the cache:

nuget delete Bugfender.Sdk 4.x.x -source ~/nugetrepo
nuget locals all -clear