[K/N lib] add Kotlin/Native metadata
This commit is contained in:
committed by
Mikhail Glukhikh
parent
114b5288b0
commit
fade311b92
File diff suppressed because it is too large
Load Diff
@@ -54,6 +54,7 @@ val PROTO_PATHS: List<ProtoPath> = listOf(
|
|||||||
ProtoPath("core/metadata/src/builtins.proto"),
|
ProtoPath("core/metadata/src/builtins.proto"),
|
||||||
ProtoPath("js/js.serializer/src/js.proto"),
|
ProtoPath("js/js.serializer/src/js.proto"),
|
||||||
ProtoPath("js/js.serializer/src/js-ast.proto"),
|
ProtoPath("js/js.serializer/src/js-ast.proto"),
|
||||||
|
ProtoPath("konan/metadata/src/konan.proto"),
|
||||||
ProtoPath("core/metadata.jvm/src/jvm_metadata.proto"),
|
ProtoPath("core/metadata.jvm/src/jvm_metadata.proto"),
|
||||||
ProtoPath("core/metadata.jvm/src/jvm_module.proto"),
|
ProtoPath("core/metadata.jvm/src/jvm_module.proto"),
|
||||||
ProtoPath("build-common/src/java_descriptors.proto")
|
ProtoPath("build-common/src/java_descriptors.proto")
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
plugins {
|
||||||
|
kotlin("jvm")
|
||||||
|
id("jps-compatible")
|
||||||
|
}
|
||||||
|
|
||||||
|
description = "Kotlin/Native metadata"
|
||||||
|
|
||||||
|
jvmTarget = "1.6"
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile(project(":compiler:serialization"))
|
||||||
|
compile(project(":konan:konan-utils"))
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
"main" { projectDefault() }
|
||||||
|
"test" {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
|
* that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
syntax = "proto2";
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.metadata.konan;
|
||||||
|
|
||||||
|
import "core/metadata/src/metadata.proto";
|
||||||
|
|
||||||
|
option java_outer_classname = "KonanProtoBuf";
|
||||||
|
option optimize_for = LITE_RUNTIME;
|
||||||
|
|
||||||
|
// Konan extensions to the "descriptors" protobuf.
|
||||||
|
|
||||||
|
extend Package {
|
||||||
|
optional int32 package_fq_name = 171;
|
||||||
|
}
|
||||||
|
|
||||||
|
extend Class {
|
||||||
|
repeated Annotation class_annotation = 170;
|
||||||
|
}
|
||||||
|
|
||||||
|
extend Constructor {
|
||||||
|
repeated Annotation constructor_annotation = 170;
|
||||||
|
optional InlineIrBody inline_constructor_ir_body = 171;
|
||||||
|
}
|
||||||
|
|
||||||
|
extend Function {
|
||||||
|
repeated Annotation function_annotation = 170;
|
||||||
|
optional InlineIrBody inline_ir_body = 171;
|
||||||
|
}
|
||||||
|
|
||||||
|
extend Property {
|
||||||
|
repeated Annotation property_annotation = 170;
|
||||||
|
optional bool has_backing_field = 171;
|
||||||
|
optional bool used_as_variable = 172;
|
||||||
|
optional Annotation.Argument.Value compile_time_value = 173;
|
||||||
|
optional InlineIrBody inline_getter_ir_body = 174;
|
||||||
|
optional InlineIrBody inline_setter_ir_body = 175;
|
||||||
|
}
|
||||||
|
|
||||||
|
extend EnumEntry {
|
||||||
|
repeated Annotation enum_entry_annotation = 170;
|
||||||
|
optional int32 enum_entry_ordinal = 171;
|
||||||
|
}
|
||||||
|
|
||||||
|
extend ValueParameter {
|
||||||
|
repeated Annotation parameter_annotation = 170;
|
||||||
|
}
|
||||||
|
|
||||||
|
extend Type {
|
||||||
|
repeated Annotation type_annotation = 170;
|
||||||
|
optional string type_text = 172; // TODO: remove me
|
||||||
|
}
|
||||||
|
|
||||||
|
extend TypeParameter {
|
||||||
|
repeated Annotation type_parameter_annotation = 170;
|
||||||
|
}
|
||||||
|
|
||||||
|
message InlineIrBody {
|
||||||
|
// We need to refer from descriptors to ir inline body.
|
||||||
|
// And in ir we need to refer local declaration descriptors
|
||||||
|
// That requires mutual import of KonanIr and KonanLinkData.
|
||||||
|
// I break the circle here by storing encoded IR.
|
||||||
|
// May be we need to merge KonanIr into KonanLinkData.
|
||||||
|
// That'd allow mutually recursive messages.
|
||||||
|
required string encoded_ir = 11;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Konan Binary Linkdata structures.
|
||||||
|
|
||||||
|
message LinkDataPackageFragment {
|
||||||
|
// Make if an index?
|
||||||
|
required string fq_name = 1;
|
||||||
|
required Package package = 4;
|
||||||
|
required LinkDataClasses classes = 5;
|
||||||
|
required bool is_empty = 6;
|
||||||
|
|
||||||
|
// To construct name resolver
|
||||||
|
required QualifiedNameTable name_table = 2;
|
||||||
|
required StringTable string_table = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message LinkDataClasses {
|
||||||
|
// Index in the QualifiedNameIndex table.
|
||||||
|
repeated int32 class_name = 1;
|
||||||
|
repeated Class classes = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message LinkDataLibrary {
|
||||||
|
required string module_name = 1;
|
||||||
|
repeated string package_fragment_name = 2;
|
||||||
|
repeated string empty_package = 3;
|
||||||
|
}
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@ description = "Kotlin/Native utils"
|
|||||||
jvmTarget = "1.6"
|
jvmTarget = "1.6"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile(projectDist(":kotlin-stdlib"))
|
compile(project(":kotlin-stdlib"))
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ include ":kotlin-build-common",
|
|||||||
":js:js.dce",
|
":js:js.dce",
|
||||||
":js:js.tests",
|
":js:js.tests",
|
||||||
":konan:konan-utils",
|
":konan:konan-utils",
|
||||||
|
":konan:konan-metadata",
|
||||||
":jps-plugin",
|
":jps-plugin",
|
||||||
":kotlin-jps-plugin",
|
":kotlin-jps-plugin",
|
||||||
":core:descriptors",
|
":core:descriptors",
|
||||||
@@ -238,6 +239,7 @@ project(':compiler:ir.ir2cfg').projectDir = "$rootDir/compiler/ir/ir.ir2cfg" as
|
|||||||
project(':compiler:ir.backend.common').projectDir = "$rootDir/compiler/ir/backend.common" as File
|
project(':compiler:ir.backend.common').projectDir = "$rootDir/compiler/ir/backend.common" as File
|
||||||
project(':compiler:backend.js').projectDir = "$rootDir/compiler/ir/backend.js" as File
|
project(':compiler:backend.js').projectDir = "$rootDir/compiler/ir/backend.js" as File
|
||||||
project(':konan:konan-utils').projectDir = "$rootDir/konan/utils" as File
|
project(':konan:konan-utils').projectDir = "$rootDir/konan/utils" as File
|
||||||
|
project(':konan:konan-metadata').projectDir = "$rootDir/konan/metadata" as File
|
||||||
project(':kotlin-jps-plugin').projectDir = "$rootDir/prepare/jps-plugin" as File
|
project(':kotlin-jps-plugin').projectDir = "$rootDir/prepare/jps-plugin" as File
|
||||||
project(':idea:idea-android-output-parser').projectDir = "$rootDir/idea/idea-android/idea-android-output-parser" as File
|
project(':idea:idea-android-output-parser').projectDir = "$rootDir/idea/idea-android/idea-android-output-parser" as File
|
||||||
project(':plugins:android-extensions-compiler').projectDir = "$rootDir/plugins/android-extensions/android-extensions-compiler" as File
|
project(':plugins:android-extensions-compiler').projectDir = "$rootDir/plugins/android-extensions/android-extensions-compiler" as File
|
||||||
|
|||||||
Reference in New Issue
Block a user