Gradle Configuration (Android)
To set up your Android Development Environment
- Open the project gradle file.
Add the following entries into the project build.gradle file:
CODEbuildscript { ext.kotlin_version = '{latest_version}' // https://kotlinlang.org/releases.html ext.objectbox_version = '{latest_version}' // https://docs.objectbox.io/#objectbox-changelog ext.libVersion = '{cantara_client_6_version}' repositories { maven { credentials { username repoUsername password repoPassword } url "${repoUrl}artifactory/libs-release" } maven { credentials { username repoUsername password repoPassword } url "${repoUrl}artifactory/libs-snapshot" } google() jcenter() } dependencies { classpath "com.android.tools.build:gradle:{latest_version}" // Gradle plugin classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // Kotlin plugin classpath "androidx.navigation:navigation-safe-args-gradle-plugin:{latest_version}" // AndroidX navigation plugin used in the base login activity for the login and setting fragments classpath "com.google.gms:google-services:{latest_version}" // Google services plugin used for any firebase related tasks such as barcode scanning..etc classpath "com.rinami.cantara.client.android:cantara-android-plugin:$libVersion" // Cantara entity generation plugin used to generate final object classes classpath "io.objectbox:objectbox-gradle-plugin:$objectbox_version" // Object Box plugin used for local storage } }
Add Cantara Android plugin and Objectbox plugin to your app gradle file (projectRoot/app/build.gradle):
CODEplugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-android-extensions' id 'androidx.navigation.safeargs.kotlin' id 'kotlin-kapt' id 'cantara-android-plugin' id 'io.objectbox' }
Include Cantara Implementation in your app module, as a gradle compile dependency (projectRoot/app/build.gradle):
CODEimplementation "com.rinami.cantara.client.android:cantara-android-implementation:$libVersion"
Create a "gradle.properties" file in your ".gradle" root directory and add the following entries. Note: will be provided during Cantara set up.
CODErepoUsername={RepoUsername} repoPassword={RepoPassword} repoUrl={RepoUrl}
Add the following to the app build.gradle file:
CODEdecode { sourcePackage "com.rinami.cantara.client.android.schema" destinationPackage "{applicationId}" customFilePath "" }
Add the following to the app build.gradle file:
CODEafterEvaluate { project -> assembleRelease.dependsOn tasks.getByName('decodeRelease') }