Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
ornoyman fix client test dependencies 2089fd7 Nov 14, 2018
0 contributors

Users who have contributed to this file

147 lines (129 sloc) 5.16 KB
apply plugin: 'kotlin-multiplatform'
apply plugin: 'kotlinx-serialization'
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android-extensions'
apply plugin: "jacoco"
androidExtensions {
experimental = true
}
//jacocoTestReport {
// reports {
// xml.enabled true
// html.enabled true
// }
//}
android {
compileSdkVersion 28
lintOptions {
abortOnError false
}
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
testCoverageEnabled = true
}
release {
testCoverageEnabled = true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
kotlin {
targets {
fromPreset(presets.android, 'android')
//for iOS device and App Store (arm64 target)
//for iOS emulator (x86_64 target)
// Change to `presets.iosArm64` to deploy the app to iPhone
// final def iOSTarget = System.getenv('SDK_NAME')?.startsWith("iphoneos") \
// ? presets.iosArm64 : presets.iosX64
def workingDir = buildscript.sourceFile.getParent()
fromPreset(presets.iosX64 , 'iOS') {
compilations.main {
outputKinds('FRAMEWORK')
linkerOpts '-rpath', '@executable_path/Frameworks'
linkerOpts "-F${workingDir}"
}
}
}
sourceSets {
commonMain {
dependencies {
api project(":common-all")
implementation 'org.jetbrains.kotlin:kotlin-stdlib-common'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutines_version"
implementation "com.russhwolf:multiplatform-settings-common:0.1"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serialization_version"
}
}
commonTest {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-test-common"
implementation "org.jetbrains.kotlin:kotlin-test-annotations-common"
implementation "io.mockk:mockk-common:$mockk_version"
}
}
androidMain {
dependsOn commonMain
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation 'com.google.firebase:firebase-firestore:17.1.0'
implementation "com.google.firebase:firebase-messaging:17.3.1"
implementation 'com.github.brotoo25:firestore-coroutines:0.0.4'
implementation "com.russhwolf:multiplatform-settings-android:0.1"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$serialization_version"
}
}
androidTest {
dependencies {
implementation "io.mockk:mockk:$mockk_version"
implementation "io.mockk:mockk-android:$mockk_version"
implementation 'org.jetbrains.kotlin:kotlin-test'
implementation 'org.jetbrains.kotlin:kotlin-test-junit'
}
}
iOSMain {
dependsOn commonMain
dependencies {
implementation "com.russhwolf:multiplatform-settings-ios:0.1.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serialization_version"
}
}
}
dependencies {
implementation "com.android.support:recyclerview-v7:28.0.0"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "com.android.support:cardview-v7:28.0.0"
implementation "com.android.support:design:28.0.0"
}
}
// This task attaches native framework built from ios module to Xcode project
// (see iosApp directory). Don't run this task directly,
// Xcode runs this task itself during its build process.
// Before opening the project from iosApp directory in Xcode,
// make sure all Gradle infrastructure exists (gradle.wrapper, gradlew).
task copyFramework {
def buildType = project.findProperty("kotlin.build.type") ?: "DEBUG"
def target = project.findProperty("kotlin.target") ?: "iOS"
dependsOn "link${buildType.toLowerCase().capitalize()}Framework${target.capitalize()}"
doLast {
def srcFile = kotlin.targets."$target".compilations.main.getBinary("FRAMEWORK", buildType)
println(srcFile.parent)
def targetDir = getProperty("configuration.build.dir")
copy {
from srcFile.parent
into targetDir
include 'common_client.framework/**'
include 'common_client.framework.dSYM'
}
}
}
You can’t perform that action at this time.