Skip to content

Installation

Maven Central

Kotlin version Compose version Calf version
2.0.21 1.7.0 0.6.1
2.0.10 1.6.11 0.5.5
1.9.22 1.6.0 0.4.1
1.9.21 1.5.11 0.3.1
1.9.20 1.5.10 0.2.0
1.9.0 1.5.0 0.1.1

Add the following dependencies to your module build.gradle.kts file:

// For Adaptive UI components
api("com.mohamedrejeb.calf:calf-ui:0.6.1")

// For WebView
implementation("com.mohamedrejeb.calf:calf-webview:0.6.1")

// For FilePicker
implementation("com.mohamedrejeb.calf:calf-file-picker:0.6.1")

// For Permissions
implementation("com.mohamedrejeb.calf:calf-permissions:0.6.1")

If you are using calf-ui artifact, make sure to export it to binaries:

Regular Framewoek

...
kotlin {
    ...
    targets
        .filterIsInstance<KotlinNativeTarget>()
        .filter { it.konanTarget.family == Family.IOS }
        .forEach {
            it.binaries.framework {
                ...
                export("com.mohamedrejeb.calf:calf-ui:0.6.1")
            }
        }
    ...
}
...

CocoaPods

...
kotlin {
    ...
    cocoapods {
        ...
        framework {
            ...
            export("com.mohamedrejeb.calf:calf-ui:0.6.1")
        }
    }
    ...
}
...

Important: Exporting calf-ui to binaries is required to make it work on iOS.

Snapshots

Add the snapshots repository to your list of repositories in build.gradle.kts:

allprojects {
    repositories {
        maven("https://s01.oss.sonatype.org/content/repositories/snapshots")
    }
}

Or to your dependency resolution management in settings.gradle.kts:

dependencyResolutionManagement {
    repositories {
        maven("https://s01.oss.sonatype.org/content/repositories/snapshots")
    }
}

Use the snapshot version:

api("com.mohamedrejeb.calf:calf-ui:0.6.0-SNAPSHOT")

Note: Snapshots are deployed for each new commit on main that passes CI. They can potentially contain breaking changes or may be unstable. Use at your own risk.