Compare commits

..

71 Commits

Author SHA1 Message Date
Nikita Bobko
f4fad5609f Make it possible to attach platforms with different versions to kotlin repo 2021-04-30 18:54:10 +02:00
Nikita Bobko
34c46f9c3f [cleanup] Remove unused variable 2021-04-30 18:54:10 +02:00
Nikita Bobko
baf3902bbb Create 'installIdeArtifacts' task
This task is used for cooperative compilation with intellij
2021-04-28 15:17:20 +02:00
Nikita Bobko
709be26895 [kotlin + intellij combined] Add one more artifact url
This commit fixes:
```
* What went wrong:
Execution failed for task ':kotlin-ide.intellij.platform.testExtensions:compileKotlin'.
> Could not resolve all files for configuration ':kotlin-ide.intellij.platform.testExtensions:compileClasspath'.
   > Could not find intellij-core-analysis-deprecated-202.7660.26.jar (kotlin.build:ideaIC:202.7660.26).
     Searched in the following locations:
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/202.7660.26/artifacts/lib/intellij-core-analysis-deprecated.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/202.7660.26/artifacts/intellij-core-analysis-deprecated.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/202.7660.26/artifacts/plugins/ideaIC/lib/intellij-core-analysis-deprecated.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/sources/intellij-core-analysis-deprecated-202.7660.26.jar
         file:/home/bobko/.gradle/kotlin-build-dependencies/repo/kotlin.build/ideaIC/202.7660.26/intellij-core-analysis-deprecated.jar
```
2021-04-26 21:13:41 +02:00
Nikita Bobko
d3cfa76c55 build.gradle.kts: exclude :kotlin-ide from allprojects 2021-04-26 21:08:11 +02:00
Nikita Bobko
11e4f177b8 Temporarily disable JVM IR until KT-45697 is fixed 2021-04-26 21:08:11 +02:00
Nikita Bobko
b178f16823 Initial implementation of kotlin + intellij combined repo 2021-04-26 21:07:53 +02:00
Nikita Bobko
c2df1656a2 TEMPORARILY! Fix gradle import
It is not fully supported to define distributionSha256Sum in gradle/wrapper/gradle-wrapper.properties.
Using an incorrect value may freeze or crash Android Studio.
Please manually verify or remove this property from all of included projects if applicable.
For more details, see https://github.com/gradle/gradle/issues/9361.
Use "8ad577590..." as checksum for https://services.gradle.org/distributions/gradle-6.7-bin.zip and sync project
Remove distributionSha256Sum and sync project
Open Gradle wrapper properties
2021-04-26 21:06:59 +02:00
Nikita Bobko
c1e8397554 Cleanup GenerateTests: remove tests related to Kotlin plugin 2021-04-26 21:06:59 +02:00
Nikita Bobko
21d7a83405 Remove :idea:idea-fir-performance-tests module 2021-04-26 21:06:58 +02:00
Nikita Bobko
e6cbd848e7 Remove :plugins:parcelize:parcelize-ide module 2021-04-26 21:06:58 +02:00
Nikita Bobko
c5f4680ddb TEMPORARILY! Temporarily disable ':kotlin-scripting-ide-services-unshaded' module from build
This module should leave as part of Kotlin repo not part of kotlin-ide repo.
But unfortunatelly, it depends on ide-common which is part of kotlin-ide repo.
2021-04-26 21:06:49 +02:00
Nikita Bobko
28e9db1a89 Remove :prepare:ide-lazy-resolver module 2021-04-26 20:56:36 +02:00
Nikita Bobko
055e3189d0 Remove :prepare:formatter module 2021-04-26 20:56:36 +02:00
Nikita Bobko
aea7cfcf44 Remove kotlin-ide related code 2021-04-26 20:56:36 +02:00
Nikita Bobko
1eb1fb768c Remove :prepare:idea-plugin module 2021-04-26 20:56:36 +02:00
Nikita Bobko
a03bbef270 Remove :idea module usages in remaining modules 2021-04-26 20:56:36 +02:00
Nikita Bobko
931e51457e Remove :idea module 2021-04-26 20:56:36 +02:00
Nikita Bobko
e00c8c60f1 Remove :idea:line-indent-provider module 2021-04-26 20:56:35 +02:00
Nikita Bobko
bd299d7240 Remove :idea:idea-frontend-independent module 2021-04-26 20:56:35 +02:00
Nikita Bobko
e485f27928 Remove :idea:idea-frontend-api module 2021-04-26 20:56:34 +02:00
Nikita Bobko
12e6508fe2 Remove :plugins:android-extensions-ide module 2021-04-26 20:56:34 +02:00
Nikita Bobko
e0b55b79a0 Remove :idea:idea-test-framework module 2021-04-26 20:56:34 +02:00
Nikita Bobko
019344f901 Remove :idea:idea-android module 2021-04-26 20:56:34 +02:00
Nikita Bobko
e781192aeb Remove :kotlin-scripting-ide-services module 2021-04-26 20:56:34 +02:00
Nikita Bobko
03ce1f4156 Remove :kotlin-jps-plugin module 2021-04-26 20:56:33 +02:00
Nikita Bobko
07859c8588 Remove :idea-runner module 2021-04-26 20:56:33 +02:00
Nikita Bobko
2efeb1ca88 Remove :kotlin-scripting-intellij module 2021-04-26 20:56:33 +02:00
Nikita Bobko
9fc468bb80 Remove :libraries:tools:new-project-wizard module 2021-04-26 20:56:33 +02:00
Nikita Bobko
c098e8ca88 Remove :libraries:tools:new-project-wizard:new-project-wizard-cli module 2021-04-26 20:56:33 +02:00
Nikita Bobko
ade506258c Remove :j2k module 2021-04-26 20:56:32 +02:00
Nikita Bobko
585a4b5ef5 Remove :nj2k module 2021-04-26 20:56:32 +02:00
Nikita Bobko
4a875aabad Remove :jps-plugin module 2021-04-26 20:56:32 +02:00
Nikita Bobko
3447d0776e Remove :idea:formatter module 2021-04-26 20:56:32 +02:00
Nikita Bobko
b460bd2b1a Remove :idea:scripting-support module 2021-04-26 20:56:31 +02:00
Nikita Bobko
81f64beff6 Remove :idea:kotlin-gradle-tooling module 2021-04-26 20:56:31 +02:00
Nikita Bobko
729f707f99 Remove :kotlinx-serialization-ide-plugin plugin 2021-04-26 20:56:31 +02:00
Nikita Bobko
ddfe9ec54e Remove :kotlin-scripting-idea module 2021-04-19 14:19:06 +02:00
Nikita Bobko
2b8f37bd5b Remove :noarg-ide-plugin module 2021-04-19 14:19:06 +02:00
Nikita Bobko
887eeccc5f Remove :plugins:kapt3-idea module 2021-04-19 14:19:05 +02:00
Nikita Bobko
1f1a9b5b5b Remove :plugins:annotation-based-compiler-plugins-ide-support module 2021-04-19 14:19:05 +02:00
Nikita Bobko
2dfd2bfaa9 Remove :allopen-ide-plugin module 2021-04-19 14:19:05 +02:00
Nikita Bobko
42272cf021 Remove idea/idea-live-templates dir 2021-04-19 14:19:05 +02:00
Nikita Bobko
0d586c7281 Remove :idea:jvm-debugger:jvm-debugger-test module 2021-04-19 14:19:04 +02:00
Nikita Bobko
92bd630ceb Remove :idea:jvm-debugger:jvm-debugger-sequence module 2021-04-19 14:19:04 +02:00
Nikita Bobko
8c401e863e Remove :idea:jvm-debugger:jvm-debugger-evaluation module 2021-04-19 14:19:04 +02:00
Nikita Bobko
ca9edeacc9 Remove :idea:jvm-debugger:jvm-debugger-coroutine module 2021-04-19 14:19:04 +02:00
Nikita Bobko
70662828cd Remove :idea:jvm-debugger:jvm-debugger-core module 2021-04-19 14:19:04 +02:00
Nikita Bobko
8697f1fc50 Remove :idea:jvm-debugger:jvm-debugger-util module 2021-04-19 14:19:03 +02:00
Nikita Bobko
6a126f2698 Remove :idea:jvm-debugger:eval4j module 2021-04-19 14:19:03 +02:00
Nikita Bobko
a63c99664f Remove idea/idea-repl dir 2021-04-19 14:19:03 +02:00
Nikita Bobko
046b14f796 Remove :idea:performanceTests module 2021-04-19 14:19:03 +02:00
Nikita Bobko
cc6e420bbd Remove :idea:idea-new-project-wizard 2021-04-19 14:19:02 +02:00
Nikita Bobko
d9dd998417 Remove idea-analysis module 2021-04-19 14:19:02 +02:00
Nikita Bobko
74c25e447c Remove :idea:idea-jps-common module 2021-04-19 14:19:02 +02:00
Nikita Bobko
bb22051d8b Remove :sam-with-receiver-ide-plugin module 2021-04-19 14:19:02 +02:00
Nikita Bobko
7d87491915 Remove :plugins:uast-kotlin-idea module 2021-04-19 14:19:02 +02:00
Nikita Bobko
e1961e77e8 Remove :plugins:uast-kotlin module 2021-04-19 14:19:01 +02:00
Nikita Bobko
8507172c60 Remove :nj2k:nj2k-services module 2021-04-19 14:19:01 +02:00
Nikita Bobko
cecf23cb33 Remove :idea:idea-native module 2021-04-19 14:19:01 +02:00
Nikita Bobko
540f015e47 Remove :idea:idea-gradle-native module 2021-04-19 14:19:01 +02:00
Nikita Bobko
88b63bfeb7 Remove :idea:idea-frontend-fir module 2021-04-19 14:19:00 +02:00
Nikita Bobko
9862de0b19 Remove :idea:idea-fir module 2021-04-19 14:19:00 +02:00
Nikita Bobko
0818a070b0 Remove :idea:idea-core module 2021-04-19 14:19:00 +02:00
Nikita Bobko
c02bea91f1 Remove :idea:ide-common module 2021-04-19 14:19:00 +02:00
Nikita Bobko
fa9870f6e4 Remove :idea:idea-j2k module 2021-04-19 14:19:00 +02:00
Nikita Bobko
391f14d14c Remove :idea:idea-git module 2021-04-19 14:18:59 +02:00
Nikita Bobko
72fbfd2e81 Remove :idea:idea-gradle module 2021-04-19 14:18:59 +02:00
Nikita Bobko
4f4fc47fdb Remove :idea:idea-maven module 2021-04-19 14:18:59 +02:00
Nikita Bobko
614fbe18aa Remove :idea:idea-jvm module 2021-04-19 14:18:59 +02:00
Nikita Bobko
4e159521b2 Add kotlin-ide/ to .gitignore 2021-04-19 14:18:58 +02:00
55548 changed files with 29951 additions and 1305751 deletions

1
.gitignore vendored
View File

@@ -12,6 +12,7 @@
/android-studio/sdk
out/
/tmp
kotlin-ide/
workspace.xml
*.versionsBackup
/idea/testData/debugger/tinyApp/classes*

View File

@@ -63,6 +63,27 @@
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
</codeStyleSettings>
<codeStyleSettings language="PROTO">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
@@ -80,4 +101,4 @@
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
</codeStyleSettings>
</code_scheme>
</component>
</component>

View File

@@ -3,7 +3,6 @@
<words>
<w>cinterops</w>
<w>interops</w>
<w>klibrary</w>
</words>
</dictionary>
</component>
</component>

View File

@@ -1,25 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test: Commonizer" type="GradleRunConfiguration" factoryName="Gradle" folderName="Tests">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="--tests &quot;org.jetbrains.kotlin.gradle.CommonizerHierarchicalIT&quot; --tests &quot;org.jetbrains.kotlin.gradle.CommonizerIT&quot; --tests &quot;org.jetbrains.kotlin.commonizer.**&quot;" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":native:kotlin-klib-commonizer-api:test" />
<option value=":native:kotlin-klib-commonizer:test" />
<option value=":kotlin-gradle-plugin-integration-tests:test" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>

View File

@@ -10,21 +10,17 @@ public final class DebugKlibMetadataProtoBuf {
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.packageFqName);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.classAnnotation);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.classFile);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.classKdoc);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.classUniqId);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.constructorAnnotation);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.constructorKdoc);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.constructorUniqId);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.functionAnnotation);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.functionFile);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.functionKdoc);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.functionUniqId);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.propertyAnnotation);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.propertyGetterAnnotation);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.propertySetterAnnotation);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.compileTimeValue);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.propertyFile);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.propertyKdoc);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.propertyUniqId);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.enumEntryAnnotation);
registry.add(org.jetbrains.kotlin.library.metadata.DebugKlibMetadataProtoBuf.enumEntryOrdinal);
@@ -3167,17 +3163,6 @@ public final class DebugKlibMetadataProtoBuf {
.newFileScopedGeneratedExtension(
java.lang.Integer.class,
null);
public static final int CLASS_KDOC_FIELD_NUMBER = 176;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Class { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Class,
java.lang.String> classKdoc = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.String.class,
null);
public static final int CLASS_UNIQ_ID_FIELD_NUMBER = 171;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Class { ... }</code>
@@ -3200,17 +3185,6 @@ public final class DebugKlibMetadataProtoBuf {
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int CONSTRUCTOR_KDOC_FIELD_NUMBER = 173;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Constructor { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Constructor,
java.lang.String> constructorKdoc = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.String.class,
null);
public static final int CONSTRUCTOR_UNIQ_ID_FIELD_NUMBER = 172;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Constructor { ... }</code>
@@ -3244,17 +3218,6 @@ public final class DebugKlibMetadataProtoBuf {
.newFileScopedGeneratedExtension(
java.lang.Integer.class,
null);
public static final int FUNCTION_KDOC_FIELD_NUMBER = 174;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Function { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Function,
java.lang.String> functionKdoc = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.String.class,
null);
public static final int FUNCTION_UNIQ_ID_FIELD_NUMBER = 173;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Function { ... }</code>
@@ -3321,17 +3284,6 @@ public final class DebugKlibMetadataProtoBuf {
.newFileScopedGeneratedExtension(
java.lang.Integer.class,
null);
public static final int PROPERTY_KDOC_FIELD_NUMBER = 180;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.lang.String> propertyKdoc = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.String.class,
null);
public static final int PROPERTY_UNIQ_ID_FIELD_NUMBER = 179;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
@@ -3528,79 +3480,72 @@ public final class DebugKlibMetadataProtoBuf {
".metadata.Class\030\252\001 \003(\0132).org.jetbrains.k" +
"otlin.metadata.Annotation:?\n\nclass_file\022",
"$.org.jetbrains.kotlin.metadata.Class\030\257\001" +
" \001(\005B\004\200\265\030\001:?\n\nclass_kdoc\022$.org.jetbrains" +
".kotlin.metadata.Class\030\260\001 \001(\tB\004\200\265\030\001:u\n\rc" +
"lass_uniq_id\022$.org.jetbrains.kotlin.meta" +
"data.Class\030\253\001 \001(\01327.org.jetbrains.kotlin" +
".library.metadata.DescriptorUniqId:v\n\026co" +
"nstructor_annotation\022*.org.jetbrains.kot" +
"lin.metadata.Constructor\030\252\001 \003(\0132).org.je" +
"tbrains.kotlin.metadata.Annotation:K\n\020co" +
"nstructor_kdoc\022*.org.jetbrains.kotlin.me",
"tadata.Constructor\030\255\001 \001(\tB\004\200\265\030\001:\201\001\n\023cons" +
"tructor_uniq_id\022*.org.jetbrains.kotlin.m" +
"etadata.Constructor\030\254\001 \001(\01327.org.jetbrai" +
"ns.kotlin.library.metadata.DescriptorUni" +
"qId:p\n\023function_annotation\022\'.org.jetbrai" +
"ns.kotlin.metadata.Function\030\252\001 \003(\0132).org" +
".jetbrains.kotlin.metadata.Annotation:E\n" +
"\rfunction_file\022\'.org.jetbrains.kotlin.me" +
"tadata.Function\030\254\001 \001(\005B\004\200\265\030\001:E\n\rfunction" +
"_kdoc\022\'.org.jetbrains.kotlin.metadata.Fu",
"nction\030\256\001 \001(\tB\004\200\265\030\001:{\n\020function_uniq_id\022" +
"\'.org.jetbrains.kotlin.metadata.Function" +
"\030\255\001 \001(\01327.org.jetbrains.kotlin.library.m" +
"etadata.DescriptorUniqId:p\n\023property_ann" +
"otation\022\'.org.jetbrains.kotlin.metadata." +
"Property\030\252\001 \003(\0132).org.jetbrains.kotlin.m" +
"etadata.Annotation:w\n\032property_getter_an" +
"notation\022\'.org.jetbrains.kotlin.metadata" +
".Property\030\261\001 \003(\0132).org.jetbrains.kotlin." +
"metadata.Annotation:w\n\032property_setter_a",
"nnotation\022\'.org.jetbrains.kotlin.metadat" +
"a.Property\030\262\001 \003(\0132).org.jetbrains.kotlin" +
".metadata.Annotation:~\n\022compile_time_val" +
"ue\022\'.org.jetbrains.kotlin.metadata.Prope" +
"rty\030\255\001 \001(\01328.org.jetbrains.kotlin.metada" +
"ta.Annotation.Argument.Value:E\n\rproperty" +
"_file\022\'.org.jetbrains.kotlin.metadata.Pr" +
"operty\030\260\001 \001(\005B\004\200\265\030\001:E\n\rproperty_kdoc\022\'.o" +
"rg.jetbrains.kotlin.metadata.Property\030\264\001" +
" \001(\tB\004\200\265\030\001:{\n\020property_uniq_id\022\'.org.jet",
"brains.kotlin.metadata.Property\030\263\001 \001(\01327" +
".org.jetbrains.kotlin.library.metadata.D" +
"escriptorUniqId:s\n\025enum_entry_annotation" +
"\022(.org.jetbrains.kotlin.metadata.EnumEnt" +
"ry\030\252\001 \003(\0132).org.jetbrains.kotlin.metadat" +
"a.Annotation:E\n\022enum_entry_ordinal\022(.org" +
".jetbrains.kotlin.metadata.EnumEntry\030\253\001 " +
"\001(\005:~\n\022enum_entry_uniq_id\022(.org.jetbrain" +
"s.kotlin.metadata.EnumEntry\030\254\001 \001(\01327.org" +
".jetbrains.kotlin.library.metadata.Descr",
"iptorUniqId:w\n\024parameter_annotation\022-.or" +
"g.jetbrains.kotlin.metadata.ValueParamet" +
"er\030\252\001 \003(\0132).org.jetbrains.kotlin.metadat" +
"a.Annotation:h\n\017type_annotation\022#.org.je" +
"tbrains.kotlin.metadata.Type\030\252\001 \003(\0132).or" +
"g.jetbrains.kotlin.metadata.Annotation:{" +
"\n\031type_parameter_annotation\022,.org.jetbra" +
"ins.kotlin.metadata.TypeParameter\030\252\001 \003(\013" +
"2).org.jetbrains.kotlin.metadata.Annotat" +
"ion:\202\001\n\022type_param_uniq_id\022,.org.jetbrai",
"ns.kotlin.metadata.TypeParameter\030\253\001 \001(\0132" +
"7.org.jetbrains.kotlin.library.metadata." +
"DescriptorUniqId:U\n\026package_fragment_fil" +
"es\022..org.jetbrains.kotlin.metadata.Packa" +
"geFragment\030\252\001 \003(\005B\004\200\265\030\001:A\n\010is_empty\022..or" +
"g.jetbrains.kotlin.metadata.PackageFragm" +
"ent\030\254\001 \001(\010:@\n\007fq_name\022..org.jetbrains.ko" +
"tlin.metadata.PackageFragment\030\255\001 \001(\t:G\n\n" +
"class_name\022..org.jetbrains.kotlin.metada" +
"ta.PackageFragment\030\256\001 \003(\005B\002\020\001:~\n\022type_al",
"ias_uniq_id\022(.org.jetbrains.kotlin.metad" +
"ata.TypeAlias\030\203\001 \001(\01327.org.jetbrains.kot" +
"lin.library.metadata.DescriptorUniqIdB\033B" +
"\031DebugKlibMetadataProtoBuf"
" \001(\005B\004\200\265\030\001:u\n\rclass_uniq_id\022$.org.jetbra" +
"ins.kotlin.metadata.Class\030\253\001 \001(\01327.org.j" +
"etbrains.kotlin.library.metadata.Descrip" +
"torUniqId:v\n\026constructor_annotation\022*.or" +
"g.jetbrains.kotlin.metadata.Constructor\030" +
"\252\001 \003(\0132).org.jetbrains.kotlin.metadata.A" +
"nnotation:\201\001\n\023constructor_uniq_id\022*.org." +
"jetbrains.kotlin.metadata.Constructor\030\254\001" +
" \001(\01327.org.jetbrains.kotlin.library.meta",
"data.DescriptorUniqId:p\n\023function_annota" +
"tion\022\'.org.jetbrains.kotlin.metadata.Fun" +
"ction\030\252\001 \003(\0132).org.jetbrains.kotlin.meta" +
"data.Annotation:E\n\rfunction_file\022\'.org.j" +
"etbrains.kotlin.metadata.Function\030\254\001 \001(\005" +
"B\004\200\265\030\001:{\n\020function_uniq_id\022\'.org.jetbrai" +
"ns.kotlin.metadata.Function\030\255\001 \001(\01327.org" +
".jetbrains.kotlin.library.metadata.Descr" +
"iptorUniqId:p\n\023property_annotation\022\'.org" +
".jetbrains.kotlin.metadata.Property\030\252\001 \003",
"(\0132).org.jetbrains.kotlin.metadata.Annot" +
"ation:w\n\032property_getter_annotation\022\'.or" +
"g.jetbrains.kotlin.metadata.Property\030\261\001 " +
"\003(\0132).org.jetbrains.kotlin.metadata.Anno" +
"tation:w\n\032property_setter_annotation\022\'.o" +
"rg.jetbrains.kotlin.metadata.Property\030\262\001" +
" \003(\0132).org.jetbrains.kotlin.metadata.Ann" +
"otation:~\n\022compile_time_value\022\'.org.jetb" +
"rains.kotlin.metadata.Property\030\255\001 \001(\01328." +
"org.jetbrains.kotlin.metadata.Annotation",
".Argument.Value:E\n\rproperty_file\022\'.org.j" +
"etbrains.kotlin.metadata.Property\030\260\001 \001(\005" +
"B\004\200\265\030\001:{\n\020property_uniq_id\022\'.org.jetbrai" +
"ns.kotlin.metadata.Property\030\263\001 \001(\01327.org" +
".jetbrains.kotlin.library.metadata.Descr" +
"iptorUniqId:s\n\025enum_entry_annotation\022(.o" +
"rg.jetbrains.kotlin.metadata.EnumEntry\030\252" +
"\001 \003(\0132).org.jetbrains.kotlin.metadata.An" +
"notation:E\n\022enum_entry_ordinal\022(.org.jet" +
"brains.kotlin.metadata.EnumEntry\030\253\001 \001(\005:",
"~\n\022enum_entry_uniq_id\022(.org.jetbrains.ko" +
"tlin.metadata.EnumEntry\030\254\001 \001(\01327.org.jet" +
"brains.kotlin.library.metadata.Descripto" +
"rUniqId:w\n\024parameter_annotation\022-.org.je" +
"tbrains.kotlin.metadata.ValueParameter\030\252" +
"\001 \003(\0132).org.jetbrains.kotlin.metadata.An" +
"notation:h\n\017type_annotation\022#.org.jetbra" +
"ins.kotlin.metadata.Type\030\252\001 \003(\0132).org.je" +
"tbrains.kotlin.metadata.Annotation:{\n\031ty" +
"pe_parameter_annotation\022,.org.jetbrains.",
"kotlin.metadata.TypeParameter\030\252\001 \003(\0132).o" +
"rg.jetbrains.kotlin.metadata.Annotation:" +
"\202\001\n\022type_param_uniq_id\022,.org.jetbrains.k" +
"otlin.metadata.TypeParameter\030\253\001 \001(\01327.or" +
"g.jetbrains.kotlin.library.metadata.Desc" +
"riptorUniqId:U\n\026package_fragment_files\022." +
".org.jetbrains.kotlin.metadata.PackageFr" +
"agment\030\252\001 \003(\005B\004\200\265\030\001:A\n\010is_empty\022..org.je" +
"tbrains.kotlin.metadata.PackageFragment\030" +
"\254\001 \001(\010:@\n\007fq_name\022..org.jetbrains.kotlin",
".metadata.PackageFragment\030\255\001 \001(\t:G\n\nclas" +
"s_name\022..org.jetbrains.kotlin.metadata.P" +
"ackageFragment\030\256\001 \003(\005B\002\020\001:~\n\022type_alias_" +
"uniq_id\022(.org.jetbrains.kotlin.metadata." +
"TypeAlias\030\203\001 \001(\01327.org.jetbrains.kotlin." +
"library.metadata.DescriptorUniqIdB\033B\031Deb" +
"ugKlibMetadataProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -3637,34 +3582,30 @@ public final class DebugKlibMetadataProtoBuf {
packageFqName.internalInit(descriptor.getExtensions().get(0));
classAnnotation.internalInit(descriptor.getExtensions().get(1));
classFile.internalInit(descriptor.getExtensions().get(2));
classKdoc.internalInit(descriptor.getExtensions().get(3));
classUniqId.internalInit(descriptor.getExtensions().get(4));
constructorAnnotation.internalInit(descriptor.getExtensions().get(5));
constructorKdoc.internalInit(descriptor.getExtensions().get(6));
constructorUniqId.internalInit(descriptor.getExtensions().get(7));
functionAnnotation.internalInit(descriptor.getExtensions().get(8));
functionFile.internalInit(descriptor.getExtensions().get(9));
functionKdoc.internalInit(descriptor.getExtensions().get(10));
functionUniqId.internalInit(descriptor.getExtensions().get(11));
propertyAnnotation.internalInit(descriptor.getExtensions().get(12));
propertyGetterAnnotation.internalInit(descriptor.getExtensions().get(13));
propertySetterAnnotation.internalInit(descriptor.getExtensions().get(14));
compileTimeValue.internalInit(descriptor.getExtensions().get(15));
propertyFile.internalInit(descriptor.getExtensions().get(16));
propertyKdoc.internalInit(descriptor.getExtensions().get(17));
propertyUniqId.internalInit(descriptor.getExtensions().get(18));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(19));
enumEntryOrdinal.internalInit(descriptor.getExtensions().get(20));
enumEntryUniqId.internalInit(descriptor.getExtensions().get(21));
parameterAnnotation.internalInit(descriptor.getExtensions().get(22));
typeAnnotation.internalInit(descriptor.getExtensions().get(23));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(24));
typeParamUniqId.internalInit(descriptor.getExtensions().get(25));
packageFragmentFiles.internalInit(descriptor.getExtensions().get(26));
isEmpty.internalInit(descriptor.getExtensions().get(27));
fqName.internalInit(descriptor.getExtensions().get(28));
className.internalInit(descriptor.getExtensions().get(29));
typeAliasUniqId.internalInit(descriptor.getExtensions().get(30));
classUniqId.internalInit(descriptor.getExtensions().get(3));
constructorAnnotation.internalInit(descriptor.getExtensions().get(4));
constructorUniqId.internalInit(descriptor.getExtensions().get(5));
functionAnnotation.internalInit(descriptor.getExtensions().get(6));
functionFile.internalInit(descriptor.getExtensions().get(7));
functionUniqId.internalInit(descriptor.getExtensions().get(8));
propertyAnnotation.internalInit(descriptor.getExtensions().get(9));
propertyGetterAnnotation.internalInit(descriptor.getExtensions().get(10));
propertySetterAnnotation.internalInit(descriptor.getExtensions().get(11));
compileTimeValue.internalInit(descriptor.getExtensions().get(12));
propertyFile.internalInit(descriptor.getExtensions().get(13));
propertyUniqId.internalInit(descriptor.getExtensions().get(14));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(15));
enumEntryOrdinal.internalInit(descriptor.getExtensions().get(16));
enumEntryUniqId.internalInit(descriptor.getExtensions().get(17));
parameterAnnotation.internalInit(descriptor.getExtensions().get(18));
typeAnnotation.internalInit(descriptor.getExtensions().get(19));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(20));
typeParamUniqId.internalInit(descriptor.getExtensions().get(21));
packageFragmentFiles.internalInit(descriptor.getExtensions().get(22));
isEmpty.internalInit(descriptor.getExtensions().get(23));
fqName.internalInit(descriptor.getExtensions().get(24));
className.internalInit(descriptor.getExtensions().get(25));
typeAliasUniqId.internalInit(descriptor.getExtensions().get(26));
org.jetbrains.kotlin.protobuf.ExtensionRegistry registry =
org.jetbrains.kotlin.protobuf.ExtensionRegistry.newInstance();
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipMessageInComparison);
@@ -3672,10 +3613,6 @@ public final class DebugKlibMetadataProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipInComparison);
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
.internalUpdateFileDescriptor(descriptor, registry);
org.jetbrains.kotlin.metadata.DebugProtoBuf.getDescriptor();

View File

@@ -76,8 +76,10 @@ val kotlinVersion by extra(
val kotlinLanguageVersion by extra("1.5")
allprojects {
group = "org.jetbrains.kotlin"
version = kotlinVersion
if (!path.startsWith(":kotlin-ide")) {
group = "org.jetbrains.kotlin"
version = kotlinVersion
}
}
extra["kotlin_root"] = rootDir
@@ -192,7 +194,7 @@ extra["versions.kotlinx-collections-immutable-jvm"] = immutablesVersion
extra["versions.ktor-network"] = "1.0.1"
if (!project.hasProperty("versions.kotlin-native")) {
extra["versions.kotlin-native"] = "1.5.20-dev-5613"
extra["versions.kotlin-native"] = "1.5.20-dev-3553"
}
val intellijUltimateEnabled by extra(project.kotlinBuildProperties.intellijUltimateEnabled)
@@ -317,7 +319,6 @@ extra["compilerModulesForJps"] = listOf(
":core:compiler.common.jvm",
":core:descriptors",
":core:descriptors.jvm",
":idea:idea-jps-common",
":kotlin-preloader",
":compiler:util",
":compiler:config",
@@ -327,6 +328,33 @@ extra["compilerModulesForJps"] = listOf(
":compiler:compiler.version"
)
extra["compilerArtifactsForIde"] = listOf(
":prepare:ide-plugin-dependencies:android-extensions-compiler-plugin-for-ide",
":prepare:ide-plugin-dependencies:allopen-compiler-plugin-for-ide",
":prepare:ide-plugin-dependencies:incremental-compilation-impl-tests-for-ide",
":prepare:ide-plugin-dependencies:kotlin-build-common-tests-for-ide",
":prepare:ide-plugin-dependencies:kotlin-compiler-for-ide",
":prepare:ide-plugin-dependencies:kotlin-gradle-statistics-for-ide",
":prepare:ide-plugin-dependencies:kotlinx-serialization-compiler-plugin-for-ide",
":prepare:ide-plugin-dependencies:noarg-compiler-plugin-for-ide",
":prepare:ide-plugin-dependencies:sam-with-receiver-compiler-plugin-for-ide",
":prepare:ide-plugin-dependencies:compiler-components-for-jps",
":prepare:ide-plugin-dependencies:parcelize-compiler-plugin-for-ide",
":kotlin-script-runtime",
":kotlin-script-util",
":kotlin-scripting-common",
":kotlin-scripting-jvm",
":kotlin-scripting-compiler",
":kotlin-scripting-compiler-impl",
":kotlin-android-extensions-runtime",
":kotlin-stdlib-common",
":kotlin-stdlib",
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":kotlin-reflect",
":kotlin-main-kts"
)
// TODO: fix remaining warnings and remove this property.
extra["tasksWithWarnings"] = listOf(
":kotlin-stdlib:compileTestKotlin",
@@ -355,12 +383,6 @@ val coreLibProjects = listOfNotNull(
":kotlin-reflect"
)
val projectsWithDisabledFirBootstrap = coreLibProjects + listOf(
":kotlin-gradle-plugin",
":kotlinx-metadata",
":kotlinx-metadata-jvm"
)
val gradlePluginProjects = listOf(
":kotlin-gradle-plugin",
":kotlin-gradle-plugin-api",
@@ -368,8 +390,7 @@ val gradlePluginProjects = listOf(
":kotlin-annotation-processing-gradle",
":kotlin-noarg",
":kotlin-sam-with-receiver",
":kotlin-parcelize-compiler",
":kotlin-lombok"
":kotlin-parcelize-compiler"
)
apply {
@@ -397,6 +418,29 @@ val defaultJavaHome = jdkPath(if (Platform[203].orHigher()) "11" else defaultJvm
val ignoreTestFailures by extra(project.kotlinBuildProperties.ignoreTestFailures)
allprojects {
val mirrorRepo: String? = findProperty("maven.repository.mirror")?.toString()
repositories {
kotlinBuildLocalRepo(project)
mirrorRepo?.let(::maven)
internalBootstrapRepo?.let(::maven)
bootstrapKotlinRepo?.let(::maven)
maven(protobufRepo)
maven(intellijRepo)
mavenCentral()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies")
maven("https://dl.google.com/dl/android/maven2")
maven("https://packages.jetbrains.team/maven/p/ij/intellij-dependencies")
jcenter()
}
if (path.startsWith(":kotlin-ide.")) {
return@allprojects
}
configurations.maybeCreate("embedded").apply {
isCanBeConsumed = false
@@ -425,25 +469,6 @@ allprojects {
// therefore it is disabled by default
// buildDir = File(commonBuildDir, project.name)
val mirrorRepo: String? = findProperty("maven.repository.mirror")?.toString()
repositories {
kotlinBuildLocalRepo(project)
mirrorRepo?.let(::maven)
internalBootstrapRepo?.let(::maven)
bootstrapKotlinRepo?.let(::maven)
maven(protobufRepo)
maven(intellijRepo)
mavenCentral()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies")
maven("https://dl.google.com/dl/android/maven2")
maven("https://packages.jetbrains.team/maven/p/ij/intellij-dependencies")
jcenter()
}
configureJvmProject(javaHome!!, jvmTarget!!)
@@ -474,9 +499,11 @@ allprojects {
if (useJvmIrBackend) {
useIR = true
} else {
useOldBackend = true
}
if (useJvmFir && this@allprojects.name !in projectsWithDisabledFirBootstrap) {
if (useJvmFir) {
freeCompilerArgs += "-Xuse-fir"
freeCompilerArgs += "-Xabi-stability=stable"
}
@@ -578,6 +605,26 @@ allprojects {
}
}
if ((gradle.startParameter as? org.gradle.api.internal.StartParameterInternal)?.isConfigurationCache != true) {
// TODO: remove it once Gradle is bumped to 6.8:
// See https://docs.gradle.org/6.8/release-notes.html#more-cache-hits-when-empty-directories-are-present
gradle.buildFinished {
val taskGraph = gradle?.taskGraph
if (taskGraph != null) {
taskGraph.allTasks
.filterIsInstance<SourceTask>()
.filter { it.didWork }
.forEach {
it.source.visit {
if (file.isDirectory && file.listFiles()?.isEmpty() == true) {
logger.warn("Empty source directories may cause build cache misses: " + file.absolutePath)
}
}
}
}
}
}
gradle.taskGraph.whenReady {
fun Boolean.toOnOff(): String = if (this) "on" else "off"
val profile = if (isTeamcityBuild) "CI" else "Local"
@@ -612,11 +659,6 @@ val copyCompilerToIdeaPlugin by task<Copy> {
from(distDir) { include("kotlinc/**") }
}
val ideaPlugin by task<Task> {
dependsOn(copyCompilerToIdeaPlugin)
dependsOn(":prepare:idea-plugin:ideaPlugin")
}
tasks {
named<Delete>("clean") {
delete += setOf("$buildDir/repo", distDir)
@@ -761,9 +803,6 @@ tasks {
dependsOn("jvmCompilerIntegrationTest")
dependsOn(":plugins:parcelize:parcelize-compiler:test")
dependsOn(":kotlin-util-io:test")
dependsOn(":kotlin-util-klib:test")
}
register("toolsTest") {
@@ -795,65 +834,9 @@ tasks {
dependsOn(":compiler:android-tests:test")
}
register("jps-tests") {
dependsOn("dist")
dependsOn(":jps-plugin:test")
}
register("idea-plugin-additional-tests") {
dependsOn("dist")
dependsOn(
":idea:idea-maven:test",
":nj2k:test",
":idea:jvm-debugger:jvm-debugger-core:test",
":idea:jvm-debugger:jvm-debugger-evaluation:test",
":idea:jvm-debugger:jvm-debugger-sequence:test",
":idea:jvm-debugger:eval4j:test",
":idea:scripting-support:test"
)
}
if (Ide.IJ()) {
register("idea-new-project-wizard-tests") {
dependsOn(
":libraries:tools:new-project-wizard:test",
":libraries:tools:new-project-wizard:new-project-wizard-cli:test",
":idea:idea-new-project-wizard:test"
)
}
}
register("idea-plugin-performance-tests") {
dependsOn(
"dist",
":idea:performanceTests:performanceTest",
":idea:performanceTests:aggregateResults"
)
}
register("idea-fir-plugin-performance-tests") {
dependsOn("dist")
dependsOn(
":idea:idea-fir-performance-tests:ideaFirPerformanceTest"
)
}
register("idea-fir-plugin-tests") {
dependsOn("dist")
dependsOn(
":idea:idea-fir:test",
":idea:idea-frontend-api:test",
":idea:idea-frontend-fir:test",
":idea:idea-frontend-fir:idea-fir-low-level-api:test"
)
}
register("android-ide-tests") {
dependsOn("dist")
dependsOn(
":plugins:android-extensions-ide:test",
":idea:idea-android:test",
":kotlin-annotation-processing:test",
":plugins:parcelize:parcelize-ide:test"
)
@@ -880,11 +863,7 @@ tasks {
":plugins:uast-kotlin:test",
":kotlin-annotation-processing-gradle:test",
":kotlinx-serialization-compiler-plugin:test",
":kotlinx-serialization-ide-plugin:test",
":idea:jvm-debugger:jvm-debugger-test:test",
"idea-plugin-additional-tests",
"jps-tests",
":generators:test"
":kotlinx-serialization-ide-plugin:test"
)
if (Ide.IJ()) {
dependsOn(
@@ -950,32 +929,13 @@ tasks {
register("publishIdeArtifacts") {
idePluginDependency {
dependsOn(
":prepare:ide-plugin-dependencies:android-extensions-compiler-plugin-for-ide:publish",
":prepare:ide-plugin-dependencies:allopen-compiler-plugin-for-ide:publish",
":prepare:ide-plugin-dependencies:incremental-compilation-impl-tests-for-ide:publish",
":prepare:ide-plugin-dependencies:kotlin-build-common-tests-for-ide:publish",
":prepare:ide-plugin-dependencies:kotlin-compiler-for-ide:publish",
":prepare:ide-plugin-dependencies:kotlin-gradle-statistics-for-ide:publish",
":prepare:ide-plugin-dependencies:kotlinx-serialization-compiler-plugin-for-ide:publish",
":prepare:ide-plugin-dependencies:noarg-compiler-plugin-for-ide:publish",
":prepare:ide-plugin-dependencies:sam-with-receiver-compiler-plugin-for-ide:publish",
":prepare:ide-plugin-dependencies:compiler-components-for-jps:publish",
":prepare:ide-plugin-dependencies:parcelize-compiler-plugin-for-ide:publish",
":kotlin-script-runtime:publish",
":kotlin-script-util:publish",
":kotlin-scripting-common:publish",
":kotlin-scripting-jvm:publish",
":kotlin-scripting-compiler:publish",
":kotlin-scripting-compiler-impl:publish",
":kotlin-android-extensions-runtime:publish",
":kotlin-stdlib-common:publish",
":kotlin-stdlib:publish",
":kotlin-stdlib-jdk7:publish",
":kotlin-stdlib-jdk8:publish",
":kotlin-reflect:publish",
":kotlin-main-kts:publish"
)
dependsOn((rootProject.extra["compilerArtifactsForIde"] as List<String>).map { "$it:prepare" })
}
}
register("installIdeArtifacts") {
idePluginDependency {
dependsOn((rootProject.extra["compilerArtifactsForIde"] as List<String>).map { "$it:install" })
}
}
}

View File

@@ -145,7 +145,7 @@ dependencies {
implementation(kotlin("stdlib", embeddedKotlinVersion))
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}")
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.26")
implementation("com.gradle.publish:plugin-publish-plugin:0.14.0")
implementation("com.gradle.publish:plugin-publish-plugin:0.13.0")
implementation("net.rubygrapefruit:native-platform:${property("versions.native-platform")}")
implementation("net.rubygrapefruit:native-platform-windows-amd64:${property("versions.native-platform")}")

View File

@@ -18,6 +18,7 @@ plugins {
val intellijUltimateEnabled: Boolean by rootProject.extra
val intellijReleaseType: String by rootProject.extra
val intellijVersion = rootProject.extra["versions.intellijSdk"] as String
val intellijVersionForIde = rootProject.intellijSdkVersionForIde()
val asmVersion = rootProject.findProperty("versions.jar.asm-all") as String?
val androidStudioRelease = rootProject.findProperty("versions.androidStudioRelease") as String?
val androidStudioBuild = rootProject.findProperty("versions.androidStudioBuild") as String?
@@ -25,15 +26,18 @@ val intellijSeparateSdks: Boolean by rootProject.extra
val installIntellijCommunity = !intellijUltimateEnabled || intellijSeparateSdks
val installIntellijUltimate = intellijUltimateEnabled && androidStudioRelease == null
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
if (intellijVersionDelimiterIndex == -1) {
error("Invalid IDEA version $intellijVersion")
fun checkIntellijVersion(intellijVersion: String) {
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
if (intellijVersionDelimiterIndex == -1) {
error("Invalid IDEA version $intellijVersion")
}
}
val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex)
checkIntellijVersion(intellijVersion)
intellijVersionForIde?.let { checkIntellijVersion(it) }
logger.info("intellijUltimateEnabled: $intellijUltimateEnabled")
logger.info("intellijVersion: $intellijVersion")
logger.info("intellijVersionForIde: $intellijVersionForIde")
logger.info("androidStudioRelease: $androidStudioRelease")
logger.info("androidStudioBuild: $androidStudioBuild")
logger.info("intellijSeparateSdks: $intellijSeparateSdks")
@@ -73,11 +77,16 @@ repositories {
}
val intellij by configurations.creating
val intellijForIde by configurations.creating
val intellijUltimate by configurations.creating
val intellijUltimateForIde by configurations.creating
val androidStudio by configurations.creating
val sources by configurations.creating
val sourcesForIde by configurations.creating
val jpsStandalone by configurations.creating
val jpsStandaloneForIde by configurations.creating
val intellijCore by configurations.creating
val intellijCoreForIde by configurations.creating
val nodeJSPlugin by configurations.creating
/**
@@ -93,7 +102,6 @@ val dependenciesDir = (findProperty("kotlin.build.dependencies.dir") as String?)
val customDepsRepoDir = dependenciesDir.resolve("repo")
val customDepsOrg: String by rootProject.extra
val customDepsRevision = intellijVersion
val repoDir = File(customDepsRepoDir, customDepsOrg)
dependencies {
@@ -107,9 +115,11 @@ dependencies {
} else {
if (installIntellijCommunity) {
intellij("com.jetbrains.intellij.idea:ideaIC:$intellijVersion")
intellijVersionForIde?.let { intellijForIde("com.jetbrains.intellij.idea:ideaIC:$it") }
}
if (installIntellijUltimate) {
intellijUltimate("com.jetbrains.intellij.idea:ideaIU:$intellijVersion")
intellijVersionForIde.let { intellijUltimateForIde("com.jetbrains.intellij.idea:ideaIU:$it") }
}
}
@@ -118,102 +128,111 @@ dependencies {
}
sources("com.jetbrains.intellij.idea:ideaIC:$intellijVersion:sources@jar")
intellijVersionForIde?.let { sourcesForIde("com.jetbrains.intellij.idea:ideaIC:$it:sources@jar") }
jpsStandalone("com.jetbrains.intellij.idea:jps-standalone:$intellijVersion")
intellijVersionForIde?.let { jpsStandaloneForIde("com.jetbrains.intellij.idea:jps-standalone:$it") }
intellijCore("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
intellijVersionForIde?.let { intellijCoreForIde("com.jetbrains.intellij.idea:intellij-core:$it") }
if (intellijUltimateEnabled) {
nodeJSPlugin("com.jetbrains.plugins:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}@zip")
}
}
val makeIntellijCore = buildIvyRepositoryTask(intellijCore, customDepsOrg, customDepsRepoDir)
fun prepareDeps(intellij: Configuration, intellijCore: Configuration, sources: Configuration, intellijUltimate: Configuration, jpsStandalone: Configuration, intellijVersion: String) {
val makeIntellijCore = buildIvyRepositoryTask(intellijCore, customDepsOrg, customDepsRepoDir)
val makeIntellijAnnotations by tasks.registering(Copy::class) {
dependsOn(makeIntellijCore)
val makeIntellijAnnotations = tasks.register("makeIntellijAnnotations${intellij.name.capitalize()}", Copy::class) {
dependsOn(makeIntellijCore)
val intellijCoreRepo = CleanableStore[repoDir.resolve("intellij-core").absolutePath][intellijVersion].use()
from(intellijCoreRepo.resolve("artifacts/annotations.jar"))
val intellijCoreRepo = CleanableStore[repoDir.resolve("intellij-core").absolutePath][intellijVersion].use()
from(intellijCoreRepo.resolve("artifacts/annotations.jar"))
val annotationsStore = CleanableStore[repoDir.resolve(intellijRuntimeAnnotations).absolutePath]
val targetDir = annotationsStore[intellijVersion].use()
into(targetDir)
val annotationsStore = CleanableStore[repoDir.resolve(intellijRuntimeAnnotations).absolutePath]
val targetDir = annotationsStore[intellijVersion].use()
into(targetDir)
val ivyFile = File(targetDir, "$intellijRuntimeAnnotations.ivy.xml")
outputs.files(ivyFile)
val ivyFile = File(targetDir, "$intellijRuntimeAnnotations.ivy.xml")
outputs.files(ivyFile)
doFirst {
annotationsStore.cleanStore()
doFirst {
annotationsStore.cleanStore()
}
doLast {
writeIvyXml(
customDepsOrg,
intellijRuntimeAnnotations,
intellijVersion,
intellijRuntimeAnnotations,
targetDir,
targetDir,
targetDir,
allowAnnotations = true
)
}
}
doLast {
writeIvyXml(
val mergeSources = tasks.create("mergeSources${intellij.name.capitalize()}", Jar::class.java) {
dependsOn(sources)
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
isZip64 = true
if (!kotlinBuildProperties.isTeamcityBuild) {
from(provider { sources.map(::zipTree) })
}
destinationDirectory.set(File(repoDir, sources.name))
archiveBaseName.set("intellij")
archiveClassifier.set("sources")
archiveVersion.set(intellijVersion)
}
val sourcesFile = mergeSources.outputs.files.singleFile
val makeIde = if (androidStudioBuild != null) {
buildIvyRepositoryTask(
androidStudio,
customDepsOrg,
intellijRuntimeAnnotations,
intellijVersion,
intellijRuntimeAnnotations,
targetDir,
targetDir,
targetDir,
allowAnnotations = true
customDepsRepoDir,
if (androidStudioOs == "mac")
::skipContentsDirectory
else
::skipToplevelDirectory
)
} else {
val task = if (installIntellijUltimate) {
buildIvyRepositoryTask(intellijUltimate, customDepsOrg, customDepsRepoDir, null, sourcesFile)
} else {
buildIvyRepositoryTask(intellij, customDepsOrg, customDepsRepoDir, null, sourcesFile)
}
task.configure {
dependsOn(mergeSources)
}
task
}
val buildJpsStandalone = buildIvyRepositoryTask(jpsStandalone, customDepsOrg, customDepsRepoDir, null, sourcesFile)
tasks.named("build") {
dependsOn(
makeIntellijCore,
makeIde,
buildJpsStandalone,
makeIntellijAnnotations
)
}
}
val mergeSources by tasks.creating(Jar::class.java) {
dependsOn(sources)
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
isZip64 = true
if (!kotlinBuildProperties.isTeamcityBuild) {
from(provider { sources.map(::zipTree) })
if (installIntellijUltimate) {
val buildNodeJsPlugin =
buildIvyRepositoryTask(nodeJSPlugin, customDepsOrg, customDepsRepoDir, ::skipToplevelDirectory, sourcesFile)
tasks.named("build") { dependsOn(buildNodeJsPlugin) }
}
destinationDirectory.set(File(repoDir, sources.name))
archiveBaseName.set("intellij")
archiveClassifier.set("sources")
archiveVersion.set(intellijVersion)
}
val sourcesFile = mergeSources.outputs.files.singleFile
val makeIde = if (androidStudioBuild != null) {
buildIvyRepositoryTask(
androidStudio,
customDepsOrg,
customDepsRepoDir,
if (androidStudioOs == "mac")
::skipContentsDirectory
else
::skipToplevelDirectory
)
} else {
val task = if (installIntellijUltimate) {
buildIvyRepositoryTask(intellijUltimate, customDepsOrg, customDepsRepoDir, null, sourcesFile)
} else {
buildIvyRepositoryTask(intellij, customDepsOrg, customDepsRepoDir, null, sourcesFile)
}
task.configure {
dependsOn(mergeSources)
}
task
}
val buildJpsStandalone = buildIvyRepositoryTask(jpsStandalone, customDepsOrg, customDepsRepoDir, null, sourcesFile)
tasks.named("build") {
dependsOn(
makeIntellijCore,
makeIde,
buildJpsStandalone,
makeIntellijAnnotations
)
}
if (installIntellijUltimate) {
val buildNodeJsPlugin =
buildIvyRepositoryTask(nodeJSPlugin, customDepsOrg, customDepsRepoDir, ::skipToplevelDirectory, sourcesFile)
tasks.named("build") { dependsOn(buildNodeJsPlugin) }
prepareDeps(intellij, intellijCore, sources, intellijUltimate, jpsStandalone, intellijVersion)
if (intellijVersionForIde != null) {
prepareDeps(intellijForIde, intellijCoreForIde, sourcesForIde, intellijUltimateForIde, jpsStandaloneForIde, intellijVersionForIde)
}
tasks.named<Delete>("clean") {
@@ -400,6 +419,11 @@ fun skipToplevelDirectory(path: String) = path.substringAfter('/')
fun skipContentsDirectory(path: String) = path.substringAfter("Contents/")
fun Project.intellijSdkVersionForIde(): String? {
val majorVersion = kotlinBuildProperties.getOrNull("kotlin.build.dependencies.kotlinIde.combined") as? String ?: return null
return rootProject.findProperty("versions.intellijSdk.forIde.$majorVersion") as? String
}
class XMLWriter(private val outputStreamWriter: OutputStreamWriter) : Closeable {
private val xmlStreamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(outputStreamWriter)

View File

@@ -253,6 +253,29 @@ fun Project.idePluginDependency(block: () -> Unit) {
}
}
fun Project.publishJarsForIde(projects: List<String>, libraryDependencies: List<String> = emptyList()) {
idePluginDependency {
publishProjectJars(projects, libraryDependencies)
}
dependencies {
projects.forEach {
jpsLikeJarDependency(project(it), JpsDepScope.COMPILE, { isTransitive = false }, exported = true)
}
libraryDependencies.forEach {
jpsLikeJarDependency(it, JpsDepScope.COMPILE, exported = true)
}
}
}
fun Project.publishTestJarForIde(projectName: String) {
idePluginDependency {
publishTestJar(projectName)
}
dependencies {
jpsLikeJarDependency(projectTests(projectName), JpsDepScope.COMPILE, exported = true)
}
}
fun Project.publishProjectJars(projects: List<String>, libraryDependencies: List<String> = emptyList()) {
apply<JavaPlugin>()

View File

@@ -11,11 +11,13 @@ import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.ExternalModuleDependency
import org.gradle.api.artifacts.ModuleDependency
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.FileCollection
import org.gradle.kotlin.dsl.accessors.runtime.addDependencyTo
import org.gradle.kotlin.dsl.closureOf
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.project
import java.io.File
@@ -115,11 +117,91 @@ fun DependencyHandler.projectTests(name: String): ProjectDependency = project(na
fun DependencyHandler.projectRuntimeJar(name: String): ProjectDependency = project(name, configuration = "runtimeJar")
fun DependencyHandler.projectArchives(name: String): ProjectDependency = project(name, configuration = "archives")
enum class JpsDepScope {
COMPILE, TEST, RUNTIME, PROVIDED
}
fun DependencyHandler.add(configurationName: String, dependencyNotation: Any, configure: (ModuleDependency.() -> Unit)?) {
// Avoid `dependencyNotation` to `ModuleDependency` class cast exception if possible
if (configure != null) {
add(configurationName, dependencyNotation, closureOf(configure))
} else {
add(configurationName, dependencyNotation)
}
}
fun DependencyHandler.jpsLikeJarDependency(
dependencyNotation: Any,
scope: JpsDepScope,
dependencyConfiguration: (ModuleDependency.() -> Unit)? = null,
exported: Boolean = false
) {
when (scope) {
JpsDepScope.COMPILE -> {
if (exported) {
add("api", dependencyNotation, dependencyConfiguration)
add("testCompile", dependencyNotation, dependencyConfiguration)
} else {
add("implementation", dependencyNotation, dependencyConfiguration)
}
}
JpsDepScope.TEST -> {
if (exported) {
add("testCompile", dependencyNotation, dependencyConfiguration)
} else {
add("testImplementation", dependencyNotation, dependencyConfiguration)
}
}
JpsDepScope.RUNTIME -> {
add("testRuntimeOnly", dependencyNotation, dependencyConfiguration)
}
JpsDepScope.PROVIDED -> {
if (exported) {
add("compileOnlyApi", dependencyNotation, dependencyConfiguration)
add("testCompile", dependencyNotation, dependencyConfiguration)
} else {
add("compileOnly", dependencyNotation, dependencyConfiguration)
add("testImplementation", dependencyNotation, dependencyConfiguration)
}
}
}
}
fun DependencyHandler.jpsLikeModuleDependency(moduleName: String, scope: JpsDepScope, exported: Boolean = false) {
jpsLikeJarDependency(project(moduleName), scope, exported = exported)
when (scope) {
JpsDepScope.COMPILE -> {
if (exported) {
add("testCompile", projectTests(moduleName))
} else {
add("testImplementation", projectTests(moduleName))
}
}
JpsDepScope.TEST -> {
if (exported) {
add("testCompile", projectTests(moduleName))
} else {
add("testImplementation", projectTests(moduleName))
}
}
JpsDepScope.RUNTIME -> {
add("runtimeOnly", projectTests(moduleName))
}
JpsDepScope.PROVIDED -> {
if (exported) {
add("testCompile", projectTests(moduleName))
} else {
add("testImplementation", projectTests(moduleName))
}
}
}
}
fun Project.testApiJUnit5(
vintageEngine: Boolean = false,
runner: Boolean = false,
suiteApi: Boolean = false,
jupiterParams: Boolean = false
suiteApi: Boolean = false
) {
with(dependencies) {
val platformVersion = commonVer("org.junit", "junit-bom")
@@ -128,11 +210,6 @@ fun Project.testApiJUnit5(
if (vintageEngine) {
testApi("org.junit.vintage:junit-vintage-engine:$platformVersion")
}
if (jupiterParams) {
testApi("org.junit.jupiter:junit-jupiter-params:$platformVersion")
}
val componentsVersion = commonVer("org.junit.platform", "")
val components = mutableListOf(

View File

@@ -42,9 +42,21 @@ private fun Project.ideModuleName() = when (IdeVersionConfigurator.currentIde.ki
}
}
private fun Project.ideModuleVersion() = when (IdeVersionConfigurator.currentIde.kind) {
private fun Project.ideModuleVersion(forIde: Boolean) = when (IdeVersionConfigurator.currentIde.kind) {
Ide.Kind.AndroidStudio -> rootProject.findProperty("versions.androidStudioBuild")
Ide.Kind.IntelliJ -> rootProject.findProperty("versions.intellijSdk")
Ide.Kind.IntelliJ -> {
if (forIde) {
intellijSdkVersionForIde()
?: error("Please specify 'kotlin.build.dependencies.kotlinIde.combined' in your local.properties")
} else {
rootProject.findProperty("versions.intellijSdk")
}
}
}
fun Project.intellijSdkVersionForIde(): String? {
val majorVersion = kotlinBuildProperties.getOrNull("kotlin.build.dependencies.kotlinIde.combined") as? String ?: return null
return rootProject.findProperty("versions.intellijSdk.forIde.$majorVersion") as? String
}
fun RepositoryHandler.kotlinBuildLocalRepo(project: Project): IvyArtifactRepository = ivy {
@@ -58,6 +70,7 @@ fun RepositoryHandler.kotlinBuildLocalRepo(project: Project): IvyArtifactReposit
artifact("[organisation]/[module]/[revision]/artifacts/lib/[artifact](-[classifier]).[ext]")
artifact("[organisation]/[module]/[revision]/artifacts/[artifact](-[classifier]).[ext]")
artifact("[organisation]/intellij-core/[revision]/artifacts/[artifact](-[classifier]).[ext]")
artifact("[organisation]/${project.ideModuleName()}/[revision]/artifacts/plugins/[module]/lib/[artifact](-[classifier]).[ext]") // bundled plugins
artifact("[organisation]/sources/[artifact]-[revision](-[classifier]).[ext]")
artifact("[organisation]/[module]/[revision]/[artifact](-[classifier]).[ext]")
@@ -68,7 +81,9 @@ fun RepositoryHandler.kotlinBuildLocalRepo(project: Project): IvyArtifactReposit
}
}
fun Project.intellijDep(module: String? = null) = "kotlin.build:${module ?: ideModuleName()}:${ideModuleVersion()}"
@Suppress("UNUSED_PARAMETER")
fun Project.intellijDep(module: String? = null, forIde: Boolean = false) =
"kotlin.build:${module ?: ideModuleName()}:${ideModuleVersion(forIde)}"
fun Project.intellijCoreDep() = "kotlin.build:intellij-core:${rootProject.extra["versions.intellijSdk"]}"
@@ -93,7 +108,7 @@ fun Project.kotlinxCollectionsImmutable() = "org.jetbrains.kotlinx:kotlinx-colle
*/
fun Project.intellijRuntimeAnnotations() = "kotlin.build:intellij-runtime-annotations:${rootProject.extra["versions.intellijSdk"]}"
fun Project.intellijPluginDep(plugin: String) = intellijDep(plugin)
fun Project.intellijPluginDep(plugin: String, forIde: Boolean = false) = intellijDep(plugin, forIde)
fun Project.intellijUltimateDep() = intellijDep("ideaIU")
@@ -125,7 +140,7 @@ object IntellijRootUtils {
fun getIntellijRootDir(project: Project): File = with(project.rootProject) {
return File(
getRepositoryRootDir(this),
"${ideModuleName()}/${ideModuleVersion()}/artifacts"
"${ideModuleName()}/${ideModuleVersion(forIde = false)}/artifacts"
)
}
}

View File

@@ -5,7 +5,6 @@
package plugins
import PublishToMavenLocalSerializable
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.attributes.Usage
@@ -14,10 +13,10 @@ import org.gradle.api.plugins.JavaBasePlugin
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin
import org.gradle.api.publish.maven.tasks.PublishToMavenLocal
import org.gradle.api.publish.maven.tasks.PublishToMavenRepository
import org.gradle.api.tasks.TaskProvider
import org.gradle.kotlin.dsl.*
import org.gradle.plugins.signing.Sign
import org.gradle.plugins.signing.SigningExtension
import org.gradle.plugins.signing.SigningPlugin
import java.util.*
@@ -28,6 +27,7 @@ class KotlinBuildPublishingPlugin @Inject constructor(
) : Plugin<Project> {
override fun apply(target: Project): Unit = with(target) {
apply<MavenPublishPlugin>()
apply<SigningPlugin>()
val publishedRuntime = configurations.maybeCreate(RUNTIME_CONFIGURATION).apply {
isCanBeConsumed = false
@@ -132,40 +132,32 @@ fun Project.configureDefaultPublishing() {
}
}
val signingRequired = project.providers.gradleProperty("signingRequired").forUseAtConfigurationTime().orNull?.toBoolean()
?: project.providers.gradleProperty("isSonatypeRelease").forUseAtConfigurationTime().orNull?.toBoolean() ?: false
if (signingRequired) {
apply<SigningPlugin>()
configureSigning()
}
configureSigning()
tasks.register("install") {
dependsOn(tasks.named("publishToMavenLocal"))
}
// workaround for Gradle configuration cache
// TODO: remove it when https://github.com/gradle/gradle/pull/16945 merged into used in build Gradle version
tasks.withType(PublishToMavenLocal::class.java) {
val originalTask = this
val serializablePublishTask =
tasks.register(originalTask.name + "Serializable", PublishToMavenLocalSerializable::class.java) {
publication = originalTask.publication
}
originalTask.onlyIf { false }
originalTask.dependsOn(serializablePublishTask)
}
tasks.withType<PublishToMavenRepository>()
.matching { it.name.endsWith("PublicationTo${KotlinBuildPublishingPlugin.REPOSITORY_NAME}Repository") }
.all { configureRepository() }
}
private fun Project.configureSigning() {
val signingRequired = provider {
project.findProperty("signingRequired")?.toString()?.toBoolean()
?: project.property("isSonatypeRelease") as Boolean
}
configure<SigningExtension> {
setRequired(signingRequired)
sign(extensions.getByType<PublishingExtension>().publications) // all publications
useGpgCmd()
}
tasks.withType<Sign>().configureEach {
setOnlyIf { signingRequired.get() }
}
}
fun TaskProvider<PublishToMavenRepository>.configureRepository() =
@@ -189,4 +181,4 @@ private fun PublishToMavenRepository.configureRepository() {
}
}
}
}
}

View File

@@ -7,22 +7,13 @@
// usages in build scripts are not tracked properly
@file:Suppress("unused")
import org.gradle.api.InvalidUserDataException
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.file.FileSystemOperations
import org.gradle.api.internal.tasks.testing.filter.DefaultTestFilter
import org.gradle.api.publish.internal.PublishOperation
import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal
import org.gradle.api.publish.maven.internal.publisher.MavenNormalizedPublication
import org.gradle.api.publish.maven.internal.publisher.MavenPublisher
import org.gradle.api.publish.maven.internal.publisher.ValidatingMavenPublisher
import org.gradle.api.publish.maven.tasks.AbstractPublishToMaven
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.testing.Test
import org.gradle.internal.serialization.Cached
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.project
import org.gradle.kotlin.dsl.support.serviceOf
@@ -47,7 +38,6 @@ val kotlinGradlePluginAndItsRequired = arrayOf(
":kotlin-compiler-runner",
":kotlin-daemon-embeddable",
":kotlin-daemon-client",
":kotlin-project-model",
":kotlin-gradle-plugin-api",
":kotlin-gradle-plugin",
":kotlin-gradle-plugin-model",
@@ -289,30 +279,3 @@ fun Task.useAndroidSdk() {
fun Task.useAndroidJar() {
TaskUtils.useAndroidJar(this)
}
// Workaround to make PublishToMavenLocal compatible with Gradle configuration cache
// TODO: remove it when https://github.com/gradle/gradle/pull/16945 merged into used in build Gradle version
abstract class PublishToMavenLocalSerializable : AbstractPublishToMaven() {
private val normalizedPublication = Cached.of { this.computeNormalizedPublication() }
private fun computeNormalizedPublication(): MavenNormalizedPublication {
val publicationInternal: MavenPublicationInternal = publicationInternal
?: throw InvalidUserDataException("The 'publication' property is required")
duplicatePublicationTracker.checkCanPublishToMavenLocal(publicationInternal)
return publicationInternal.asNormalisedPublication()
}
@TaskAction
open fun publish() {
val normalizedPublication = normalizedPublication.get()
object : PublishOperation(normalizedPublication.name, "mavenLocal") {
override fun publish() {
val localPublisher = mavenPublishers.getLocalPublisher(
temporaryDirFactory
)
val validatingPublisher: MavenPublisher = ValidatingMavenPublisher(localPublisher)
validatingPublisher.publish(normalizedPublication, null)
}
}.run()
}
}

View File

@@ -24,7 +24,6 @@ dependencies {
testApi(projectTests(":compiler:tests-compiler-utils"))
testApi(projectTests(":compiler:tests-common-new"))
testCompile(projectTests(":jps-plugin"))
testCompile(commonDep("junit:junit"))
Platform[193].orLower {

View File

@@ -262,7 +262,7 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
private fun getFlavorUnitTestFolder(flavourName: String): String {
return pathManager.srcFolderInAndroidTmpFolder +
"/androidTest${flavourName.replaceFirstChar(Char::uppercaseChar)}/java/" +
"/androidTest${flavourName.capitalize()}/java/" +
testClassPackage.replace(".", "/") + "/"
}
@@ -379,7 +379,7 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
configure(backend)
testInfo = KotlinTestInfo(
"org.jetbrains.kotlin.android.tests.AndroidRunner",
"test${testDataFile.nameWithoutExtension.replaceFirstChar(Char::uppercaseChar)}",
"test${testDataFile.nameWithoutExtension.capitalize()}",
emptySet()
)
}.build(testDataFile.path)

View File

@@ -27,7 +27,7 @@ class UnitTestFileWriter(
}
fun generate() {
FileWriter(File(flavourFolder, flavourName.replaceFirstChar(Char::uppercaseChar) + ".java").also { it.parentFile.mkdirs() }).use { suite ->
FileWriter(File(flavourFolder, flavourName.capitalize() + ".java").also { it.parentFile.mkdirs() }).use { suite ->
val p = Printer(suite)
p.println(
"""package ${CodegenTestsOnAndroidGenerator.testClassPackage};
@@ -35,7 +35,7 @@ class UnitTestFileWriter(
|import ${CodegenTestsOnAndroidGenerator.baseTestClassPackage}.${CodegenTestsOnAndroidGenerator.baseTestClassName};
|
|/* This class is generated by ${CodegenTestsOnAndroidGenerator.generatorName}. DO NOT MODIFY MANUALLY */
|public class ${flavourName.replaceFirstChar(Char::uppercaseChar)} extends ${CodegenTestsOnAndroidGenerator.baseTestClassName} {
|public class ${flavourName.capitalize()} extends ${CodegenTestsOnAndroidGenerator.baseTestClassName} {
|
""".trimMargin()
)

View File

@@ -87,4 +87,4 @@ open class SamTypeFactory {
companion object {
val INSTANCE = SamTypeFactory()
}
}
}

View File

@@ -18,7 +18,7 @@ fun mangleNameIfNeeded(name: String): String {
if (c.isValidCharacter()) {
append(c)
} else {
val hexString = Integer.toHexString(c.code)
val hexString = Integer.toHexString(c.toInt())
assert(hexString.length <= 4)
append("_u").append(hexString)
}

View File

@@ -158,14 +158,7 @@ public class ClosureCodegen extends MemberCodegen<KtElement> {
for (int i = 0; i < superInterfaceTypes.size(); i++) {
KotlinType superInterfaceType = superInterfaceTypes.get(i);
sw.writeInterface();
Type superInterfaceAsmType;
if (samType != null && superInterfaceType.getConstructor() == samType.getType().getConstructor()) {
superInterfaceAsmType = typeMapper.mapSupertype(superInterfaceType, null);
sw.writeAsmType(superInterfaceAsmType);
} else {
superInterfaceAsmType = typeMapper.mapSupertype(superInterfaceType, sw);
}
superInterfaceAsmTypes[i] = superInterfaceAsmType.getInternalName();
superInterfaceAsmTypes[i] = typeMapper.mapSupertype(superInterfaceType, sw).getInternalName();
sw.writeInterfaceEnd();
}

View File

@@ -3009,7 +3009,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
@NotNull
private KotlinType approximateCapturedType(@NotNull KotlinType type) {
if (state.getLanguageVersionSettings().supportsFeature(LanguageFeature.NewInference)) {
TypeApproximator approximator = new TypeApproximator(state.getModule().getBuiltIns(), state.getLanguageVersionSettings());
TypeApproximator approximator = new TypeApproximator(state.getModule().getBuiltIns());
KotlinType approximatedType =
TypeUtils.contains(type, (containedType) -> CapturedTypeConstructorKt.isCaptured(containedType)) ?

View File

@@ -188,12 +188,6 @@ class JvmRuntimeTypes(
else -> if (isMutable) mutablePropertyReferences else propertyReferences
}
return if (arity >= 0) {
classes[arity].defaultType
} else {
//in case of ErrorUtils.ERROR_PROPERTY there would be no dispatchReceiverParameter and arity becomes negative
//so we just take zero argument reference class (because it is incorrect anyway)
classes[0].defaultType
}
return classes[arity].defaultType
}
}

View File

@@ -28,7 +28,7 @@ object ChangeBoxingMethodTransformer : MethodTransformer() {
val map = hashMapOf<String, String>()
for (primitiveType in JvmPrimitiveType.values()) {
val name = primitiveType.wrapperFqName.topLevelClassInternalName()
map[name] = "box${primitiveType.javaKeywordName.replaceFirstChar(Char::uppercaseChar)}"
map[name] = "box${primitiveType.javaKeywordName.capitalize(Locale.US)}"
}
wrapperToInternalBoxing = map
}

View File

@@ -999,7 +999,7 @@ class CoroutineTransformerMethodVisitor(
else -> next = next.next
}
}
return null
return next
}
// It's necessary to preserve some sensible invariants like there should be no jump in the middle of try-catch-block
@@ -1329,7 +1329,7 @@ private fun updateLvtAccordingToLiveness(method: MethodNode, isForNamedFunction:
variable.desc,
variable.signature,
variable.start,
min(variable.end, nextSuspensionPointStartLabel(variable.start)),
nextSuspensionPointStartLabel(variable.start),
variable.index
)
)

View File

@@ -480,7 +480,7 @@ abstract class InlineCodegen<out T : BaseExpressionCodegen>(
assert(constantValue is Int) { "Mask should be of Integer type, but " + constantValue }
maskValues.add(constantValue as Int)
if (maskStartIndex == -1) {
maskStartIndex = invocationParamBuilder.listAllParams().sumOf {
maskStartIndex = invocationParamBuilder.listAllParams().sumBy {
if (it is CapturedParamInfo) 0 else it.type.size
}
}

View File

@@ -1086,7 +1086,7 @@ class MethodInliner(
"Number of expected and actual parameters should be equal, but ${actualParams.size} != ${directOrder.size}!"
}
var currentShift = shift + directOrder.sumOf { it.size }
var currentShift = shift + directOrder.sumBy { it.size }
val safeToUseArgumentKotlinType =
directOrder.size == directOrderOfArguments.size && directOrderOfArguments.size == directOrderOfInvokeParameters.size

View File

@@ -24,13 +24,13 @@ class Parameters(val parameters: List<ParameterInfo>) : Iterable<ParameterInfo>
private val actualDeclShifts: Array<ParameterInfo?>
private val paramToDeclByteCodeIndex: HashMap<ParameterInfo, Int> = hashMapOf()
val argsSizeOnStack = parameters.sumOf { it.type.size }
val argsSizeOnStack = parameters.sumBy { it.type.size }
val realParametersSizeOnStack: Int
get() = argsSizeOnStack - capturedParametersSizeOnStack
val capturedParametersSizeOnStack by lazy {
captured.sumOf { it.type.size }
captured.sumBy { it.type.size }
}
val captured by lazy {

View File

@@ -39,7 +39,7 @@ class RedundantBoxingMethodTransformer(private val generationState: GenerationSt
override fun transform(internalClassName: String, node: MethodNode) {
val interpreter = RedundantBoxingInterpreter(node.instructions, generationState)
val frames = analyze(internalClassName, node, interpreter)
val frames = MethodTransformer.analyze(internalClassName, node, interpreter)
interpretPopInstructionsForBoxedValues(interpreter, node, frames)
@@ -168,8 +168,7 @@ class RedundantBoxingMethodTransformer(private val generationState: GenerationSt
val frame = frames[i] ?: continue
val insn = insnList[i]
if ((insn.opcode == Opcodes.ASTORE || insn.opcode == Opcodes.ALOAD) &&
(insn as VarInsnNode).`var` == localVariableNode.index
) {
(insn as VarInsnNode).`var` == localVariableNode.index) {
if (insn.getOpcode() == Opcodes.ASTORE) {
values.add(frame.top()!!)
} else {

View File

@@ -131,7 +131,7 @@ abstract class PrimitiveNumberRangeIntrinsicRangeValue(
if (isProhibitedCharConstEndValue(step, endCharValue))
null
else
createConstBoundedIntForLoopGenerator(codegen, forExpression, startValue, endCharValue.code, step, isStartInclusive)
createConstBoundedIntForLoopGenerator(codegen, forExpression, startValue, endCharValue.toInt(), step, isStartInclusive)
}
is LongValue -> {

View File

@@ -27,19 +27,19 @@ import org.jetbrains.org.objectweb.asm.commons.Method
import java.util.*
private val EXTERNAL_SOURCES_KINDS = arrayOf(
JvmDeclarationOriginKind.CLASS_MEMBER_DELEGATION_TO_DEFAULT_IMPL,
JvmDeclarationOriginKind.DEFAULT_IMPL_DELEGATION_TO_SUPERINTERFACE_DEFAULT_IMPL,
JvmDeclarationOriginKind.DELEGATION,
JvmDeclarationOriginKind.BRIDGE
JvmDeclarationOriginKind.CLASS_MEMBER_DELEGATION_TO_DEFAULT_IMPL,
JvmDeclarationOriginKind.DEFAULT_IMPL_DELEGATION_TO_SUPERINTERFACE_DEFAULT_IMPL,
JvmDeclarationOriginKind.DELEGATION,
JvmDeclarationOriginKind.BRIDGE
)
private val PREDEFINED_SIGNATURES = listOf(
"getClass()Ljava/lang/Class;",
"notify()V",
"notifyAll()V",
"wait()V",
"wait(J)V",
"wait(JI)V"
"getClass()Ljava/lang/Class;",
"notify()V",
"notifyAll()V",
"wait()V",
"wait(J)V",
"wait(JI)V"
).map { signature ->
RawSignature(signature.substringBefore('('), signature.substring(signature.indexOf('(')), MemberKind.METHOD)
}
@@ -77,7 +77,8 @@ class BuilderFactoryForDuplicateSignatureDiagnostics(
val elements = LinkedHashSet<PsiElement>()
if (noOwnImplementations) {
elements.addIfNotNull(data.classOrigin.element)
} else {
}
else {
for (origin in data.signatureOrigins) {
var element = origin.element
@@ -95,9 +96,9 @@ class BuilderFactoryForDuplicateSignatureDiagnostics(
}
override fun onClassDone(
classOrigin: JvmDeclarationOrigin,
classInternalName: String,
signatures: MultiMap<RawSignature, JvmDeclarationOrigin>
classOrigin: JvmDeclarationOrigin,
classInternalName: String,
signatures: MultiMap<RawSignature, JvmDeclarationOrigin>
) {
reportDiagnosticsTasks.add {
reportClashingWithPredefinedSignatures(classOrigin, classInternalName, signatures)
@@ -106,9 +107,9 @@ class BuilderFactoryForDuplicateSignatureDiagnostics(
}
private fun reportClashingWithPredefinedSignatures(
classOrigin: JvmDeclarationOrigin,
classInternalName: String,
signatures: MultiMap<RawSignature, JvmDeclarationOrigin>
classOrigin: JvmDeclarationOrigin,
classInternalName: String,
signatures: MultiMap<RawSignature, JvmDeclarationOrigin>
) {
for (predefinedSignature in PREDEFINED_SIGNATURES) {
if (!signatures.containsKey(predefinedSignature)) continue
@@ -121,9 +122,9 @@ class BuilderFactoryForDuplicateSignatureDiagnostics(
}
private fun reportClashingSignaturesInHierarchy(
classOrigin: JvmDeclarationOrigin,
classInternalName: String,
signatures: MultiMap<RawSignature, JvmDeclarationOrigin>
classOrigin: JvmDeclarationOrigin,
classInternalName: String,
signatures: MultiMap<RawSignature, JvmDeclarationOrigin>
) {
val descriptor = classOrigin.descriptor
if (descriptor !is ClassDescriptor) return
@@ -140,7 +141,9 @@ class BuilderFactoryForDuplicateSignatureDiagnostics(
for ((rawSignature, origins) in groupedBySignature.entrySet()) {
if (origins.size <= 1) continue
when (val diagnostic = computeDiagnosticToReport(classOrigin, classInternalName, rawSignature, origins)) {
val diagnostic = computeDiagnosticToReport(classOrigin, classInternalName, rawSignature, origins)
when (diagnostic) {
is ConflictingDeclarationError.AccidentalOverride -> {
diagnostics.report(ErrorsJvm.ACCIDENTAL_OVERRIDE.on(diagnostic.element, diagnostic.data))
}
@@ -153,17 +156,16 @@ class BuilderFactoryForDuplicateSignatureDiagnostics(
private sealed class ConflictingDeclarationError(val element: PsiElement, val data: ConflictingJvmDeclarationsData) {
class AccidentalOverride(element: PsiElement, data: ConflictingJvmDeclarationsData) :
ConflictingDeclarationError(element, data)
ConflictingDeclarationError(element, data)
class ConflictingInheritedJvmDeclarations(element: PsiElement, data: ConflictingJvmDeclarationsData) :
ConflictingDeclarationError(element, data)
ConflictingDeclarationError(element, data)
}
private fun computeDiagnosticToReport(
classOrigin: JvmDeclarationOrigin,
classInternalName: String,
rawSignature: RawSignature,
origins: Collection<JvmDeclarationOrigin>
classOrigin: JvmDeclarationOrigin,
classInternalName: String,
rawSignature: RawSignature,
origins: Collection<JvmDeclarationOrigin>
): ConflictingDeclarationError? {
var memberElement: PsiElement? = null
var ownNonFakeCount = 0
@@ -209,17 +211,19 @@ class BuilderFactoryForDuplicateSignatureDiagnostics(
if (member is PropertyDescriptor) {
processMember(member.getter)
processMember(member.setter)
} else if (member is FunctionDescriptor) {
}
else if (member is FunctionDescriptor) {
val signatures =
if (member.kind == FAKE_OVERRIDE)
member.overriddenTreeUniqueAsSequence(useOriginal = true)
// drop the root (itself)
.drop(1)
.mapTo(HashSet()) { it.asRawSignature() }
else
setOf(member.asRawSignature())
if (member.kind == FAKE_OVERRIDE)
member.overriddenTreeUniqueAsSequence(useOriginal = true)
// drop the root (itself)
.drop(1)
.mapTo(HashSet()) { it.asRawSignature() }
else
setOf(member.asRawSignature())
signatures.forEach { rawSignature ->
signatures.forEach {
rawSignature ->
groupedBySignature.putValue(rawSignature, OtherOrigin(member))
}
}
@@ -228,10 +232,10 @@ class BuilderFactoryForDuplicateSignatureDiagnostics(
descriptor.defaultType.memberScope.getContributedDescriptors().forEach(::processMember)
descriptor.getParentJavaStaticClassScope()?.run {
getContributedDescriptors(DescriptorKindFilter.FUNCTIONS)
.filter {
it is FunctionDescriptor && DescriptorVisibilities.isVisibleIgnoringReceiver(it, descriptor)
}
.forEach(::processMember)
.filter {
it is FunctionDescriptor && DescriptorVisibilities.isVisibleIgnoringReceiver(it, descriptor)
}
.forEach(::processMember)
}
return groupedBySignature

View File

@@ -330,7 +330,7 @@ class GenerationState private constructor(
val typeApproximator: TypeApproximator? =
if (languageVersionSettings.supportsFeature(LanguageFeature.NewInference))
TypeApproximator(module.builtIns, languageVersionSettings)
TypeApproximator(module.builtIns)
else
null

View File

@@ -140,8 +140,8 @@ private fun jsonEscape(value: String): String = buildString {
'\r' -> append("\\r")
'\"' -> append("\\\"")
'\\' -> append("\\\\")
else -> if (ch.code < 32) {
append("\\u" + Integer.toHexString(ch.code).padStart(4, '0'))
else -> if (ch.toInt() < 32) {
append("\\u" + Integer.toHexString(ch.toInt()).padStart(4, '0'))
}
else {
append(ch)

View File

@@ -87,6 +87,11 @@ fun CallableMemberDescriptor.createTypeParameterWithNewName(
return newDescriptor
}
fun KotlinType.removeExternalProjections(): KotlinType {
val newArguments = arguments.map { TypeProjectionImpl(Variance.INVARIANT, it.type) }
return replace(newArguments)
}
fun isInlineClassConstructorAccessor(descriptor: FunctionDescriptor): Boolean =
descriptor is AccessorForConstructorDescriptor &&
descriptor.calleeDescriptor.constructedClass.isInlineClass()

View File

@@ -16,10 +16,10 @@
package org.jetbrains.kotlin.cli.common
/**
* @param alwaysDirectAccess Gradle has a list of properties that can be read without declaring, see https://github.com/gradle/gradle/blob/f191a61cec61afe308f2b45184cb303d32706a6f/subprojects/configuration-cache/src/main/kotlin/org/gradle/configurationcache/SystemPropertyAccessListener.kt#L32
*/
enum class CompilerSystemProperties(val property: String, val alwaysDirectAccess: Boolean = false) {
import com.intellij.util.LineSeparator
import java.util.*
enum class CompilerSystemProperties(val property: String) {
COMPILE_DAEMON_ENABLED_PROPERTY("kotlin.daemon.enabled"),
COMPILE_DAEMON_JVM_OPTIONS_PROPERTY("kotlin.daemon.jvm.options"),
COMPILE_DAEMON_OPTIONS_PROPERTY("kotlin.daemon.options"),
@@ -36,45 +36,36 @@ enum class CompilerSystemProperties(val property: String, val alwaysDirectAccess
KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY("kotlin.environment.keepalive"),
COMPILE_DAEMON_CUSTOM_RUN_FILES_PATH_FOR_TESTS("kotlin.daemon.custom.run.files.path.for.tests"),
KOTLIN_COLORS_ENABLED_PROPERTY("kotlin.colors.enabled"),
OS_NAME("os.name", alwaysDirectAccess = true),
TMP_DIR("java.io.tmpdir"),
USER_HOME("user.home", alwaysDirectAccess = true),
JAVA_VERSION("java.specification.version", alwaysDirectAccess = true),
JAVA_HOME("java.home", alwaysDirectAccess = true),
JAVA_CLASS_PATH("java.class.path", alwaysDirectAccess = true),
OS_NAME("os.name")
;
private fun <T> getProperFunction(custom: T?, default: T): T {
if (alwaysDirectAccess) return default
return custom ?: default
}
var value: String?
get() {
return getProperFunction(systemPropertyGetter, System::getProperty)(property)
}
var value
get() = systemPropertyGetter(property)
set(value) {
getProperFunction(systemPropertySetter, System::setProperty)(property, value!!)
systemPropertySetter(property, value!!)
}
val safeValue
get() = value ?: error("No value for $property system property")
fun clear(): String? = getProperFunction(systemPropertyCleaner, System::clearProperty)(property)
fun clear(): String? = systemPropertyCleaner(property)
companion object {
var systemPropertyGetter: ((String) -> String?)? = null
var systemPropertyGetter: (String) -> String? = {
System.getProperty(it)
}
var systemPropertySetter: ((String, String) -> String?)? = null
var systemPropertySetter: (String, String) -> String? = { key, value ->
System.setProperty(key, value)
}
var systemPropertyCleaner: ((String) -> String?)? = null
var systemPropertyCleaner: (String) -> String? = { key ->
System.clearProperty(key)
}
}
}
val isWindows: Boolean
get() = CompilerSystemProperties.OS_NAME.value!!.lowercase().startsWith("windows")
get() = CompilerSystemProperties.OS_NAME.value!!.toLowerCase(Locale.ENGLISH).startsWith("windows")
fun String?.toBooleanLenient(): Boolean? = when (this?.lowercase()) {
fun String?.toBooleanLenient(): Boolean? = when (this?.toLowerCase()) {
null -> false
in listOf("", "yes", "true", "on", "y") -> true
in listOf("no", "false", "off", "n") -> false

View File

@@ -377,7 +377,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
default: `indy-with-constants` for JVM target 9 or greater, `inline` otherwise"""
)
var stringConcat: String? by NullableStringFreezableVar(null)
var stringConcat: String? by NullableStringFreezableVar(JvmStringConcat.INLINE.description)
@Argument(
value = "-Xsam-conversions",

View File

@@ -0,0 +1,20 @@
plugins {
kotlin("jvm")
id("jps-compatible")
}
dependencies {
compile(project(":compiler:cli"))
compile(project(":compiler:ir.serialization.js"))
compileOnly(project(":compiler:ir.tree.persistent"))
runtimeOnly(project(":kotlin-reflect"))
if (Platform[193].orLower()) {
compile(intellijDep()) { includeJars("picocontainer", rootProject = rootProject) }
}
compile(intellijDep()) { includeJars("trove4j", "guava", "jdom", rootProject = rootProject) }
compile(intellijCoreDep()) { includeJars("intellij-core") }
}
sourceSets {
"main" { projectDefault() }
}

View File

@@ -0,0 +1,153 @@
/*
* Copyright 2010-2019 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.
*/
// Internal CLI for building JS IR libraries
package org.jetbrains.kotlin.ir.backend.js
import com.intellij.openapi.Disposable
import com.intellij.openapi.vfs.StandardFileSystems
import com.intellij.openapi.vfs.VirtualFileManager
import com.intellij.psi.PsiManager
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
import org.jetbrains.kotlin.cli.common.messages.*
import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.config.*
import org.jetbrains.kotlin.ir.declarations.persistent.PersistentIrFactory
import org.jetbrains.kotlin.js.config.JSConfigurationKeys
import org.jetbrains.kotlin.library.resolver.KotlinLibraryResolveResult
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.resolve.multiplatform.isCommonSource
import org.jetbrains.kotlin.serialization.js.ModuleKind
import org.jetbrains.kotlin.util.Logger
import java.io.File
fun buildConfiguration(environment: KotlinCoreEnvironment, moduleName: String): CompilerConfiguration {
val runtimeConfiguration = environment.configuration.copy()
runtimeConfiguration.put(CommonConfigurationKeys.MODULE_NAME, moduleName)
runtimeConfiguration.put(JSConfigurationKeys.MODULE_KIND, ModuleKind.PLAIN)
runtimeConfiguration.put(
CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY,
PrintingMessageCollector(System.err, MessageRenderer.PLAIN_RELATIVE_PATHS, false)
)
runtimeConfiguration.languageVersionSettings = LanguageVersionSettingsImpl(
LanguageVersion.LATEST_STABLE, ApiVersion.LATEST_STABLE,
specificFeatures = mapOf(
LanguageFeature.AllowContractsForCustomFunctions to LanguageFeature.State.ENABLED,
LanguageFeature.MultiPlatformProjects to LanguageFeature.State.ENABLED
),
analysisFlags = mapOf(
AnalysisFlags.useExperimental to listOf(
"kotlin.RequiresOptIn",
"kotlin.contracts.ExperimentalContracts",
"kotlin.ExperimentalMultiplatform",
),
AnalysisFlags.allowResultReturnType to true
)
)
return runtimeConfiguration
}
@Suppress("RedundantSamConstructor")
private val environment =
KotlinCoreEnvironment.createForProduction(Disposable { }, CompilerConfiguration(), EnvironmentConfigFiles.JS_CONFIG_FILES)
fun createPsiFile(fileName: String): KtFile {
val psiManager = PsiManager.getInstance(environment.project)
val fileSystem = VirtualFileManager.getInstance().getFileSystem(StandardFileSystems.FILE_PROTOCOL)
val file = fileSystem.findFileByPath(fileName) ?: error("File not found: $fileName")
return psiManager.findFile(file) as KtFile
}
fun buildKLib(
moduleName: String,
sources: List<String>,
outputPath: String,
allDependencies: KotlinLibraryResolveResult,
commonSources: List<String>
) {
val configuration = buildConfiguration(environment, moduleName)
generateKLib(
project = environment.project,
files = sources.map { source ->
val file = createPsiFile(source)
if (source in commonSources) {
file.isCommonSource = true
}
file
},
analyzer = AnalyzerWithCompilerReport(configuration),
configuration = configuration,
allDependencies = allDependencies,
friendDependencies = emptyList(),
irFactory = PersistentIrFactory(), // TODO: IrFactoryImpl?
outputKlibPath = outputPath,
nopack = true
)
}
private fun listOfKtFilesFrom(paths: List<String>): List<String> {
val currentDir = File("")
return paths.flatMap { path ->
File(path)
.walkTopDown()
.filter { it.extension == "kt" }
.map { it.relativeToOrSelf(currentDir).path }
.asIterable()
}.distinct()
}
fun main(args: Array<String>) {
val inputFiles = mutableListOf<String>()
var outputPath: String? = null
val dependencies = mutableListOf<String>()
val commonSources = mutableListOf<String>()
var moduleName: String? = null
var index = 0
while (index < args.size) {
val arg = args[index++]
when (arg) {
"-n" -> moduleName = args[index++]
"-o" -> outputPath = args[index++]
"-d" -> dependencies += args[index++]
"-c" -> commonSources += args[index++]
else -> inputFiles += arg
}
}
if (outputPath == null) {
error("Please set path to .klm file: `-o some/dir/module-name.klm`")
}
if (moduleName == null) {
error("Please set module name: `-n module-name`")
}
val resolvedLibraries = jsResolveLibraries(
dependencies, emptyList(), messageCollectorLogger(MessageCollector.NONE)
)
buildKLib(moduleName, listOfKtFilesFrom(inputFiles), outputPath, resolvedLibraries, listOfKtFilesFrom(commonSources))
}
// Copied here from `K2JsIrCompiler` instead of reusing in order to avoid circular dependencies between Gradle tasks
private fun messageCollectorLogger(collector: MessageCollector) = object : Logger {
override fun warning(message: String)= collector.report(CompilerMessageSeverity.STRONG_WARNING, message)
override fun error(message: String) = collector.report(CompilerMessageSeverity.ERROR, message)
override fun log(message: String) = collector.report(CompilerMessageSeverity.LOGGING, message)
override fun fatal(message: String): Nothing {
collector.report(CompilerMessageSeverity.ERROR, message)
(collector as? GroupingMessageCollector)?.flush()
kotlin.error(message)
}
}

View File

@@ -11,7 +11,6 @@ dependencies {
compile(project(":compiler:backend-common"))
compile(project(":compiler:ir.backend.common"))
compile(project(":compiler:ir.serialization.js"))
compile(project(":compiler:ir.tree.impl"))
compile(project(":compiler:backend.js"))
compile(project(":compiler:backend.wasm"))
compile(project(":js:js.translator"))

View File

@@ -17,8 +17,7 @@ import org.jetbrains.kotlin.cli.common.ExitCode.COMPILATION_ERROR
import org.jetbrains.kotlin.cli.common.ExitCode.OK
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
import org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants
import org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants.DCE_RUNTIME_DIAGNOSTIC_EXCEPTION
import org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants.DCE_RUNTIME_DIAGNOSTIC_LOG
import org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants.*
import org.jetbrains.kotlin.cli.common.config.addKotlinSourceRoot
import org.jetbrains.kotlin.cli.common.extensions.ScriptEvaluationExtension
import org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport
@@ -39,7 +38,6 @@ import org.jetbrains.kotlin.incremental.js.IncrementalDataProvider
import org.jetbrains.kotlin.incremental.js.IncrementalNextRoundChecker
import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumer
import org.jetbrains.kotlin.ir.backend.js.*
import org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImpl
import org.jetbrains.kotlin.ir.declarations.persistent.PersistentIrFactory
import org.jetbrains.kotlin.js.config.*
import org.jetbrains.kotlin.library.KLIB_FILE_EXTENSION
@@ -232,7 +230,6 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
AnalyzerWithCompilerReport(config.configuration),
config.configuration,
PhaseConfig(wasmPhases),
IrFactoryImpl,
allDependencies = resolvedLibraries,
friendDependencies = friendDependencies,
exportedDeclarations = setOf(FqName("main"))
@@ -259,7 +256,6 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
AnalyzerWithCompilerReport(config.configuration),
config.configuration,
phaseConfig,
if (arguments.irDceDriven) PersistentIrFactory() else IrFactoryImpl,
allDependencies = resolvedLibraries,
friendDependencies = friendDependencies,
mainArguments = mainCallArguments,
@@ -436,7 +432,7 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
fun DceRuntimeDiagnostic.Companion.resolve(
value: String?,
messageCollector: MessageCollector
): DceRuntimeDiagnostic? = when (value?.lowercase()) {
): DceRuntimeDiagnostic? = when (value?.toLowerCase()) {
DCE_RUNTIME_DIAGNOSTIC_LOG -> DceRuntimeDiagnostic.LOG
DCE_RUNTIME_DIAGNOSTIC_EXCEPTION -> DceRuntimeDiagnostic.EXCEPTION
null -> null

View File

@@ -4,6 +4,7 @@ package com.intellij;
import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.AbstractExtensionPointBean;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.util.ReflectionUtil;
@@ -92,8 +93,7 @@ public abstract class DynamicBundle extends AbstractBundle {
public static final DynamicBundle INSTANCE = new DynamicBundle("") {
};
@SuppressWarnings("deprecation")
public static class LanguageBundleEP extends com.intellij.openapi.extensions.AbstractExtensionPointBean {
public static class LanguageBundleEP extends AbstractExtensionPointBean {
public static final ExtensionPointName<LanguageBundleEP> EP_NAME = ExtensionPointName.create("com.intellij.languageBundle");
}

View File

@@ -21,7 +21,7 @@ class CodeAnalysisMeasurement(private val lines: Int?, val milliseconds: Long) :
override fun render(): String = formatMeasurement("ANALYZE", milliseconds, lines)
}
class CodeGenerationMeasurement(private val lines: Int?, val milliseconds: Long) : PerformanceMeasurement {
class CodeGenerationMeasurement(private val lines: Int?, private val milliseconds: Long) : PerformanceMeasurement {
override fun render(): String = formatMeasurement("GENERATE", milliseconds, lines)
}

View File

@@ -33,11 +33,13 @@ import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.extensions.ExtensionsArea
import com.intellij.openapi.fileTypes.PlainTextFileType
import com.intellij.openapi.project.Project
import com.intellij.openapi.roots.LanguageLevelProjectExtension
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.io.FileUtilRt
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vfs.*
import com.intellij.openapi.vfs.impl.ZipHandler
import com.intellij.pom.java.LanguageLevel
import com.intellij.psi.PsiElementFinder
import com.intellij.psi.PsiManager
import com.intellij.psi.impl.JavaClassSupersImpl
@@ -92,7 +94,6 @@ import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.resolve.CodeAnalyzerInitializer
import org.jetbrains.kotlin.resolve.ModuleAnnotationsResolver
import org.jetbrains.kotlin.resolve.extensions.ExtraImportsProviderExtension
import org.jetbrains.kotlin.resolve.jvm.extensions.SyntheticJavaResolveExtension
import org.jetbrains.kotlin.resolve.extensions.SyntheticResolveExtension
import org.jetbrains.kotlin.resolve.jvm.KotlinJavaPsiFacade
import org.jetbrains.kotlin.resolve.jvm.extensions.AnalysisHandlerExtension
@@ -576,7 +577,6 @@ class KotlinCoreEnvironment private constructor(
fun registerPluginExtensionPoints(project: MockProject) {
ExpressionCodegenExtension.registerExtensionPoint(project)
SyntheticResolveExtension.registerExtensionPoint(project)
SyntheticJavaResolveExtension.registerExtensionPoint(project)
ClassBuilderInterceptorExtension.registerExtensionPoint(project)
AnalysisHandlerExtension.registerExtensionPoint(project)
PackageFragmentProviderExtension.registerExtensionPoint(project)

View File

@@ -96,7 +96,6 @@ import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.resolve.CodeAnalyzerInitializer
import org.jetbrains.kotlin.resolve.ModuleAnnotationsResolver
import org.jetbrains.kotlin.resolve.extensions.ExtraImportsProviderExtension
import org.jetbrains.kotlin.resolve.jvm.extensions.SyntheticJavaResolveExtension
import org.jetbrains.kotlin.resolve.extensions.SyntheticResolveExtension
import org.jetbrains.kotlin.resolve.jvm.KotlinJavaPsiFacade
import org.jetbrains.kotlin.resolve.jvm.extensions.AnalysisHandlerExtension
@@ -570,7 +569,6 @@ class KotlinCoreEnvironment private constructor(
fun registerPluginExtensionPoints(project: MockProject) {
ExpressionCodegenExtension.registerExtensionPoint(project)
SyntheticResolveExtension.registerExtensionPoint(project)
SyntheticJavaResolveExtension.registerExtensionPoint(project)
ClassBuilderInterceptorExtension.registerExtensionPoint(project)
AnalysisHandlerExtension.registerExtensionPoint(project)
PackageFragmentProviderExtension.registerExtensionPoint(project)

View File

@@ -17,7 +17,6 @@
package org.jetbrains.kotlin.cli.jvm.compiler
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.vfs.*
import com.intellij.psi.PsiElementFinder
import com.intellij.psi.PsiJavaModule
@@ -37,7 +36,8 @@ import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
import org.jetbrains.kotlin.cli.common.checkKotlinPackageUsage
import org.jetbrains.kotlin.cli.common.config.addKotlinSourceRoot
import org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.*
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.OUTPUT
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.WARNING
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.common.messages.OutputMessageUtil
import org.jetbrains.kotlin.cli.common.output.writeAll
@@ -304,11 +304,6 @@ object KotlinToJVMBytecodeCompiler {
val project = environment.project
val performanceManager = environment.configuration.get(CLIConfigurationKeys.PERF_MANAGER)
environment.messageCollector.report(
STRONG_WARNING,
"ATTENTION!\n This build uses in-dev FIR: \n -Xuse-fir"
)
PsiElementFinder.EP.getPoint(project).unregisterExtension(JavaElementFinder::class.java)
val projectConfiguration = environment.configuration
@@ -432,9 +427,6 @@ object KotlinToJVMBytecodeCompiler {
performanceManager?.notifyGenerationFinished()
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled()
outputs[module] = generationState
PsiElementFinder.EP.getPoint(project).unregisterExtension(JavaElementFinder::class.java)
Disposer.dispose(environment.project)
}
val mainClassFqName: FqName? =

View File

@@ -54,20 +54,19 @@ fun CompilerConfiguration.setupJvmSpecificArguments(arguments: K2JVMCompilerArgu
}
}
val stringConcat = arguments.stringConcat
if (stringConcat != null) {
val runtimeStringConcat = JvmStringConcat.fromString(stringConcat)
if (arguments.stringConcat != null) {
val runtimeStringConcat = JvmStringConcat.fromString(arguments.stringConcat!!)
if (runtimeStringConcat != null) {
put(JVMConfigurationKeys.STRING_CONCAT, runtimeStringConcat)
if (jvmTarget.majorVersion < JvmTarget.JVM_9.majorVersion && runtimeStringConcat != JvmStringConcat.INLINE) {
messageCollector.report(
WARNING,
"`-Xstring-concat=$stringConcat` does nothing with JVM target `${jvmTarget.description}`."
"`-Xstring-concat=${arguments.stringConcat}` does nothing with JVM target `${jvmTarget.description}`."
)
}
} else {
messageCollector.report(
ERROR, "Unknown `-Xstring-concat` mode: $stringConcat\n" +
ERROR, "Unknown `-Xstring-concat` mode: ${arguments.stringConcat}\n" +
"Supported modes: ${JvmStringConcat.values().joinToString { it.description }}"
)
}

View File

@@ -62,9 +62,8 @@ class K2MetadataCompiler : CLICompiler<K2MetadataCompilerArguments>() {
val pluginLoadResult = loadPlugins(paths, arguments, configuration)
if (pluginLoadResult != ExitCode.OK) return pluginLoadResult
val commonSources = arguments.commonSources?.toSet() ?: emptySet()
for (arg in arguments.freeArgs) {
configuration.addKotlinSourceRoot(arg, isCommon = arg in commonSources)
configuration.addKotlinSourceRoot(arg, isCommon = true)
}
if (arguments.classpath != null) {
configuration.addJvmClasspathRoots(arguments.classpath!!.split(File.pathSeparatorChar).map(::File))

View File

@@ -125,7 +125,7 @@ object CompilerOutputParser {
// We're directly inside the root tag: <MESSAGES>
return
}
val qNameLowerCase = qName.lowercase()
val qNameLowerCase = qName.toLowerCase(Locale.US)
var category: CompilerMessageSeverity? = CATEGORIES[qNameLowerCase]
if (category == null) {
messageCollector.report(ERROR, "Unknown compiler message tag: $qName")

View File

@@ -360,7 +360,7 @@ class KotlinCompilerClient : KotlinCompilerDaemonClient {
}
private fun detectCompilerClasspath(): List<String>? =
CompilerSystemProperties.JAVA_CLASS_PATH.value
System.getProperty("java.class.path")
?.split(File.pathSeparator)
?.map { File(it).parentFile }
?.distinct()
@@ -454,7 +454,7 @@ class KotlinCompilerClient : KotlinCompilerDaemonClient {
daemonOptions: DaemonOptions,
reportingTargets: DaemonReportingTargets
): Boolean {
val javaExecutable = File(File(CompilerSystemProperties.JAVA_HOME.safeValue, "bin"), "java")
val javaExecutable = File(File(System.getProperty("java.home"), "bin"), "java")
val serverHostname = CompilerSystemProperties.JAVA_RMI_SERVER_HOSTNAME.value ?: error("${CompilerSystemProperties.JAVA_RMI_SERVER_HOSTNAME.property} is not set!")
val platformSpecificOptions = listOf(
// hide daemon window

View File

@@ -299,7 +299,7 @@ object KotlinCompilerClient {
}
fun detectCompilerClasspath(): List<String>? =
CompilerSystemProperties.JAVA_CLASS_PATH.value
System.getProperty("java.class.path")
?.split(File.pathSeparator)
?.map { File(it).parentFile }
?.distinct()
@@ -367,26 +367,20 @@ object KotlinCompilerClient {
}
private fun startDaemon(
compilerId: CompilerId,
daemonJVMOptions: DaemonJVMOptions,
daemonOptions: DaemonOptions,
reportingTargets: DaemonReportingTargets
): Boolean {
val daemonJavaExecutable = compilerId.javaExecutable
?: File(File(CompilerSystemProperties.JAVA_HOME.safeValue, "bin"), "java")
private fun startDaemon(compilerId: CompilerId, daemonJVMOptions: DaemonJVMOptions, daemonOptions: DaemonOptions, reportingTargets: DaemonReportingTargets): Boolean {
val javaExecutable = File(File(System.getProperty("java.home"), "bin"), "java")
val serverHostname = CompilerSystemProperties.JAVA_RMI_SERVER_HOSTNAME.value ?: error("${CompilerSystemProperties.JAVA_RMI_SERVER_HOSTNAME.property} is not set!")
val platformSpecificOptions = listOf(
// hide daemon window
"-Djava.awt.headless=true",
"-D$${CompilerSystemProperties.JAVA_RMI_SERVER_HOSTNAME.property}=$serverHostname")
val javaVersion = CompilerSystemProperties.JAVA_VERSION.value?.toIntOrNull()
val javaVersion = System.getProperty("java.specification.version")?.toIntOrNull()
val javaIllegalAccessWorkaround =
if (javaVersion != null && javaVersion >= 16)
listOf("--illegal-access=permit")
else emptyList()
val args = listOf(
daemonJavaExecutable.absolutePath, "-cp", compilerId.compilerClasspath.joinToString(File.pathSeparator)) +
javaExecutable.absolutePath, "-cp", compilerId.compilerClasspath.joinToString(File.pathSeparator)) +
platformSpecificOptions +
daemonJVMOptions.mappers.flatMap { it.toArgs("-") } +
javaIllegalAccessWorkaround +

View File

@@ -49,7 +49,7 @@ suspend fun walkDaemonsAsync(
useRMI: Boolean = true,
useSockets: Boolean = true
): List<DaemonWithMetadataAsync> { // TODO: replace with Deferred<List<DaemonWithMetadataAsync>> and use mapNotNullAsync to speed this up
val classPathDigest = compilerId.digest()
val classPathDigest = compilerId.compilerClasspath.map { File(it).absolutePath }.distinctStringsDigest().toHexString()
val portExtractor = makePortFromRunFilenameExtractor(classPathDigest)
return registryDir.walk().toList() // list, since walk returns Sequence and Sequence.map{...} is not inline => coroutines dont work
.map { Pair(it, portExtractor(it.name)) }

View File

@@ -217,7 +217,7 @@ class CompileServiceRMIWrapper(val server: CompileServiceServerSide, daemonOptio
runFileDir,
makeRunFilenameString(
timestamp = "%tFT%<tH-%<tM-%<tS.%<tLZ".format(Calendar.getInstance(TimeZone.getTimeZone("Z"))),
digest = compilerId.digest(),
digest = compilerId.compilerClasspath.map { File(it).absolutePath }.distinctStringsDigest().toHexString(),
port = port.toString()
)
)

View File

@@ -55,7 +55,7 @@ fun walkDaemons(registryDir: File,
filter: (File, Int) -> Boolean = { _, _ -> true },
report: (DaemonReportCategory, String) -> Unit = { _, _ -> }
): Sequence<DaemonWithMetadata> {
val classPathDigest = compilerId.digest()
val classPathDigest = compilerId.compilerClasspath.map { File(it).absolutePath }.distinctStringsDigest().toHexString()
val portExtractor = makePortFromRunFilenameExtractor(classPathDigest)
return registryDir.walk()
.map { Pair(it, portExtractor(it.name)) }
@@ -107,7 +107,7 @@ private inline fun tryConnectToDaemon(port: Int, report: (DaemonReportCategory,
private const val validFlagFileKeywordChars = "abcdefghijklmnopqrstuvwxyz0123456789-_"
fun makeAutodeletingFlagFile(keyword: String = "compiler-client", baseDir: File? = null): File {
val prefix = "kotlin-${keyword.filter { validFlagFileKeywordChars.contains(it.lowercaseChar()) }}-"
val prefix = "kotlin-${keyword.filter { validFlagFileKeywordChars.contains(it.toLowerCase()) }}-"
val flagFile = if (baseDir?.isDirectory == true)
Files.createTempFile(baseDir.toPath(), prefix, "-is-running").toFile()
else

View File

@@ -231,38 +231,12 @@ fun ByteArray.toHexString(): String = joinToString("", transform = { "%02x".form
data class CompilerId(
var compilerClasspath: List<String> = listOf(),
var compilerVersion: String = "",
var javaExecutable: File? = null
var compilerVersion: String = ""
) : OptionsGroup {
override val mappers: List<PropMapper<*, *, *>>
get() = listOf(
PropMapper(
dest = this,
prop = CompilerId::compilerClasspath,
toString = { it.joinToString(File.pathSeparator) },
fromString = { it.trimQuotes().split(File.pathSeparator) }
),
StringPropMapper(
dest = this,
prop = CompilerId::compilerVersion
),
PropMapper(
dest = this,
prop = CompilerId::javaExecutable,
toString = { it?.absolutePath },
fromString = { File(it.trimQuotes()) },
skipIf = { it == null }
)
)
fun digest(): String = compilerClasspath
.map { File(it).absolutePath }
.run {
javaExecutable?.let { plus(it.absolutePath) } ?: this
}
.distinctStringsDigest()
.toHexString()
get() = listOf(PropMapper(this, CompilerId::compilerClasspath, toString = { it.joinToString(File.pathSeparator) }, fromString = { it.trimQuotes().split(File.pathSeparator) }),
StringPropMapper(this, CompilerId::compilerVersion))
companion object {
@JvmStatic
@@ -271,15 +245,6 @@ data class CompilerId(
@JvmStatic
fun makeCompilerId(paths: Iterable<File>): CompilerId =
CompilerId(compilerClasspath = paths.map { it.absolutePath })
@JvmStatic
fun makeCompilerId(
paths: Iterable<File>,
javaExecutable: File
): CompilerId = CompilerId(
compilerClasspath = paths.map { it.absolutePath },
javaExecutable = javaExecutable
)
}
}
@@ -387,7 +352,7 @@ private val humanizedMemorySizeRegex = "(\\d+)([kmg]?)".toRegex()
private fun String.memToBytes(): Long? =
humanizedMemorySizeRegex
.matchEntire(this.trim().lowercase())
.matchEntire(this.trim().toLowerCase())
?.groups?.let { match ->
match[1]?.value?.let {
it.toLong() *

View File

@@ -16,7 +16,6 @@
package org.jetbrains.kotlin.daemon.common
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
import org.jetbrains.kotlin.util.capitalizeDecapitalize.toLowerCaseAsciiOnly
import java.io.File
@@ -27,7 +26,7 @@ enum class OSKind {
Unknown;
companion object {
val current: OSKind = CompilerSystemProperties.OS_NAME.safeValue.toLowerCaseAsciiOnly().let {
val current: OSKind = System.getProperty("os.name").toLowerCaseAsciiOnly().let {
when {
// partly taken from http://www.code4copy.com/java/post/detecting-os-type-in-java
it.startsWith("windows") -> Windows
@@ -58,8 +57,8 @@ private fun String?.orDefault(v: String): String =
object FileSystem {
val userHomePath: String get() = CompilerSystemProperties.USER_HOME.safeValue
val tempPath: String get() = CompilerSystemProperties.TMP_DIR.safeValue
val userHomePath: String get() = System.getProperty("user.home")
val tempPath: String get() = System.getProperty("java.io.tmpdir")
val logFilesPath: String get() = tempPath

View File

@@ -1,11 +1,21 @@
/*
* Copyright 2010-2021 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.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.daemon
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.io.FileUtilRt
import junit.framework.TestCase
@@ -33,7 +43,7 @@ import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import kotlin.concurrent.thread
import kotlin.io.path.ExperimentalPathApi
import kotlin.io.path.invariantSeparatorsPathString
import kotlin.io.path.invariantSeparatorsPath
import kotlin.script.dependencies.Environment
import kotlin.script.dependencies.ScriptContents
import kotlin.script.experimental.dependencies.DependenciesResolver
@@ -278,129 +288,6 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
}
}
private fun getJdk8Location() = System.getenv("JDK_18") ?: System.getenv("JAVA_HOME")
fun testNewDaemonIsNotStartedForSameJavaExecutable() {
withFlagFile(getTestName(true), "-client1.alive") { flagFile1 ->
withFlagFile(getTestName(true), "-client2.alive") { flagFile2 ->
val daemonOptions = makeTestDaemonOptions(getTestName(true))
val compilerIdJdk8 = CompilerId.makeCompilerId(
compilerClassPath +
File(KotlinIntegrationTestBase.getCompilerLib(), "kotlin-compiler-sources.jar"),
File(getJdk8Location()).resolve("bin/java")
)
withLogFile("kotlin-daemon-test-1") { logFile ->
val daemonJVMOptions = makeTestDaemonJvmOptions(logFile)
assertTrue(logFile.length() == 0L)
val daemon1 = KotlinCompilerClient.connectToCompileService(
compilerIdJdk8,
flagFile1,
daemonJVMOptions,
daemonOptions,
DaemonReportingTargets(out = System.err),
autostart = true
)
assertNotNull("failed to connect daemon", daemon1)
logFile.assertLogContainsSequence("INFO: starting daemon")
val daemon2 = KotlinCompilerClient.connectToCompileService(
compilerIdJdk8,
flagFile2,
daemonJVMOptions,
daemonOptions,
DaemonReportingTargets(out = System.err),
autostart = true
)
assertNotNull("failed to connect daemon", daemon2)
val logContent = logFile.readText().lines()
assert(
logContent.filter { it.contains("INFO: starting daemon") }.size == 1
) {
"Second daemon instance was started!"
}
assert(
logContent.filter {
it.contains("INFO: Registered a client alive file: ${flagFile2.absolutePath}")
}.size == 1
) {
"Second client was not connected to the same instance!"
}
KotlinCompilerClient.shutdownCompileService(compilerIdJdk8, daemonOptions)
Thread.sleep(100)
logFile.assertLogContainsSequence("Shutdown started")
}
}
}
}
// Ignored on Windows OS due to https://bugs.openjdk.java.net/browse/JDK-8189953 bug in JDK 9
// Should be unignored once JDK10+ will be available by default on CI agents
fun testNewDaemonIsStartedOnJavaExecutableChange() {
if (SystemInfo.isWindows) return
withFlagFile(getTestName(true), "-client1.alive") { flagFile1 ->
withFlagFile(getTestName(true), "-client2.alive") { flagFile2 ->
val daemonOptions = makeTestDaemonOptions(getTestName(true))
val compilerIdJdk8 = CompilerId.makeCompilerId(
compilerClassPath +
File(KotlinIntegrationTestBase.getCompilerLib(), "kotlin-compiler-sources.jar"),
File(getJdk8Location()).resolve("bin/java")
)
val compilerIdJdk9 = CompilerId.makeCompilerId(
compilerClassPath +
File(KotlinIntegrationTestBase.getCompilerLib(), "kotlin-compiler-sources.jar"),
File(System.getenv("JDK_9")).resolve("bin/java")
)
withLogFile("kotlin-daemon-test-1") { logFile1 ->
withLogFile("kotlin-daemon-test-2") { logFile2 ->
val daemonJdk8JVMOptions = makeTestDaemonJvmOptions(logFile1)
assertTrue(logFile1.length() == 0L)
val daemonJdk9JVMOptions = makeTestDaemonJvmOptions(logFile2)
assertTrue(logFile2.length() == 0L)
val daemonJdk7 = KotlinCompilerClient.connectToCompileService(
compilerIdJdk8,
flagFile1,
daemonJdk8JVMOptions,
daemonOptions,
DaemonReportingTargets(out = System.err),
autostart = true
)
assertNotNull("failed to connect daemon", daemonJdk7)
logFile1.assertLogContainsSequence("INFO: starting daemon")
val daemonJdk9 = KotlinCompilerClient.connectToCompileService(
compilerIdJdk9,
flagFile2,
daemonJdk9JVMOptions,
daemonOptions,
DaemonReportingTargets(out = System.err),
autostart = true
)
assertNotNull("failed to connect daemon", daemonJdk9)
logFile2.assertLogContainsSequence("INFO: starting daemon")
KotlinCompilerClient.shutdownCompileService(compilerIdJdk8, daemonOptions)
KotlinCompilerClient.shutdownCompileService(compilerIdJdk9, daemonOptions)
Thread.sleep(100)
logFile1.assertLogContainsSequence("Shutdown started")
logFile2.assertLogContainsSequence("Shutdown started")
}
}
}
}
}
fun testDaemonRunError() {
withFlagFile(getTestName(true), ".alive") { flagFile ->
val daemonOptions = DaemonOptions(shutdownDelayMilliseconds = 1, verbose = true, runFilesPath = File(testTempDir, getTestName(true)).absolutePath)
@@ -1118,7 +1005,7 @@ internal val File.loggerCompatiblePath: String
@OptIn(ExperimentalPathApi::class)
internal val Path.loggerCompatiblePath: String
get() = invariantSeparatorsPathString
get() = invariantSeparatorsPath
open class TestKotlinScriptDummyDependenciesResolver : DependenciesResolver {

View File

@@ -243,7 +243,7 @@ abstract class CompileServiceImplBase(
runFileDir,
makeRunFilenameString(
timestamp = "%tFT%<tH-%<tM-%<tS.%<tLZ".format(Calendar.getInstance(TimeZone.getTimeZone("Z"))),
digest = compilerId.digest(),
digest = compilerId.compilerClasspath.map { File(it).absolutePath }.distinctStringsDigest().toHexString(),
port = port.toString()
)
)

View File

@@ -47,7 +47,7 @@ class LogStream(name: String) : OutputStream() {
val lineBuf = StringBuilder()
override fun write(byte: Int) {
if (byte == '\n'.code) flush()
if (byte.toChar() == '\n') flush()
else lineBuf.append(byte.toChar())
}

View File

@@ -114,7 +114,7 @@ class LazyClasspathWatcher(classpath: Iterable<String>,
}
fun isClasspathFile(file: File): Boolean = file.isFile && listOf("class", "jar").contains(file.extension.lowercase())
fun isClasspathFile(file: File): Boolean = file.isFile && listOf("class", "jar").contains(file.extension.toLowerCase())
fun File.md5Digest(): ByteArray {
val md = MessageDigest.getInstance(CLASSPATH_FILE_ID_DIGEST)

View File

@@ -56,11 +56,6 @@ public class FirLoadCompiledKotlinGenerated extends AbstractFirLoadCompiledKotli
runTest("compiler/testData/loadJava/compiledKotlin/annotations/AnnotationInAnnotationArguments.kt");
}
@TestMetadata("AnnotationInArray.kt")
public void testAnnotationInArray() throws Exception {
runTest("compiler/testData/loadJava/compiledKotlin/annotations/AnnotationInArray.kt");
}
@TestMetadata("ClassLiteralArguments.kt")
public void testClassLiteralArguments() throws Exception {
runTest("compiler/testData/loadJava/compiledKotlin/annotations/ClassLiteralArguments.kt");
@@ -443,11 +438,6 @@ public class FirLoadCompiledKotlinGenerated extends AbstractFirLoadCompiledKotli
runTest("compiler/testData/loadJava/compiledKotlin/annotations/types/ClassLiteralArgument.kt");
}
@TestMetadata("DefinitelyNotNull.kt")
public void testDefinitelyNotNull() throws Exception {
runTest("compiler/testData/loadJava/compiledKotlin/annotations/types/DefinitelyNotNull.kt");
}
@TestMetadata("ReceiverParameter.kt")
public void testReceiverParameter() throws Exception {
runTest("compiler/testData/loadJava/compiledKotlin/annotations/types/ReceiverParameter.kt");

View File

@@ -29,11 +29,6 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@TestMetadata("annotationUsedAsAnnotationArgument.kt")
public void testAnnotationUsedAsAnnotationArgument() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/annotationUsedAsAnnotationArgument.kt");
}
@TestMetadata("asImports.kt")
public void testAsImports() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/asImports.kt");
@@ -179,11 +174,6 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest("compiler/fir/analysis-tests/testData/resolve/ft.kt");
}
@TestMetadata("funInterfaceDeclaration.kt")
public void testFunInterfaceDeclaration() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/funInterfaceDeclaration.kt");
}
@TestMetadata("functionTypeAlias.kt")
public void testFunctionTypeAlias() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/functionTypeAlias.kt");
@@ -269,11 +259,6 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest("compiler/fir/analysis-tests/testData/resolve/labelAndReceiverForInfix.kt");
}
@TestMetadata("labeledReturnFromNotLabeledUnnamedFunction.kt")
public void testLabeledReturnFromNotLabeledUnnamedFunction() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/labeledReturnFromNotLabeledUnnamedFunction.kt");
}
@TestMetadata("lambdaArgInScopeFunction.kt")
public void testLambdaArgInScopeFunction() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/lambdaArgInScopeFunction.kt");
@@ -374,11 +359,6 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest("compiler/fir/analysis-tests/testData/resolve/sealedClass.kt");
}
@TestMetadata("settersGetters.kt")
public void testSettersGetters() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/settersGetters.kt");
}
@TestMetadata("simpleClass.kt")
public void testSimpleClass() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/simpleClass.kt");
@@ -399,11 +379,6 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest("compiler/fir/analysis-tests/testData/resolve/statusResolveForTypealiasAsSuperClass.kt");
}
@TestMetadata("supertypesForAnnotationClass.kt")
public void testSupertypesForAnnotationClass() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/supertypesForAnnotationClass.kt");
}
@TestMetadata("syntheticsVsNormalProperties.kt")
public void testSyntheticsVsNormalProperties() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/syntheticsVsNormalProperties.kt");
@@ -506,11 +481,6 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest("compiler/fir/analysis-tests/testData/resolve/arguments/ambiguityOnJavaOverride.kt");
}
@TestMetadata("argParamTypeMismatch.kt")
public void testArgParamTypeMismatch() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/arguments/argParamTypeMismatch.kt");
}
@TestMetadata("argumentsOfAnnotations.kt")
public void testArgumentsOfAnnotations() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/arguments/argumentsOfAnnotations.kt");
@@ -536,11 +506,6 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest("compiler/fir/analysis-tests/testData/resolve/arguments/definetelyNotNullForTypeParameter.kt");
}
@TestMetadata("destructuring.kt")
public void testDestructuring() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/arguments/destructuring.kt");
}
@TestMetadata("extensionLambdaInDefaultArgument.kt")
public void testExtensionLambdaInDefaultArgument() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/arguments/extensionLambdaInDefaultArgument.kt");
@@ -606,11 +571,6 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest("compiler/fir/analysis-tests/testData/resolve/arguments/namedArrayInAnnotation.kt");
}
@TestMetadata("noParameterForName.kt")
public void testNoParameterForName() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/arguments/noParameterForName.kt");
}
@TestMetadata("operatorsOverLiterals.kt")
public void testOperatorsOverLiterals() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.kt");
@@ -956,11 +916,6 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/constVal"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@TestMetadata("const.kt")
public void testConst() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/constVal/const.kt");
}
@TestMetadata("constValNotTopLevelOrObject.kt")
public void testConstValNotTopLevelOrObject() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/constVal/constValNotTopLevelOrObject.kt");
@@ -990,24 +945,6 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
}
}
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/contracts")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Contracts extends AbstractLazyBodyIsNotTouchedTilContractsPhaseTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInContracts() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/contracts"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@TestMetadata("genericContract.kt")
public void testGenericContract() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/contracts/genericContract.kt");
}
}
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/delegates")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -1188,11 +1125,6 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/methodOfAnyImplementedInInterface.kt");
}
@TestMetadata("multipleBounds.kt")
public void testMultipleBounds() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/multipleBounds.kt");
}
@TestMetadata("nonConstValInAnnotationArgument.kt")
public void testNonConstValInAnnotationArgument() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/nonConstValInAnnotationArgument.kt");
@@ -2724,11 +2656,6 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest("compiler/fir/analysis-tests/testData/resolve/problems/doubleGenericDiamond.kt");
}
@TestMetadata("fakeTypeMismatchOnExtensionReference.kt")
public void testFakeTypeMismatchOnExtensionReference() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/fakeTypeMismatchOnExtensionReference.kt");
}
@TestMetadata("falseIntersection.kt")
public void testFalseIntersection() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/problems/falseIntersection.kt");
@@ -2855,21 +2782,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest("compiler/fir/analysis-tests/testData/resolve/references/integerLiteralInLhs.kt");
}
@TestMetadata("leakedImplicitType.kt")
public void testLeakedImplicitType() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/references/leakedImplicitType.kt");
}
@TestMetadata("referenceToExtension.kt")
public void testReferenceToExtension() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.kt");
}
@TestMetadata("referenceToField.kt")
public void testReferenceToField() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/references/referenceToField.kt");
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/references/simple.kt");
@@ -2893,11 +2810,6 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/samConstructors"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@TestMetadata("funInterfaceConstructorReference.kt")
public void testFunInterfaceConstructorReference() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/funInterfaceConstructorReference.kt");
}
@TestMetadata("genericSam.kt")
public void testGenericSam() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/genericSam.kt");

View File

@@ -9,7 +9,6 @@ import com.intellij.psi.search.GlobalSearchScope
import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.jvm.compiler.AbstractLoadJavaTest
import org.jetbrains.kotlin.jvm.compiler.LoadDescriptorUtil.compileKotlinToDirAndGetModule
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.test.ConfigurationKind
@@ -55,7 +54,6 @@ abstract class AbstractFirLoadCompiledKotlin : AbstractFirLoadBinariesTest() {
val file = File(path)
val configuration = newConfiguration(ConfigurationKind.JDK_ONLY, TestJdkKind.MOCK_JDK, emptyList(), emptyList<File>())
AbstractLoadJavaTest.updateConfigurationWithDirectives(file.readText(), configuration)
val environment = KotlinCoreEnvironment.createForTests(testRootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES)
return compileKotlinToDirAndGetModule(listOf(file), tmpdir, environment)

View File

@@ -200,7 +200,7 @@ public final class Byte : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Byte>|, R
public open fun toByte(): R|kotlin/Byte|
@R|kotlin/Deprecated|(message = String(Direct conversion to Char is deprecated. Use toInt().toChar() or Char constructor instead.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(this.toInt().toChar())) ) @R|kotlin/DeprecatedSinceKotlin|(warningSince = String(1.5)) public open fun toChar(): R|kotlin/Char|
public open fun toChar(): R|kotlin/Char|
public open fun toDouble(): R|kotlin/Double|
@@ -288,19 +288,19 @@ public final class Char : R|kotlin/Comparable<kotlin/Char>|, R|java/io/Serializa
public final operator fun rangeTo(other: R|kotlin/Char|): R|kotlin/ranges/CharRange|
@R|kotlin/Deprecated|(message = String(Conversion of Char to Number is deprecated. Use Char.code property instead.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(this.code.toByte())) ) @R|kotlin/DeprecatedSinceKotlin|(warningSince = String(1.5)) public final fun toByte(): R|kotlin/Byte|
public final fun toByte(): R|kotlin/Byte|
public final fun toChar(): R|kotlin/Char|
@R|kotlin/Deprecated|(message = String(Conversion of Char to Number is deprecated. Use Char.code property instead.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(this.code.toDouble())) ) @R|kotlin/DeprecatedSinceKotlin|(warningSince = String(1.5)) public final fun toDouble(): R|kotlin/Double|
public final fun toDouble(): R|kotlin/Double|
@R|kotlin/Deprecated|(message = String(Conversion of Char to Number is deprecated. Use Char.code property instead.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(this.code.toFloat())) ) @R|kotlin/DeprecatedSinceKotlin|(warningSince = String(1.5)) public final fun toFloat(): R|kotlin/Float|
public final fun toFloat(): R|kotlin/Float|
@R|kotlin/Deprecated|(message = String(Conversion of Char to Number is deprecated. Use Char.code property instead.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(this.code)) ) @R|kotlin/DeprecatedSinceKotlin|(warningSince = String(1.5)) public final fun toInt(): R|kotlin/Int|
public final fun toInt(): R|kotlin/Int|
@R|kotlin/Deprecated|(message = String(Conversion of Char to Number is deprecated. Use Char.code property instead.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(this.code.toLong())) ) @R|kotlin/DeprecatedSinceKotlin|(warningSince = String(1.5)) public final fun toLong(): R|kotlin/Long|
public final fun toLong(): R|kotlin/Long|
@R|kotlin/Deprecated|(message = String(Conversion of Char to Number is deprecated. Use Char.code property instead.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(this.code.toShort())) ) @R|kotlin/DeprecatedSinceKotlin|(warningSince = String(1.5)) public final fun toShort(): R|kotlin/Short|
public final fun toShort(): R|kotlin/Short|
private constructor(): R|kotlin/Char|
@@ -484,9 +484,9 @@ public final class Double : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Double>
public final operator fun times(other: R|kotlin/Short|): R|kotlin/Double|
@R|kotlin/Deprecated|(message = String(Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(toInt().toByte())) ) @R|kotlin/DeprecatedSinceKotlin|(warningSince = String(1.3), errorSince = String(1.5)) public open fun toByte(): R|kotlin/Byte|
@R|kotlin/Deprecated|(message = String(Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(toInt().toByte())) ) public open fun toByte(): R|kotlin/Byte|
@R|kotlin/Deprecated|(message = String(Direct conversion to Char is deprecated. Use toInt().toChar() or Char constructor instead.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(this.toInt().toChar())) ) @R|kotlin/DeprecatedSinceKotlin|(warningSince = String(1.5)) public open fun toChar(): R|kotlin/Char|
public open fun toChar(): R|kotlin/Char|
public open fun toDouble(): R|kotlin/Double|
@@ -496,7 +496,7 @@ public final class Double : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Double>
public open fun toLong(): R|kotlin/Long|
@R|kotlin/Deprecated|(message = String(Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(toInt().toShort())) ) @R|kotlin/DeprecatedSinceKotlin|(warningSince = String(1.3), errorSince = String(1.5)) public open fun toShort(): R|kotlin/Short|
@R|kotlin/Deprecated|(message = String(Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(toInt().toShort())) ) public open fun toShort(): R|kotlin/Short|
public final operator fun unaryMinus(): R|kotlin/Double|
@@ -663,9 +663,9 @@ public final class Float : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Float>|,
public final operator fun times(other: R|kotlin/Short|): R|kotlin/Float|
@R|kotlin/Deprecated|(message = String(Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(toInt().toByte())) ) @R|kotlin/DeprecatedSinceKotlin|(warningSince = String(1.3), errorSince = String(1.5)) public open fun toByte(): R|kotlin/Byte|
@R|kotlin/Deprecated|(message = String(Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(toInt().toByte())) ) public open fun toByte(): R|kotlin/Byte|
@R|kotlin/Deprecated|(message = String(Direct conversion to Char is deprecated. Use toInt().toChar() or Char constructor instead.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(this.toInt().toChar())) ) @R|kotlin/DeprecatedSinceKotlin|(warningSince = String(1.5)) public open fun toChar(): R|kotlin/Char|
public open fun toChar(): R|kotlin/Char|
public open fun toDouble(): R|kotlin/Double|
@@ -675,7 +675,7 @@ public final class Float : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Float>|,
public open fun toLong(): R|kotlin/Long|
@R|kotlin/Deprecated|(message = String(Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(toInt().toShort())) ) @R|kotlin/DeprecatedSinceKotlin|(warningSince = String(1.3), errorSince = String(1.5)) public open fun toShort(): R|kotlin/Short|
@R|kotlin/Deprecated|(message = String(Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(toInt().toShort())) ) public open fun toShort(): R|kotlin/Short|
public final operator fun unaryMinus(): R|kotlin/Float|
@@ -976,7 +976,7 @@ public final class Long : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Long>|, R
public open fun toByte(): R|kotlin/Byte|
@R|kotlin/Deprecated|(message = String(Direct conversion to Char is deprecated. Use toInt().toChar() or Char constructor instead.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(this.toInt().toChar())) ) @R|kotlin/DeprecatedSinceKotlin|(warningSince = String(1.5)) public open fun toChar(): R|kotlin/Char|
public open fun toChar(): R|kotlin/Char|
public open fun toDouble(): R|kotlin/Double|
@@ -1170,7 +1170,7 @@ public final class Short : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Short>|,
public open fun toByte(): R|kotlin/Byte|
@R|kotlin/Deprecated|(message = String(Direct conversion to Char is deprecated. Use toInt().toChar() or Char constructor instead.), replaceWith = @R|kotlin/ReplaceWith|(imports = <implicitArrayOf>(), expression = String(this.toInt().toChar())) ) @R|kotlin/DeprecatedSinceKotlin|(warningSince = String(1.5)) public open fun toChar(): R|kotlin/Char|
public open fun toChar(): R|kotlin/Char|
public open fun toDouble(): R|kotlin/Double|

View File

@@ -1,20 +0,0 @@
public final annotation class Anno : R|kotlin/Annotation| {
public final val value: R|kotlin/Array<test/Bnno>|
public get(): R|kotlin/Array<test/Bnno>|
public constructor(value: R|kotlin/Array<test/Bnno>|): R|test/Anno|
}
@R|test/Anno|(value = <implicitArrayOf>(@R|test/Bnno|(value = String(x)) , @R|test/Bnno|(value = String(y)) )) public final class AnnotationInArray : R|kotlin/Any| {
public constructor(): R|test/AnnotationInArray|
}
public final annotation class Bnno : R|kotlin/Annotation| {
public final val value: R|kotlin/String|
public get(): R|kotlin/String|
public constructor(value: R|kotlin/String|): R|test/Bnno|
}

View File

@@ -1 +0,0 @@
public final fun <T> foo(x: R|T!!|, y: R|kotlin/collections/List<T!!>|, z: R|(T!!) -> T!!|): R|T!!|

View File

@@ -1,4 +1,4 @@
@R|kotlin/annotation/Target|(allowedTargets = <implicitArrayOf>(R|kotlin/annotation/AnnotationTarget.TYPE|())) public final annotation class A : R|kotlin/Annotation| {
public final annotation class A : R|kotlin/Annotation| {
public constructor(): R|test/A|
}

View File

@@ -1,5 +1,5 @@
public open class MethodWithFunctionTypes : R|kotlin/Any| {
public open fun foo(f: R|(kotlin/String?) -> kotlin/String|): R|(kotlin/String.() -> kotlin/String?)?|
public open fun foo(f: R|(kotlin/String?) -> kotlin/String|): R|kotlin/String.() -> kotlin/String?|
public constructor(): R|test/MethodWithFunctionTypes|

View File

@@ -1,16 +1,16 @@
public final val nonConstVal1: R|kotlin/Int| = Int(1)
public final val nonConstVal1: R|kotlin/Int|
public get(): R|kotlin/Int|
public final class C : R|kotlin/Any| {
public final companion object Companion : R|kotlin/Any| {
public final val nonConstVal3: R|kotlin/Int| = Int(3)
public final val nonConstVal3: R|kotlin/Int|
public get(): R|kotlin/Int|
private constructor(): R|test/C.Companion|
}
public final val nonConstVal2: R|kotlin/Int| = Int(2)
public final val nonConstVal2: R|kotlin/Int|
public get(): R|kotlin/Int|
public constructor(): R|test/C|

View File

@@ -1,16 +1,8 @@
public final fun test1(): R|suspend () -> kotlin/Unit|
public final fun test1N(): R|(suspend () -> kotlin/Unit)?|
public final fun test2(): R|suspend kotlin/Int.() -> kotlin/Int|
public final fun test2N(): R|(suspend kotlin/Int.() -> kotlin/Int)?|
public final fun test3(): R|kotlin/collections/List<kotlin/coroutines/SuspendFunction0<kotlin/Unit>>|
public final fun test3N(): R|kotlin/collections/List<kotlin/coroutines/SuspendFunction0<kotlin/Unit>?>|
public final fun test4(): R|suspend () -> kotlin/coroutines/SuspendFunction0<kotlin/Unit>|
public final fun test4N(): R|(suspend () -> kotlin/coroutines/SuspendFunction0<kotlin/Unit>?)?|

View File

@@ -1,27 +0,0 @@
FILE: annotationUsedAsAnnotationArgument.kt
public final annotation class Ann : R|kotlin/Annotation| {
public constructor(): R|Ann| {
super<R|kotlin/Any|>()
}
}
public final annotation class Ann2 : R|kotlin/Annotation| {
public constructor(): R|Ann2| {
super<R|kotlin/Any|>()
}
}
public final annotation class Ann3 : R|kotlin/Annotation| {
public constructor(arg: R|kotlin/Int|, s: R|kotlin/String|): R|Ann3| {
super<R|kotlin/Any|>()
}
public final val arg: R|kotlin/Int| = R|<local>/arg|
public get(): R|kotlin/Int|
public final val s: R|kotlin/String| = R|<local>/s|
public get(): R|kotlin/String|
}
@R|Ann3|(@R|Ann3|(@R|Ann|() Int(5), String()) @R|Ann2|() Int(1), String()) public final val a: R|kotlin/Int| = Int(0)
public get(): R|kotlin/Int|

View File

@@ -1,11 +0,0 @@
annotation class Ann
annotation class Ann2
annotation class Ann3(val arg: Int, val s: String)
@Ann3(
<!ANNOTATION_USED_AS_ANNOTATION_ARGUMENT!>@Ann3(
<!ANNOTATION_USED_AS_ANNOTATION_ARGUMENT!>@Ann<!> 5, ""
)<!> <!ANNOTATION_USED_AS_ANNOTATION_ARGUMENT!>@Ann2<!> 1, ""
) val a = 0

View File

@@ -15,5 +15,5 @@ class B : A() {
}
fun test(b: B) {
b.<!INVISIBLE_REFERENCE!>foo<!>("")
b.<!HIDDEN!>foo<!>("")
}

View File

@@ -1,17 +0,0 @@
FILE: argParamTypeMismatch.kt
public final fun foo(first: R|kotlin/String|): R|kotlin/Unit| {
}
public final fun foo2(first: R|kotlin/String|, second: R|kotlin/Int|): R|kotlin/Unit| {
}
public final fun test(): R|kotlin/Unit| {
lval int: R|kotlin/Int| = Int(1)
<Inapplicable(INAPPLICABLE): /foo>#(R|<local>/int|)
<Inapplicable(INAPPLICABLE): /foo>#(Int(2))
<Inapplicable(INAPPLICABLE): /foo>#(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=EXACTLY_ONCE> {
^ Int(20)
}
))
R|/foo2|(String(asdf), Int(3))
<Inapplicable(INAPPLICABLE): /foo2>#(Int(4), String(asdf))
<Inapplicable(INAPPLICABLE): /foo2>#(Int(5), Int(6))
}

View File

@@ -1,13 +0,0 @@
fun foo(first: String) {}
fun foo2(first: String, second: Int) {}
fun test() {
val int = 1
foo(<!ARGUMENT_TYPE_MISMATCH!>int<!>)
foo(<!ARGUMENT_TYPE_MISMATCH!>2<!>)
foo(<!ARGUMENT_TYPE_MISMATCH!>run { 20 }<!>)
foo2("asdf", 3)
foo2(<!ARGUMENT_TYPE_MISMATCH!>4<!>, <!ARGUMENT_TYPE_MISMATCH!>"asdf"<!>)
foo2(<!ARGUMENT_TYPE_MISMATCH!>5<!>, 6)
}

View File

@@ -9,7 +9,7 @@ public @interface Ann {
// FILE: main.kt
@Ann(x = 10, s = "")
@Ann(<!ARGUMENT_TYPE_MISMATCH!>10<!>, <!ARGUMENT_TYPE_MISMATCH!>""<!>)
<!INAPPLICABLE_CANDIDATE!>@Ann(10, "")<!>
@Ann(x = 10, s = "", y = 10)
class A

View File

@@ -21,6 +21,6 @@ fun test() {
baz(1, "my", "yours")
baz(1, z = true)
baz(0, "", <!ARGUMENT_TYPE_MISMATCH!>false<!>)
<!INAPPLICABLE_CANDIDATE!>baz<!>(0, "", false)
}

View File

@@ -1,69 +0,0 @@
FILE: destructuring.kt
public final data class C : R|kotlin/Any| {
public constructor(x: R|kotlin/Int|, y: R|kotlin/String|): R|C| {
super<R|kotlin/Any|>()
}
public final val x: R|kotlin/Int| = R|<local>/x|
public get(): R|kotlin/Int|
public final val y: R|kotlin/String| = R|<local>/y|
public get(): R|kotlin/String|
public final operator fun component1(): R|kotlin/Int|
public final operator fun component2(): R|kotlin/String|
public final fun copy(x: R|kotlin/Int| = this@R|/C|.R|/C.x|, y: R|kotlin/String| = this@R|/C|.R|/C.y|): R|C|
}
public final fun foo1(block: R|(C) -> kotlin/Unit|): R|kotlin/Unit| {
^foo1 R|<local>/block|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Unit|>|(R|/C.C|(Int(0), String()))
}
public final fun foo2(block: R|(C, C) -> kotlin/Unit|): R|kotlin/Unit| {
^foo2 R|<local>/block|.R|SubstitutionOverride<kotlin/Function2.invoke: R|kotlin/Unit|>|(R|/C.C|(Int(0), String()), R|/C.C|(Int(0), String()))
}
public final fun test(): R|kotlin/Unit| {
R|/foo1|(<L> = foo1@fun <anonymous>(<destruct>: R|C|): R|kotlin/Unit| <inline=NoInline> {
lval x: R|kotlin/Int| = R|<local>/<destruct>|.R|/C.component1|()
lval y: R|kotlin/String| = R|<local>/<destruct>|.R|/C.component2|()
R|/C.C|(R|<local>/x|, R|<local>/y|)
}
)
R|/foo1|(<L> = foo1@fun <anonymous>(<destruct>: R|C|): R|kotlin/Unit| <inline=NoInline> {
lval x: R|kotlin/Int| = R|<local>/<destruct>|.R|/C.component1|()
lval y: R|kotlin/String| = R|<local>/<destruct>|.R|/C.component2|()
R|/C.C|(R|<local>/x|, R|<local>/y|)
}
)
R|/foo1|(<L> = foo1@fun <anonymous>(<destruct>: R|C|): R|kotlin/Unit| <inline=NoInline> {
lval x: R|kotlin/String| = R|<local>/<destruct>|.R|/C.component1|()
lval y: R|kotlin/Int| = R|<local>/<destruct>|.R|/C.component2|()
<Inapplicable(INAPPLICABLE): /C.C>#(R|<local>/x|, R|<local>/y|)
}
)
R|/foo2|(<L> = foo2@fun <anonymous>(<destruct>: R|C|, <destruct>: R|C|): R|kotlin/Unit| <inline=NoInline> {
lval x: R|kotlin/Int| = R|<local>/<destruct>|.R|/C.component1|()
lval y: R|kotlin/String| = R|<local>/<destruct>|.R|/C.component2|()
lval z: R|kotlin/Int| = R|<local>/<destruct>|.R|/C.component1|()
lval w: R|kotlin/String| = R|<local>/<destruct>|.R|/C.component2|()
R|/C.C|(R|<local>/x|.R|kotlin/Int.plus|(R|<local>/z|), R|<local>/y|.R|kotlin/String.plus|(R|<local>/w|))
}
)
R|/foo2|(<L> = foo2@fun <anonymous>(<destruct>: R|C|, <destruct>: R|C|): R|kotlin/Unit| <inline=NoInline> {
lval x: R|kotlin/Int| = R|<local>/<destruct>|.R|/C.component1|()
lval y: R|kotlin/String| = R|<local>/<destruct>|.R|/C.component2|()
lval z: R|kotlin/Int| = R|<local>/<destruct>|.R|/C.component1|()
lval w: R|kotlin/String| = R|<local>/<destruct>|.R|/C.component2|()
R|/C.C|(R|<local>/x|.R|kotlin/Int.plus|(R|<local>/z|), R|<local>/y|.R|kotlin/String.plus|(R|<local>/w|))
}
)
R|/foo2|(<L> = foo2@fun <anonymous>(<destruct>: R|C|, <destruct>: R|C|): R|kotlin/Unit| <inline=NoInline> {
lval x: R|kotlin/String| = R|<local>/<destruct>|.R|/C.component1|()
lval y: R|kotlin/Int| = R|<local>/<destruct>|.R|/C.component2|()
lval z: R|kotlin/String| = R|<local>/<destruct>|.R|/C.component1|()
lval w: R|kotlin/Int| = R|<local>/<destruct>|.R|/C.component2|()
<Inapplicable(INAPPLICABLE): /C.C>#(R|<local>/x|.R|kotlin/String.plus|(R|<local>/z|), R|<local>/y|.R|kotlin/Int.plus|(R|<local>/w|))
}
)
}

View File

@@ -1,13 +0,0 @@
data class C(val x: Int, val y: String)
fun foo1(block: (C) -> Unit) = block(C(0, ""))
fun foo2(block: (C, C) -> Unit) = block(C(0, ""), C(0, ""))
fun test() {
foo1 { (x, y) -> C(x, y) }
foo1 { (x: Int, y: String) -> C(x, y) }
foo1 { (<!COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH!>x: String<!>, <!COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH!>y: Int<!>) -> C(<!ARGUMENT_TYPE_MISMATCH!>x<!>, <!ARGUMENT_TYPE_MISMATCH!>y<!>) }
foo2 { (x, y), (z, w) -> C(x + z, y + w) }
foo2 { (x: Int, y: String), (z: Int, w: String) -> C(x + z, y + w) }
foo2 { (<!COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH!>x: String<!>, <!COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH!>y: Int<!>), (<!COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH!>z: String<!>, <!COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH!>w: Int<!>) -> C(<!ARGUMENT_TYPE_MISMATCH!>x + z<!>, <!ARGUMENT_TYPE_MISMATCH!>y + w<!>) }
}

View File

@@ -1,5 +1,5 @@
FILE: extensionLambdaInDefaultArgument.kt
public final fun test(f: R|kotlin/String.() -> kotlin/Int| = fun R|kotlin/String|.<anonymous>(): R|kotlin/Int| <inline=Unknown> {
public final fun test(f: R|kotlin/String.() -> kotlin/Int| = fun R|kotlin/String|.<anonymous>(): R|kotlin/Int| {
^ this@R|special/anonymous|.R|kotlin/String.length|
}
): R|kotlin/Int| {

View File

@@ -2,7 +2,7 @@ FILE: incorrectFunctionalType.kt
public final fun foo(func: R|kotlin/Int.(kotlin/Int) -> kotlin/Int|): R|kotlin/Unit| {
}
public final fun test(): R|kotlin/Unit| {
R|/foo|(<L> = foo@fun R|kotlin/Int|.<anonymous>(it: R|kotlin/Int|): R|kotlin/Int| <inline=NoInline> {
R|/foo|(<L> = foo@fun R|kotlin/Int|.<anonymous>(it: R|kotlin/Int|): R|kotlin/Int| {
^ this@R|special/anonymous|.R|kotlin/Int.plus|(R|<local>/it|)
}
)

View File

@@ -25,29 +25,29 @@ FILE: integerLiteralTypes.kt
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(1000))
}
public final fun test_3(): R|kotlin/Unit| {
R|/takeInt|(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=EXACTLY_ONCE> {
R|/takeInt|(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <kind=EXACTLY_ONCE> {
^ Int(1)
}
))
R|/takeByte|(R|kotlin/run|<R|kotlin/Byte|>(<L> = run@fun <anonymous>(): R|kotlin/Byte| <inline=Inline, kind=EXACTLY_ONCE> {
R|/takeByte|(R|kotlin/run|<R|kotlin/Byte|>(<L> = run@fun <anonymous>(): R|kotlin/Byte| <kind=EXACTLY_ONCE> {
^ Byte(1)
}
))
R|/takeLong|(R|kotlin/run|<R|kotlin/Long|>(<L> = run@fun <anonymous>(): R|kotlin/Long| <inline=Inline, kind=EXACTLY_ONCE> {
R|/takeLong|(R|kotlin/run|<R|kotlin/Long|>(<L> = run@fun <anonymous>(): R|kotlin/Long| <kind=EXACTLY_ONCE> {
^ Long(1)
}
))
}
public final fun test_4(): R|kotlin/Unit| {
R|/takeAny|(Int(1))
R|/takeAny|(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=EXACTLY_ONCE> {
R|/takeAny|(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <kind=EXACTLY_ONCE> {
^ Int(1)
}
))
}
public final fun test_5(): R|kotlin/Unit| {
<Inapplicable(INAPPLICABLE): /takeString>#(Int(1))
<Inapplicable(INAPPLICABLE): /takeString>#(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=EXACTLY_ONCE> {
<Inapplicable(INAPPLICABLE): /takeString>#(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <kind=EXACTLY_ONCE> {
^ Int(1)
}
))

View File

@@ -5,7 +5,7 @@ fun takeAny(x: Any) {}
fun takeString(x: String) {}
fun test_0() {
1L
1l
1
10000000000
}
@@ -17,9 +17,9 @@ fun test_1() {
}
fun test_2() {
takeInt(<!ARGUMENT_TYPE_MISMATCH!>10000000000<!>)
<!INAPPLICABLE_CANDIDATE!>takeInt<!>(10000000000)
takeLong(10000000000)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>1000<!>)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1000)
}
fun test_3() {
@@ -35,14 +35,14 @@ fun test_4() {
}
fun test_5() {
takeString(<!ARGUMENT_TYPE_MISMATCH!>1<!>)
takeString(<!ARGUMENT_TYPE_MISMATCH!>run { 1 }<!>)
<!INAPPLICABLE_CANDIDATE!>takeString<!>(1)
<!INAPPLICABLE_CANDIDATE!>takeString<!>(run { 1 })
}
annotation class Ann(val x: Byte)
@Ann(10)
fun test_6() {
@Ann(<!ARGUMENT_TYPE_MISMATCH!>300<!>)
<!INAPPLICABLE_CANDIDATE!>@Ann(300)<!>
val x = ""
}

View File

@@ -9,7 +9,7 @@ public @interface Ann {
@Ann("a", "b")
fun test_1() {}
@Ann(<!ARGUMENT_TYPE_MISMATCH!>arrayOf("a", "b")<!>)
<!INAPPLICABLE_CANDIDATE!>@Ann(arrayOf("a", "b"))<!>
fun test_2() {}
@Ann(*arrayOf("a", "b"))

View File

@@ -13,6 +13,6 @@ fun takeOutA(array: Array<out A>) {}
fun test(array: Array<B>) {
A.take(array)
takeA(<!ARGUMENT_TYPE_MISMATCH!>array<!>)
<!INAPPLICABLE_CANDIDATE!>takeA<!>(array)
takeOutA(array)
}

View File

@@ -6,70 +6,70 @@ FILE: lambda.kt
public final fun baz(f: R|() -> kotlin/Unit|, other: R|kotlin/Boolean| = Boolean(true)): R|kotlin/Unit| {
}
public final fun test(): R|kotlin/Unit| {
R|/foo|(<L> = foo@fun <anonymous>(): R|kotlin/Unit| <inline=NoInline> {
R|/foo|(<L> = foo@fun <anonymous>(): R|kotlin/Unit| {
^@foo Unit
}
)
R|/foo|(<L> = foo@fun <anonymous>(): R|kotlin/Unit| <inline=NoInline> {
R|/foo|(<L> = foo@fun <anonymous>(): R|kotlin/Unit| {
^@foo Unit
}
)
R|/foo|(foo@fun <anonymous>(): R|kotlin/Unit| <inline=NoInline> {
R|/foo|(foo@fun <anonymous>(): R|kotlin/Unit| {
^@foo Unit
}
)
<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /foo>#(Int(1), <L> = foo@fun <anonymous>(): R|kotlin/Unit| <inline=Unknown> {
<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /foo>#(Int(1), <L> = foo@fun <anonymous>(): R|kotlin/Unit| {
^@foo Unit
}
)
<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /foo>#(f = foo@fun <anonymous>(): R|kotlin/Unit| <inline=Unknown> {
<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /foo>#(f = foo@fun <anonymous>(): R|kotlin/Unit| {
^@foo Unit
}
, <L> = foo@fun <anonymous>(): R|kotlin/Unit| <inline=Unknown> {
, <L> = foo@fun <anonymous>(): R|kotlin/Unit| {
^@foo Unit
}
)
R|/bar|(Int(1), <L> = bar@fun <anonymous>(): R|kotlin/Unit| <inline=NoInline> {
R|/bar|(Int(1), <L> = bar@fun <anonymous>(): R|kotlin/Unit| {
^@bar Unit
}
)
R|/bar|(x = Int(1), <L> = bar@fun <anonymous>(): R|kotlin/Unit| <inline=NoInline> {
R|/bar|(x = Int(1), <L> = bar@fun <anonymous>(): R|kotlin/Unit| {
^@bar Unit
}
)
R|/bar|(Int(1), bar@fun <anonymous>(): R|kotlin/Unit| <inline=NoInline> {
R|/bar|(Int(1), bar@fun <anonymous>(): R|kotlin/Unit| {
^@bar Unit
}
)
R|/bar|(x = Int(1), f = bar@fun <anonymous>(): R|kotlin/Unit| <inline=NoInline> {
R|/bar|(x = Int(1), f = bar@fun <anonymous>(): R|kotlin/Unit| {
^@bar Unit
}
)
<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /bar>#(<L> = bar@fun <anonymous>(): R|kotlin/Unit| <inline=Unknown> {
<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /bar>#(<L> = bar@fun <anonymous>(): R|kotlin/Unit| {
^@bar Unit
}
)
<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /bar>#(bar@fun <anonymous>(): R|kotlin/Unit| <inline=Unknown> {
<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /bar>#(bar@fun <anonymous>(): R|kotlin/Unit| {
^@bar Unit
}
)
R|/baz|(other = Boolean(false), f = baz@fun <anonymous>(): R|kotlin/Unit| <inline=NoInline> {
R|/baz|(other = Boolean(false), f = baz@fun <anonymous>(): R|kotlin/Unit| {
^@baz Unit
}
)
R|/baz|(baz@fun <anonymous>(): R|kotlin/Unit| <inline=NoInline> {
R|/baz|(baz@fun <anonymous>(): R|kotlin/Unit| {
^@baz Unit
}
, Boolean(false))
<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /baz>#(<L> = baz@fun <anonymous>(): R|kotlin/Unit| <inline=Unknown> {
<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /baz>#(<L> = baz@fun <anonymous>(): R|kotlin/Unit| {
^@baz Unit
}
)
<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /baz>#(<L> = baz@fun <anonymous>(): R|kotlin/Unit| <inline=Unknown> {
<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /baz>#(<L> = baz@fun <anonymous>(): R|kotlin/Unit| {
^@baz Unit
}
)
<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /baz>#(other = Boolean(false), <L> = baz@fun <anonymous>(): R|kotlin/Unit| <inline=Unknown> {
<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /baz>#(other = Boolean(false), <L> = baz@fun <anonymous>(): R|kotlin/Unit| {
^@baz Unit
}
)

View File

@@ -24,10 +24,10 @@ FILE: lambdaInLambda.kt
public final fun <U, T : R|Template<U>|> R|U|.insert(template: R|T|, build: R|T.() -> kotlin/Unit|): R|kotlin/Unit| {
}
public final fun test(ordinal: R|kotlin/Int|): R|kotlin/Unit| {
R|/buildString|(<L> = buildString@fun R|StringBuilder|.<anonymous>(): R|kotlin/Unit| <inline=NoInline> {
this@R|special/anonymous|.R|/insert|<R|StringBuilder|, R|KDocTemplate|>(R|/KDocTemplate.KDocTemplate|(), <L> = insert@fun R|KDocTemplate|.<anonymous>(): R|kotlin/Unit| <inline=NoInline> {
this@R|special/anonymous|.R|/KDocTemplate.definition|(<L> = definition@fun R|StringBuilder|.<anonymous>(): R|kotlin/Unit| <inline=NoInline> {
R|<local>/ordinal|?.{ $subj$.R|kotlin/let|<R|kotlin/Int|, R|kotlin/Unit|>(<L> = let@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Unit| <inline=Inline, kind=EXACTLY_ONCE> {
R|/buildString|(<L> = buildString@fun R|StringBuilder|.<anonymous>(): R|kotlin/Unit| {
this@R|special/anonymous|.R|/insert|<R|StringBuilder|, R|KDocTemplate|>(R|/KDocTemplate.KDocTemplate|(), <L> = insert@fun R|KDocTemplate|.<anonymous>(): R|kotlin/Unit| {
this@R|special/anonymous|.R|/KDocTemplate.definition|(<L> = definition@fun R|StringBuilder|.<anonymous>(): R|kotlin/Unit| {
R|<local>/ordinal|?.{ $subj$.R|kotlin/let|<R|kotlin/Int|, R|kotlin/Unit|>(<L> = let@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Unit| <kind=EXACTLY_ONCE> {
^@let Unit
}
) }

View File

@@ -16,7 +16,7 @@ fun test(ordinal: Int) {
buildString {
insert(KDocTemplate()) {
definition {
ordinal<!UNNECESSARY_SAFE_CALL!>?.<!>let {}
ordinal?.let {}
}
}
}

View File

@@ -7,7 +7,7 @@ FILE: main.kt
public abstract interface PsiClass : R|kotlin/Any| {
}
public final fun test(): R|kotlin/Unit| {
lval processor: R|AdapterProcessor<ft<PsiMethod, PsiMethod?>, ft<PsiClass, PsiClass?>>| = R|/AdapterProcessor.AdapterProcessor|<R|ft<PsiMethod, PsiMethod?>|, R|ft<PsiClass, PsiClass?>|>(R|/Function|<R|ft<PsiMethod, PsiMethod?>|, R|PsiClass?|>(<L> = Function@fun <anonymous>(method: R|PsiMethod?|): R|PsiClass?| <inline=NoInline> {
lval processor: R|AdapterProcessor<ft<PsiMethod, PsiMethod?>, ft<PsiClass, PsiClass?>>| = R|/AdapterProcessor.AdapterProcessor|<R|ft<PsiMethod, PsiMethod?>|, R|ft<PsiClass, PsiClass?>|>(R|/Function|<R|ft<PsiMethod, PsiMethod?>|, R|PsiClass?|>(<L> = Function@fun <anonymous>(method: R|PsiMethod?|): R|PsiClass?| {
^ R|<local>/method|?.{ $subj$.R|/PsiMethod.containingClass| }
}
))

View File

@@ -3,14 +3,14 @@ FILE: lambdaInUnresolvedCall.kt
^materialize Null(null)!!
}
public final fun test_1(): R|kotlin/Unit| {
<Unresolved name: myRun>#(<L> = myRun@fun <anonymous>(): R|kotlin/Int| <inline=Unknown> {
<Unresolved name: myRun>#(<L> = myRun@fun <anonymous>(): R|kotlin/Int| {
lval x: R|kotlin/Int| = Int(1)
^ R|<local>/x|.R|kotlin/Int.times|(Int(2))
}
)
}
public final fun test_2(): R|kotlin/Unit| {
<Unresolved name: myRun>#(<L> = myRun@fun <anonymous>(): R|kotlin/Any?| <inline=Unknown> {
<Unresolved name: myRun>#(<L> = myRun@fun <anonymous>(): R|kotlin/Any?| {
^ R|/materialize|<R|kotlin/Any?|>()
}
)

View File

@@ -1,6 +0,0 @@
FILE: noParameterForName.kt
public final fun foo(x: R|kotlin/Int|): R|kotlin/Unit| {
}
public final fun bar(): R|kotlin/Unit| {
<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /foo>#(y = Int(1))
}

View File

@@ -1,5 +0,0 @@
fun foo(x: Int) {}
fun bar() {
foo(<!NAMED_PARAMETER_NOT_FOUND!>y<!> = 1<!NO_VALUE_FOR_PARAMETER!>)<!>
}

View File

@@ -52,24 +52,24 @@ FILE: operatorsOverLiterals.kt
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(1).R|kotlin/Int.inv|())
}
public final fun test_6(): R|kotlin/Unit| {
<Inapplicable(INAPPLICABLE): /takeByte>#(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=EXACTLY_ONCE> {
<Inapplicable(INAPPLICABLE): /takeByte>#(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <kind=EXACTLY_ONCE> {
^ Int(127).R|kotlin/Int.plus|(Int(1))
}
))
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(1).R|kotlin/Int.plus|(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=EXACTLY_ONCE> {
<Inapplicable(INAPPLICABLE): /takeByte>#(Int(1).R|kotlin/Int.plus|(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <kind=EXACTLY_ONCE> {
^ Int(1)
}
)))
<Inapplicable(INAPPLICABLE): /takeByte>#(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=EXACTLY_ONCE> {
<Inapplicable(INAPPLICABLE): /takeByte>#(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <kind=EXACTLY_ONCE> {
^ Int(1).R|kotlin/Int.plus|(Int(1))
}
))
Int(1).R|kotlin/Int.plus|(Int(1))
R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=EXACTLY_ONCE> {
R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <kind=EXACTLY_ONCE> {
^ Int(1)
}
)
Int(1).R|kotlin/Int.plus|(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <inline=Inline, kind=EXACTLY_ONCE> {
Int(1).R|kotlin/Int.plus|(R|kotlin/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| <kind=EXACTLY_ONCE> {
^ Int(1)
}
))

View File

@@ -31,33 +31,33 @@ fun test_3() {
fun takeByte(b: Byte) {}
fun test_4() {
takeByte(<!ARGUMENT_TYPE_MISMATCH!>1 + 1<!>)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>1 + 127<!>)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>1 - 1<!>)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>-100 - 100<!>)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>10 * 10<!>)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>100 * 100<!>)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1 + 1)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1 + 127)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1 - 1)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(-100 - 100)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(10 * 10)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(100 * 100)
<!UNRESOLVED_REFERENCE!>taleByte<!>(10 / 10)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>100 % 10<!>)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>1000 % 10<!>)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>1000 and 100<!>)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>128 and 511<!>)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>100 or 100<!>)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>1000 or 0<!>)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>511 xor 511<!>)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>512 xor 511<!>)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(100 % 10)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1000 % 10)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1000 and 100)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(128 and 511)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(100 or 100)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1000 or 0)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(511 xor 511)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(512 xor 511)
}
fun test_5() {
takeByte(-1)
takeByte(+1)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>1.inv()<!>)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1.inv())
}
fun test_6() {
takeByte(<!ARGUMENT_TYPE_MISMATCH!>run { 127 + 1 }<!>)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>1 + run { 1 }<!>)
takeByte(<!ARGUMENT_TYPE_MISMATCH!>run { 1 + 1 }<!>)
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(run { 127 + 1 })
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(1 + run { 1 })
<!INAPPLICABLE_CANDIDATE!>takeByte<!>(run { 1 + 1 })
1 + 1
run { 1 }
1 + run { 1 }

View File

@@ -6,7 +6,7 @@ FILE: overloadWithDefault.kt
}
public final fun test(a: R|A|): R|kotlin/Unit| {
R|<local>/a|.R|/A.foo|(<L> = foo@fun <anonymous>(): R|kotlin/Boolean| <inline=NoInline> {
R|<local>/a|.R|/A.foo|(<L> = foo@fun <anonymous>(): R|kotlin/Boolean| {
^ Boolean(true)
}
)

View File

@@ -8,10 +8,10 @@ fun test() {
foo(third = false, second = 2.71, fourth = "?!", first = 0)
foo(<!NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>)<!>
foo(<!ARGUMENT_TYPE_MISMATCH!>0.0<!>, <!ARGUMENT_TYPE_MISMATCH!>false<!>, <!ARGUMENT_TYPE_MISMATCH!>0<!>, "")
<!INAPPLICABLE_CANDIDATE!>foo<!>(0.0, false, 0, "")
foo(1, 2.0, third = true, "")
foo(second = 0.0, first = 0, fourth = ""<!NO_VALUE_FOR_PARAMETER!>)<!>
foo(first = <!ARGUMENT_TYPE_MISMATCH!>0.0<!>, second = <!ARGUMENT_TYPE_MISMATCH!>0<!>, third = <!ARGUMENT_TYPE_MISMATCH!>""<!>, fourth = <!ARGUMENT_TYPE_MISMATCH!>false<!>)
<!INAPPLICABLE_CANDIDATE!>foo<!>(first = 0.0, second = 0, third = "", fourth = false)
foo(first = 0, second = 0.0, third = false, fourth = "", <!ARGUMENT_PASSED_TWICE!>first<!> = 1)
foo(0, 0.0, false, <!NAMED_PARAMETER_NOT_FOUND!>foth<!> = ""<!NO_VALUE_FOR_PARAMETER!>)<!>
foo(0, 0.0, false, foth = ""<!NO_VALUE_FOR_PARAMETER!>)<!>
}

View File

@@ -8,5 +8,5 @@ FILE: stringTemplates.kt
public final fun foo(s: R|kotlin/String|): R|kotlin/Unit| {
}
public final fun test(a: R|A|): R|kotlin/Unit| {
R|/foo|(<strcat>(R|<local>/a|))
R|/foo|(<strcat>(R|<local>/a|.R|kotlin/Any.toString|()))
}

View File

@@ -5,7 +5,7 @@ FILE: tryInLambda.kt
public final fun foo(): R|kotlin/Unit| {
}
public final fun test(): R|kotlin/Unit| {
R|/myRun|<R|kotlin/Unit|>(<L> = myRun@fun <anonymous>(): R|kotlin/Unit| <inline=NoInline> {
R|/myRun|<R|kotlin/Unit|>(<L> = myRun@fun <anonymous>(): R|kotlin/Unit| {
try {
lval x: R|kotlin/Int| = Int(1)
}

View File

@@ -7,13 +7,13 @@ FILE: untouchedReturnInIf.kt
public final fun leaves(value: R|kotlin/String|, forward: R|kotlin/Boolean|): R|Box<kotlin/String>| {
when () {
R|<local>/forward| -> {
^leaves R|/foo|<R|kotlin/String|>(<L> = foo@fun <anonymous>(it: R|kotlin/String|): R|kotlin/String| <inline=NoInline> {
^leaves R|/foo|<R|kotlin/String|>(<L> = foo@fun <anonymous>(it: R|kotlin/String|): R|kotlin/String| {
^ String()
}
)
}
else -> {
^leaves R|/foo|<R|kotlin/String|>(<L> = foo@fun <anonymous>(it: R|kotlin/String|): R|kotlin/String| <inline=NoInline> {
^leaves R|/foo|<R|kotlin/String|>(<L> = foo@fun <anonymous>(it: R|kotlin/String|): R|kotlin/String| {
^ String()
}
)

View File

@@ -7,8 +7,8 @@ fun test() {
foo(1, "my", "yours")
foo(1, *arrayOf("my", "yours"))
foo(<!ARGUMENT_TYPE_MISMATCH!>""<!>)
foo(1, <!ARGUMENT_TYPE_MISMATCH!>2<!>)
<!INAPPLICABLE_CANDIDATE!>foo<!>("")
<!INAPPLICABLE_CANDIDATE!>foo<!>(1, 2)
bar(1, z = true, y = *arrayOf("my", "yours"))

View File

@@ -2,7 +2,7 @@ FILE: varargOfLambdasWithReceiver.kt
public final fun runLambdas(vararg values: @R|kotlin/ExtensionFunctionType|() R|kotlin/Array<out @ExtensionFunctionType kotlin/Function1<kotlin/String, kotlin/Unit>>|): R|kotlin/Unit| {
}
public final fun test(): R|kotlin/Unit| {
R|/runLambdas|(vararg(runLambdas@fun R|kotlin/String|.<anonymous>(): R|kotlin/Unit| <inline=Unknown> {
R|/runLambdas|(vararg(runLambdas@fun R|kotlin/String|.<anonymous>(): R|kotlin/Unit| {
this@R|special/anonymous|.R|kotlin/String.length|
}
))

View File

@@ -9,7 +9,7 @@ fun bar(x: B) {}
fun test(c: C) {
// Argument mapping error
foo(<!ARGUMENT_TYPE_MISMATCH!>""<!>)
<!INAPPLICABLE_CANDIDATE!>foo<!>("")
// Ambiguity
<!OVERLOAD_RESOLUTION_AMBIGUITY!>bar<!>(c)

View File

@@ -40,7 +40,7 @@ FILE: invokeAmbiguity.kt
^ R|kotlin/TODO|()
}
public final fun box(d: R|D|): R|kotlin/Unit| {
R|<local>/d|.R|/attr|.R|/B.invoke|(<L> = attr@fun <anonymous>(): R|kotlin/Unit| <inline=NoInline> {
R|<local>/d|.R|/attr|.R|/B.invoke|(<L> = attr@fun <anonymous>(): R|kotlin/Unit| {
^@attr Unit
}
).R|kotlin/CharSequence.length|

Some files were not shown because too many files have changed in this diff Show More