Skip to content

Commit fa93ff7

Browse files
committed
chore: IDK/SDK 0.13
1 parent e494eda commit fa93ff7

4 files changed

Lines changed: 177 additions & 36 deletions

File tree

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,17 @@ The main sample application demonstrating:
7575

7676
Open the iOS project in Xcode and run on device or simulator.
7777

78+
6. **Build iOS XCFramework** (optional)
79+
80+
For iOS distribution, a separate XCFramework build is available. See [XCFramework README](./example/holder/xcframework/README.md) for details.
81+
82+
```bash
83+
cd example/holder/xcframework
84+
./gradlew assembleXCFrameworkKiwaSdk
85+
```
86+
87+
> **Note**: The XCFramework build is intentionally separated from the main build due to its long compilation time.
88+
7889
### Sample Code Examples
7990

8091
The sample app demonstrates key integration patterns:
@@ -141,14 +152,19 @@ For detailed information about the Detekt configuration, see [`config/detekt/REA
141152
```
142153
kiwa-sample/
143154
├── example/
144-
│ └── holder/ # Sample holder/wallet application
145-
│ ├── app/ # Main application module
146-
│ └── ui/ # UI components and screens
147-
├── config/ # Configuration files
148-
├── gradle/ # Gradle configuration
149-
└── scripts/ # Utility scripts
155+
│ └── holder/ # Sample holder/wallet application
156+
│ ├── app/ # Main application module (Android & iOS)
157+
│ │ ├── composeApp/ # Kotlin Multiplatform Compose app
158+
│ │ └── iosApp/ # iOS Xcode project
159+
│ ├── ui/ # UI components and screens
160+
│ └── xcframework/ # Standalone XCFramework build (see README)
161+
├── config/ # Configuration files
162+
├── gradle/ # Gradle configuration
163+
└── scripts/ # Utility scripts
150164
```
151165

166+
> **Note**: The `xcframework/` directory is a standalone Gradle project excluded from the main build. See [XCFramework README](./example/holder/xcframework/README.md) for build instructions and licensing information.
167+
152168
## Documentation
153169

154170
For comprehensive SDK documentation and API references:

example/holder/xcframework/README.md

Lines changed: 147 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,176 @@
22

33
This is a standalone Gradle project for building the Kiwa SDK as an iOS XCFramework.
44

5+
---
6+
7+
## IMPORTANT: Licensing and Redistribution
8+
9+
**WARNING: This XCFramework contains proprietary software.**
10+
11+
The generated `KiwaSdk.xcframework` includes the **Kiwa Holder SDK** (both public API and implementation modules), which is proprietary software owned by Sphereon International B.V.
12+
13+
- **License Required**: A valid commercial license agreement with Sphereon/Kiwa is required to use this SDK.
14+
- **Redistribution Prohibited**: Redistribution of this SDK/XCFramework, in whole or in part, is strictly forbidden without explicit written permission.
15+
- **Internal Use Only**: This framework is intended solely for the licensee's internal business purposes as outlined in the license agreement.
16+
17+
By building and using this XCFramework, you acknowledge that you have read, understood, and agreed to the terms of your license agreement with Sphereon/Kiwa.
18+
19+
For licensing inquiries, contact Sphereon International B.V.
20+
21+
---
22+
523
## Purpose
624

7-
This project creates a Swift/XCFramework with the baseName `KiwaSdk` that includes all necessary dependencies from the Kiwa Holder SDK and Sphereon Identity Development Kit.
25+
This project creates a dynamic XCFramework named `KiwaSdk` that bundles:
826

9-
## Building the XCFramework
27+
1. **Kiwa Holder SDK** - The core e-license SDK for license holder operations
28+
2. **Sphereon Identity Development Kit (IDK)** - Cryptographic operations, mDoc handling, and transport protocols
29+
30+
The XCFramework supports all iOS targets:
31+
- `iosArm64` - Physical iOS devices (iPhone, iPad)
32+
- `iosX64` - iOS Simulator on Intel Macs
33+
- `iosSimulatorArm64` - iOS Simulator on Apple Silicon Macs
34+
35+
## Why a Separate Project?
1036

11-
This project is independent from the main root project. Running `./gradlew clean build` in the root project will **not** automatically build this framework (due to the time it takes).
37+
Building an XCFramework is a time-consuming process that involves:
38+
- Compiling Kotlin/Native code for multiple iOS architectures
39+
- Running SKIE for Swift interop enhancements
40+
- Linking all dependencies into a single framework
41+
- Assembling the final XCFramework bundle
1242

13-
To build the XCFramework:
43+
To avoid this overhead on every build of the main project, this XCFramework build is intentionally separated. The main project at the repository root will **not** build this framework automatically.
44+
45+
## Building the XCFramework
46+
47+
### Quick Start
1448

1549
```bash
1650
cd example/holder/xcframework
17-
./gradlew assembleKiwaSdkXCFramework
51+
./gradlew assembleXCFrameworkKiwaSdk
1852
```
1953

54+
### Build Output
55+
2056
The generated XCFramework will be located at:
2157
```
2258
build/XCFrameworks/release/KiwaSdk.xcframework
59+
build/XCFrameworks/debug/KiwaSdk.xcframework
2360
```
2461

25-
## Build Tasks
62+
### Available Build Tasks
63+
64+
| Task | Description |
65+
|------|-------------|
66+
| `assembleXCFrameworkKiwaSdk` | Build XCFramework for all iOS targets (debug + release) |
67+
| `assembleReleaseXCFrameworkKiwaSdk` | Build release XCFramework only |
68+
| `assembleDebugXCFrameworkKiwaSdk` | Build debug XCFramework only |
69+
| `linkReleaseFrameworkIosArm64` | Build release framework for iOS devices |
70+
| `linkDebugFrameworkIosSimulatorArm64` | Build debug framework for Apple Silicon simulators |
71+
| `clean` | Clean the build directory |
72+
| `tasks` | List all available tasks |
2673

27-
- `./gradlew assembleKiwaSdkXCFramework` - Builds the XCFramework for all iOS targets (iosX64, iosArm64, iosSimulatorArm64)
28-
- `./gradlew clean` - Cleans the build directory
29-
- `./gradlew tasks` - Lists all available tasks
74+
## Dependencies Included
3075

31-
## Dependencies
76+
The XCFramework exports and bundles the following dependencies:
3277

33-
The XCFramework exports the following dependencies:
34-
- Kiwa Holder SDK (public and impl)
35-
- Sphereon Core API
36-
- Sphereon Data Link HTTP Client
37-
- Sphereon mDoc Core and Data Transfer
38-
- Sphereon Transport modules (NFC, BLE, REST API, OID4VP)
39-
- Sphereon Logger
78+
### Kiwa SDK (Proprietary)
79+
- `kiwa-holder-sdk-public` - Public API interfaces and models
80+
- `kiwa-holder-sdk-impl` - Implementation and DI components
81+
82+
### Sphereon Identity Development Kit
83+
- `lib-core-api-public` / `lib-core-api-default` - Core API abstractions
84+
- `lib-data-link-http-client-public` / `lib-data-link-http-client-impl` - HTTP client
85+
- `lib-mdoc-core-public` / `lib-mdoc-core-impl` - mDoc/mDL core functionality
86+
- `lib-mdoc-datatransfer-public` / `lib-mdoc-datatransfer-impl` - mDoc data transfer
87+
- `lib-mdoc-transport-ble` - Bluetooth Low Energy transport
88+
- `lib-mdoc-transport-restapi` - REST API transport
89+
- `lib-mdoc-transport-oid4vp` - OpenID4VP transport
90+
- `lib-core-loggers-mobile-logger` - Mobile logging
4091

4192
## Requirements
4293

43-
- JDK 17 or higher
44-
- macOS with Xcode installed
45-
- Gradle 8.x
46-
- Access to Kiwa and Sphereon repositories (credentials required)
94+
### Build Environment
95+
- **macOS** with Xcode 15+ installed (required for iOS compilation)
96+
- **JDK 17** or higher
97+
- **Gradle 8.x** (included via wrapper)
98+
99+
### Repository Access
100+
Access to private Kiwa and Sphereon Maven repositories is required. Credentials must be configured via:
101+
102+
**Environment Variables (recommended):**
103+
```bash
104+
export KIWA_REPO_USER="your-username"
105+
export KIWA_REPO_PASSWORD="your-password"
106+
```
107+
108+
**Or Gradle Properties** (`~/.gradle/gradle.properties`):
109+
```properties
110+
kiwaRepoUser=your-username
111+
kiwaRepoPassword=your-password
112+
```
113+
114+
Alternative environment variables also supported:
115+
- `NEXUS_USERNAME` / `NEXUS_PASSWORD`
116+
117+
## Integration with iOS Projects
118+
119+
### Adding to Xcode
120+
121+
1. Build the XCFramework using the commands above
122+
2. In Xcode, go to your target's **General** tab
123+
3. Under **Frameworks, Libraries, and Embedded Content**, click **+**
124+
4. Click **Add Other...** > **Add Files...**
125+
5. Navigate to `build/XCFrameworks/release/KiwaSdk.xcframework`
126+
6. Set **Embed** to **Embed & Sign**
47127

48-
## Configuration
128+
### Swift Usage
49129

50-
Repository credentials should be set via environment variables or gradle properties:
51-
- `KIWA_REPO_USER` or `kiwaRepoUser`
52-
- `KIWA_REPO_PASSWORD` or `kiwaRepoPassword`
130+
```swift
131+
import KiwaSdk
132+
133+
// Create services instance
134+
let kiwaServices: KiwaServices = ...
135+
136+
// Request wallet certificate
137+
let options = GetWalletCertificateRequestOptions(
138+
alias: "myDeviceAlias",
139+
environment: .acceptance
140+
)
141+
let result = await kiwaServices.auth.commands.getWalletCertificate.execute(args: options)
142+
143+
// Issue a license
144+
let issueResult = await kiwaServices.holder.commands.issue.execute(
145+
args: IssueLicenseRequest(environment: .acceptance)
146+
)
147+
```
53148

54149
## Version Management
55150

56-
This project references the root project's `gradle/libs.versions.toml` file to avoid duplication and ensure version consistency. Any dependency version updates made in the root project will automatically be reflected in the XCFramework build.
151+
This project references the root project's `gradle/libs.versions.toml` file to ensure version consistency. Dependency version updates in the root project are automatically reflected here.
152+
153+
Current versions are defined in:
154+
```
155+
../../../gradle/libs.versions.toml
156+
```
157+
158+
## Troubleshooting
159+
160+
### Build Fails with "No KIWA_REPO_USER environment..."
161+
Ensure repository credentials are configured. See the **Repository Access** section above.
162+
163+
### Build Fails on Non-macOS Systems
164+
XCFramework compilation requires macOS with Xcode. The Kotlin/Native compiler needs access to iOS SDKs.
165+
166+
### Out of Memory Errors
167+
Increase Gradle JVM memory in `gradle.properties`:
168+
```properties
169+
org.gradle.jvmargs=-Xmx8092M
170+
```
171+
172+
### Stale Cache Issues
173+
Clean and rebuild:
174+
```bash
175+
./gradlew clean
176+
./gradlew assembleXCFrameworkKiwaSdk --rerun-tasks
177+
```

example/holder/xcframework/settings.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ pluginManagement {
7272
dependencyResolutionManagement {
7373
versionCatalogs {
7474
create("sphereonplug") {
75-
from("com.sphereon.gradle:gradle-plugin-bom:0.3.2@toml")
75+
from("com.sphereon.gradle:gradle-plugin-bom:0.5.0@toml")
7676
}
7777
create("sphereonlib") {
78-
from("com.sphereon.gradle:library-bom:0.3.2@toml")
78+
from("com.sphereon.gradle:library-bom:0.5.0@toml")
7979
}
8080
create("libs") {
8181
from(files("../../../gradle/libs.versions.toml"))

settings.gradle.kts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ pluginManagement {
7777
dependencyResolutionManagement {
7878
versionCatalogs {
7979
create("sphereonplug") {
80-
from("com.sphereon.gradle:gradle-plugin-bom:0.5.0-SNAPSHOT@toml")
80+
from("com.sphereon.gradle:gradle-plugin-bom:0.5.0@toml")
8181
}
8282
create("sphereonlib") {
83-
from("com.sphereon.gradle:library-bom:0.5.0-SNAPSHOT@toml")
83+
from("com.sphereon.gradle:library-bom:0.5.0@toml")
8484
}
8585

8686
}
@@ -161,6 +161,10 @@ librariesRoot
161161
.maxDepth(6)
162162
.filter { it.isDirectory }
163163
.filter { it.name != "generated" && it.name != "build" }
164+
// Exclude xcframework - it has its own settings.gradle.kts and should be built separately
165+
// to avoid slow XCFramework compilation on every project build.
166+
// Build it manually: cd example/holder/xcframework && ../../../gradlew assembleXCFrameworkKiwaSdk
167+
.filter { it.name != "xcframework" }
164168
.filter {
165169
File(it, "build.gradle.kts").exists()
166170
}

0 commit comments

Comments
 (0)