Paulius Ruminas
01/28/2019, 4:43 PMframework module common {
umbrella header "common.h"
export *
module * { export * }
}
With gradle 4.10
framework module main {
umbrella header "main.h"
export *
module * { export * }
}
Can I specify an argument that would generate the previous module that was common
instead of main
?josephivie
01/28/2019, 11:40 PMribesg
01/29/2019, 9:01 AMtimm
01/29/2019, 10:18 AMproject(":multiplatform-library")
) on the multiplatform project. When generating poms for publication a dependency
entry for multiplatform-library
is generated. It should generate a dependency
entry on multiplatform-library-jvm
though. Is there a way to fix this?yshrsmz
01/29/2019, 1:35 PMnestserau
01/29/2019, 1:45 PM> Task :compileKotlinIos
warning: skipping /Users/[me]/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-client-ios_debug_ios_x64/1.0.0/356fffd211e215e1625368473e25ce844a378845/ktor-client-ios.klib. The abi versions don't match. Expected '[5]', found '2'
warning: the compiler versions don't match either. Expected '[1.1.1]', found '1.0.2-release-4769'
Any way to address it?ribesg
01/29/2019, 2:38 PMcompileKotlinIosArm64
, it doesn’t even find the dependencies of `commonMain`:
// Somewhere in a commonMain file
import io.ktor.client.HttpClient
^
My `build.gradle.kts`: https://gist.github.com/Ribesg/d76208f8d921cb22b50347e87014c144Damiano Giusti
01/29/2019, 4:08 PMtargets
block of my build.gradle
targets {
final def iOSPreset = System.getenv('SDK_NAME')?.startsWith("iphoneos") ? presets.iosArm64 : presets.iosX64
fromPreset(iOSPreset, 'iOS') {
compilations.main.outputKinds('FRAMEWORK')
}
fromPreset(presets.jvm, 'android')
}
Damiano Giusti
01/29/2019, 4:46 PMcom.android.libray
plugin, allowing the kotlin-multiplatform
plugin create the presets.android
extension. You’ll need to create a main
folder in your source root and add a valid AndroidManifest file, specifying the package name that will be usedRobert
01/29/2019, 9:27 PMjosephivie
01/30/2019, 12:47 AMinterface ObservableProperty<T> {
val value: T
/**
* Adds a listener to be notified when the value changes.
*/
fun add(element: (T) -> Unit): Boolean
/**
* Removes a listener
*/
fun remove(element: (T) -> Unit): Boolean
}
I can either leave this data binding system in place, or I could replace it with ConflatedBroadcastChannel
from Kotlin Coroutines, which while experimental, does already exist.
I’d like your opinions on which I should choose.yshrsmz
01/30/2019, 6:52 AMTzahi Moyal
01/30/2019, 9:06 AMPaulius Ruminas
01/30/2019, 11:04 AMnestserau
01/30/2019, 2:10 PMmain
to a custom name of mine. But how should I adjust the packForXCode
task? I don’t understand. Can someone guide me? That’s my iOS target:
final def iosTarget = System.getenv('SDK_NAME')?.startsWith("iphoneos") ? presets.iosArm64 : presets.iosX64
fromPreset(iosTarget, 'ios') {
binaries {
framework {
baseName = 'reports'
}
}
}
galex
01/30/2019, 2:23 PMribesg
01/30/2019, 2:24 PMegorand
01/30/2019, 3:10 PMGarouDan
01/30/2019, 6:54 PMsourceSets {
jvmMain {
kotlin.srcDirs "src/main/kotlin"
resources.srcDir "src/main/resources"
...
}
where we are changing the dirs for the jvm target, how can we do the same for the tests folder?
I tried some variations like this one:
kotlinTest.srcDirs "src/main/test"
testResources.srcDir "src/test/resources"
but it didn’t work.
Is there a doc or a place where I can find the available options?GarouDan
01/30/2019, 11:52 PMimplementation project(':common')
If I put at least one preset / target it seems to work, but without any preset / target it isn’t working.
Do you know if we can change our build.gradle
to achieve this result?nestserau
01/31/2019, 9:18 AMreports-android
and reports-android-debug
groups. When I look at the artifcats, the AAR of the debug version takes 139K op space while the AAR of the release version from reports-android
is only 691b. I looked inside, no classes are in there. Is it the way it’s supposed to be or anything is wrong here?nestserau
01/31/2019, 10:38 AMMore than one file was found with OS independent path
when trying to build it. Googled it up a little bit, and came up with this workaround (to be placed in the build.gradle
of the library consumer):
android {
packagingOptions {
pickFirst 'META-INF/ktor-http.kotlin_module'
pickFirst 'META-INF/kotlinx-io.kotlin_module'
pickFirst 'META-INF/atomicfu.kotlin_module'
pickFirst 'META-INF/ktor-utils.kotlin_module'
pickFirst 'META-INF/kotlinx-coroutines-io.kotlin_module'
pickFirst 'META-INF/ktor-client-core.kotlin_module'
}
}
Now the compiler is happy. But is there no other solution? Not a deal breaker for me, but would like to address the core of the issue instead of having this floppy workaround.Aleksey Kornienko
01/31/2019, 5:06 PMclass AnalyticsTest {
private lateinit var context: Context
@Before
fun setUp() {
context = InstrumentationRegistry.getInstrumentation().targetContext
}
@After
fun tearDown() {
}
}
The error I get
java.lang.IllegalStateException: No instrumentation registered! Must run under a registering instrumentation.
It doesn’t work only in multiplatform projectyshrsmz
02/01/2019, 11:00 AMaddamsson
02/01/2019, 3:42 PMkotlin.test.Test
from the IDE in my commonTest
module? IDEA doesn't recognize them as tests. Note that I'm using the kotlin-multiplatform
plugin.basher
02/01/2019, 4:41 PMjosephivie
02/01/2019, 5:28 PMTzahi Moyal
02/03/2019, 11:18 AMGarouDan
02/03/2019, 3:54 PMdrofwarcs
02/04/2019, 12:10 AMdrofwarcs
02/04/2019, 12:10 AMfromPreset(iosPreset, 'ios') {
binaries {
framework()
}
compilations.main {
def productsDir = new File("").absolutePath
linkerOpts "-F${productsDir}/common/libs"
cinterops{
ocmockito {
includeDirs "${productsDir}/common/libs/OCMockitoIOS.framework/Headers"
}
}
}
}
error: unresolved reference: ocmockito
when I go to build the projectorangy
02/04/2019, 5:49 AMdrofwarcs
02/04/2019, 6:23 AMcompilations.main
to compilations.all
seem to get me pass that issue.russhwolf
02/04/2019, 12:52 PMcompilations.test
would work if you only need it for testsilya.matveev
02/04/2019, 2:25 PMI thinkThis is right. Also thewould work if you only need it for testscompilations.test
linkerOpts
property of a compilation affects only binaries created using the compilation.outputKinds
method. If you declare a binary using the binaries DSL, you need to use linkerOpts
of this binary:
binaries {
framework {
linkerOpts += ["-F${productsDir}/common/libs"]
}
}
drofwarcs
02/04/2019, 2:32 PMpackageName
of ocmockito under cinterops. Yesterday I had started out with compilations.test
but when that failed I went to compilations.main
thinking that the test compilations was wrong. the error error: unresolved reference: ocmockito
was right all alone, I had just overlooked a simple detail. Thanks again for all of your help @svyatoslav.scherbina @russhwolf