[K/N] Allow running compiler with exported libs and without sources
This commit is contained in:
@@ -99,7 +99,7 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
|
||||
|
||||
val K2NativeCompilerArguments.isUsefulWithoutFreeArgs: Boolean
|
||||
get() = listTargets || listPhases || checkDependencies || !includes.isNullOrEmpty() ||
|
||||
!librariesToCache.isNullOrEmpty() || libraryToAddToCache != null
|
||||
!librariesToCache.isNullOrEmpty() || libraryToAddToCache != null || !exportedLibraries.isNullOrEmpty()
|
||||
|
||||
fun Array<String>?.toNonNullList(): List<String> {
|
||||
return this?.asList<String>() ?: listOf<String>()
|
||||
@@ -259,6 +259,7 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
|
||||
CHECK_DEPENDENCIES,
|
||||
configuration.kotlinSourceRoots.isNotEmpty()
|
||||
|| !arguments.includes.isNullOrEmpty()
|
||||
|| !arguments.exportedLibraries.isNullOrEmpty()
|
||||
|| outputKind.isCache
|
||||
|| arguments.checkDependencies
|
||||
)
|
||||
|
||||
+1
@@ -179,6 +179,7 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
|
||||
val infoArgsOnly = configuration.kotlinSourceRoots.isEmpty()
|
||||
&& configuration[KonanConfigKeys.INCLUDED_LIBRARIES].isNullOrEmpty()
|
||||
&& librariesToCache.isEmpty()
|
||||
&& configuration[KonanConfigKeys.EXPORTED_LIBRARIES].isNullOrEmpty()
|
||||
|
||||
fun librariesWithDependencies(moduleDescriptor: ModuleDescriptor?): List<KonanLibrary> {
|
||||
if (moduleDescriptor == null) error("purgeUnneeded() only works correctly after resolve is over, and we have successfully marked package files as needed or not needed.")
|
||||
|
||||
+1
-1
@@ -292,7 +292,7 @@ internal class ObjCExport(val context: Context, symbolTable: SymbolTable) {
|
||||
}
|
||||
|
||||
private fun guessMainPackage(): FqName {
|
||||
val allPackages = (context.getIncludedLibraryDescriptors() + context.moduleDescriptor).flatMap {
|
||||
val allPackages = (context.getIncludedLibraryDescriptors() + context.getExportedDependencies() + context.moduleDescriptor).flatMap {
|
||||
it.getPackageFragments() // Includes also all parent packages, e.g. the root one.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user