Skip to content

Latest commit

 

History

History
185 lines (130 loc) · 5.02 KB

DEVELOPING.adoc

File metadata and controls

185 lines (130 loc) · 5.02 KB

Developing

Prerequisites

  • XCode 12.5

  • iOS 13.0

  • Swift 5.3+

  • Bundler

  • AWS cli tool

  • Sourcery

Dependencies of the SDK

The SDK has the following dependencies:

  • Data4LifeSDKUtils [external link] – {compname} Set of private utils used in data4Life Frameworks

Install

Install Gems using bundler

Install bundler by following instructions at the official page. When done, run:

bundle install

Install Sourcery using homebrew

Install bundler by following instructions at the official page. When done, run:

brew install sourcery
📎
For other installation methods check sourcery’s README

Install AWS Cli tool

Install the aws cli tool by following instructions at the official page.

Configure it by entering:

aws configure

and entering following data

AWS Access Key ID: xxxxx
AWS Secret Access Key: xxxxx
Default region name: eu-central-1
Default output format: json
📎
Access key ID and secret are secretly stored and must be asked for.

Build

File generation

STU3 models/tests and R4 protocol conformations/tests are autogenerated via the parser and sourcery. If already in the project they will be automatically deleted.

📎
The following files are NOT autogenerated and they should never be deleted These directories are not generated and are not meant to be removed from the project. They include FHIR DateTime encoding/tests and helpers/tests for contained resources. * FhirStu3/Sources/Helpers * FhirStu3/Tests/Helpers * FhirStu3/Tests/PrimitiveTests * FhirR4/Sources/

Run fastlane to generate STU3 models, R4 helpers and R4 tests

fastlane generate_all
📎
It’s possible to generated separately STU3 Models, R4 helpers or R4 tests, check Fastlane README for more information

Issues

FHIR Stu3 standard

  • String / Integer / Decimal / Bool / URL / Base64Binary should inherit Element

  • All properties dealing with binary data are represented as base64 String

  • R4 Models are currently copied and pasted from Apples framework

  • R4 Models are missing keypaths support yet

  • The deletion of generated files from the project leaves shadows in the project file in the build phases

Release

A release branches of from main branch with following pattern:

  • release/{major}.{minor}.{patch})/prepare-{major}.{minor}.{patch}

Steps

  • Update CHANGELOG

  • Update documentation if needed

  • Run prepare release script (eg. bundle exec fastlane ios prepare_release version:"v1.0.0" api_token:"xxxxxxx")

  • On github, publish the release manually by setting the new tag (eg. v1.0.0)

📎
The prepare release script will fail if there is no new version defined in the changelog

Prepare release script steps

The script executes the following commands:

  • Update new versions in the README.adoc and project files (including badges)

  • Do sanity checks (Proper version number in changelog etc.)

  • Generate documentation

  • Build framework and upload it to S3

  • Update Package swift info (url and checksum)

  • Commit and push changes

  • Create a GitHub release draft with all of the information from the CHANGELOG

bundle exec fastlane ios prepare_release version:"1.0.0" api_token:"xxxxxxx"

Generate documentation

Documentation is generated using Asciidoctor, all of the resoures can be found in docs resources, and generated HTML documentation can be found in docs.

bundle exec fastlane generate_docs version:1.0.0

Development Process

Features

Every change has to branch of from main and use this branch naming convention:

  • feature/{type_of_change}-{short_description} or with ticket id feature/{ticket_id}/{type_of_change}-{short_description}

main must be always in releasable state.

Type Of Change

  • add for new features or functionality

  • change for changes in existing features or functionality

  • remove | for removed features or functionality

  • fix for any bug fixes

  • bump for dependency updates

  • security in case of vulnerabilities

Examples:

  • feature/SDK-456/add-awesome-hashing-algorithm

  • feature/add-awesome-hashing-algorithm

  • feature/remove-not-so-awesome-algorithm

  • feature/fix-algorithm-corner-case

  • feature/bump-lib-to-1.3.0