[aa-klib-reader] Implement 'analysis-api-klib-reader' for swift- and objc export

This new module gives the ability to resolve symbols
from provided klib KtLibraryModules withing a Analysis Session.

^KT-65327 Fixed
This commit is contained in:
Sebastian Sellmair
2024-03-01 11:28:09 +01:00
committed by Space Team
parent 1bb6f869a2
commit b5b7e5f262
32 changed files with 1031 additions and 2 deletions
@@ -0,0 +1,11 @@
plugins {
kotlin("multiplatform")
}
kotlin {
macosArm64()
macosX64()
linuxX64()
linuxArm64()
mingwX64()
}
@@ -0,0 +1,3 @@
# https://youtrack.jetbrains.com/issue/KT-65985
kotlin.native.toolchain.enabled=false
kotlin.native.distribution.downloadFromMaven=false
@@ -0,0 +1,14 @@
@file:Suppress("unused")
import kotlin.random.Random
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
val rootPkgProperty get() = Random.nextInt()
fun rootPkgFunction() = Random.nextInt()
fun rootPkgFunction(seed: Int) = Random(seed).nextInt()
@@ -0,0 +1,10 @@
@file:Suppress("unused")
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
class RootPkgClass {
fun foo() = Unit
class Nested
}
@@ -0,0 +1,12 @@
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("unused")
package org.jetbrains.sample
const val constantInt = 42
const val constantString = "Hello There!"
@@ -0,0 +1,14 @@
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("unused")
package org.jetbrains.sample
import org.jetbrains.sample.a.AClass
fun AClass.aExtensionFun() = this.toString()
val AClass.aExtensionProperty get() = this.toString()
@@ -0,0 +1,16 @@
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("unused")
package org.jetbrains.sample
class GenericClass<T> {
fun foo(value: T) = value
}
fun <T> genericFun(value: T) = value.toString()
val <T> T.genericProperty get() = toString()
@@ -0,0 +1,20 @@
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("unused")
package org.jetbrains.sample
private class PrivateClass
internal class InternalClass
class PublicClass
private fun privateFun() = 42
internal fun internalFun() = 42
fun publicFun() = 42
@@ -0,0 +1,15 @@
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("unused")
package org.jetbrains.sample
import org.jetbrains.sample.a.AClass
import org.jetbrains.sample.b.BClass
typealias TypeAliasA = AClass
internal typealias TypeAliasB = BClass
@@ -0,0 +1,16 @@
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("unused")
package org.jetbrains.sample.a
import kotlin.random.Random
val aProperty get() = Random.nextInt()
fun aFunction() = Random.nextInt()
fun aFunction(seed: Int) = Random(seed).nextInt()
@@ -0,0 +1,12 @@
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("unused")
package org.jetbrains.sample.a
class AClass {
class Nested
}
@@ -0,0 +1,12 @@
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("unused")
package org.jetbrains.sample.a
object AObject {
class Nested
}
@@ -0,0 +1,10 @@
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("unused")
package org.jetbrains.sample.b
class BClass
@@ -0,0 +1,10 @@
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("unused")
package org.jetbrains.sample.filePrivateSymbolsClash
private fun foo() = 42
@@ -0,0 +1,10 @@
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("unused")
package org.jetbrains.sample.filePrivateSymbolsClash
private fun foo() = 42