sendoav
10/16/2020, 8:25 AMArtyom Degtyarev [JB]
10/16/2020, 8:35 AMsendoav
10/16/2020, 8:40 AMapply plugin: 'com.android.library'
apply plugin: 'org.jetbrains.kotlin.multiplatform'
apply plugin: 'co.touchlab.kotlinxcodesync'
apply plugin: 'dev.icerock.mobile.multiplatform-resources'
apply from: './jacoco.gradle'
version = "1.0"
android {
signingConfigs {
debugSign {
storeFile file("$projectDir/ideConfig/debug.keystore")
keyAlias "androiddebugkey"
keyPassword KEY_PASSWORD_D
storePassword KEYSTORE_PASSWORD_D
}
releaseSign {
keyAlias "Ekasa"
keyPassword KEY_PASSWORD_R
storeFile file("$projectDir/ideConfig/retabet.jks")
storePassword KEYSTORE_PASSWORD_R
}
}
compileSdkVersion Versions.androidCompileSdkVersion
buildToolsVersion Versions.androidBuildToolsVersion
defaultConfig {
minSdkVersion Versions.androidMinSdkVersion
targetSdkVersion Versions.androidTargetSdkVersion
versionCode Versions.androidVersionCode
versionName Versions.androidVersionName
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
matchingFallbacks = ['release']
testCoverageEnabled = true
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile("proguard-android.txt"), "$projectDir/proguard-rules.pro"
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "$projectDir/proguard-rules.pro"
debuggable false
jniDebuggable false
renderscriptDebuggable false
}
}
sourceSets {
main.java.srcDirs += 'src/commonMain/kotlin'
}
lintOptions {
abortOnError false
}
testOptions {
unitTests.returnDefaultValues = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
configurations.all{
resolutionStrategy {
exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug"
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
exclude("META-INF/*.kotlin_module")
}
}
dependencies {
}
multiplatformResources {
multiplatformResourcesPackage = "ekasa.com.reabet"
}
kotlin {
targets {
targets.fromPreset(presets.android, 'android')
def buildForDevice = project.findProperty("device")?.toBoolean() ?: false
def iosPreset = (buildForDevice) ? presets.iosArm64 : presets.iosX64
fromPreset(iosPreset, 'ios') {
binaries {
framework {
// Disable bitcode embedding for the simulator build.
if (!buildForDevice) {
embedBitcode("disable")
}
export(project(":kotlinMPP:domain"))
// Export transitively.
transitiveExport = true
}
}
binaries.all {
freeCompilerArgs += "-Xg0"
}
}
}
sourceSets {
androidMain {
dependencies {
implementation GeneralDependencies.kotlinCoroutinesAndroid
implementation "androidx.annotation:annotation:1.1.0"
}
}
commonMain {
dependencies {
implementation GeneralDependencies.klock // Common
api project(':kotlinMPP:domain')
api project(':kotlinMPP:common')
implementation GeneralDependencies.kotlinCore
implementation GeneralDependencies.reaktive
api GeneralDependencies.mokoResources
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
implementation TestDependencies.mockk
}
}
iosMain {
dependencies {
//implementation GeneralDependencies.kotlinCoroutinesNative
api "co.touchlab:crashkios:0.3.0"
}
}
androidTest {
dependencies {
implementation kotlin('test')
implementation kotlin('test-junit')
implementation 'com.android.support.test:runner:1.0.2'
implementation TestDependencies.coroutinesTest
}
}
}
}
xcodeSync {
projectPath = "../../iOSApp/retabet.xcodeproj"
target = "retabet-debug"
group = "KotlinPresentation"
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}
task copyFramework {
def buildType = project.findProperty("kotlin.build.type") ?: "DEBUG"
dependsOn "link${buildType.toLowerCase().capitalize()}FrameworkIos"
doLast {
def srcFile = kotlin.targets.ios.binaries.getFramework(buildType).outputFile
def targetDir = getProperty("configuration.build.dir")
copy {
from srcFile.parent
into targetDir
include 'presentation.framework/**'
include 'presentation.framework.dSYM'
}
}
}
task doCopyResouces{
copy {
from 'build/generated/moko/iosMain/res'
into '../../iosApp/retabet/res/'
}
copy {
from 'build/generated/moko/androidMain/res/values/'
into '../../androidApp/view/src/main/res/values/'
}
}
task copyResourcesTask {
dependsOn ':kotlinMPP:presentation:generateMRiosMain'
doLast {
doCopyResouces
}
}
preBuild.dependsOn(copyResourcesTask)
Artyom Degtyarev [JB]
10/16/2020, 9:00 AM./gradlew compileKotlinIos --info
for the details.sendoav
10/16/2020, 9:03 AMsendoav
10/16/2020, 9:18 AMArtyom Degtyarev [JB]
10/16/2020, 10:10 AMsendoav
10/16/2020, 10:50 AMilya.matveev
10/16/2020, 11:02 AM--info --stacktrace --scan
flags and send us the link to the buildscan?sendoav
10/16/2020, 11:09 AMsendoav
10/16/2020, 11:09 AMilya.matveev
10/16/2020, 11:13 AMCaused by: java.io.FileNotFoundException: /Users/arantza/Apps/RETAapp/kotlinMPP/presentation/build/classes/kotlin/ios/main/presentation/manifest (No such file or directory)
at dev.icerock.gradle.generator.ios.IosMRGenerator$setupKLibResources$1.execute(IosMRGenerator.kt:91)
at dev.icerock.gradle.generator.ios.IosMRGenerator$setupKLibResources$1.execute(IosMRGenerator.kt:25)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:726)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:693)
It seems that you use an old version of the dev.icerock.mobile.multiplatform-resources
plugin. Try to update it to 0.13.1
(see https://github.com/icerockdev/moko-resources).sendoav
10/16/2020, 11:18 AM