From 646f2cb1140cbe2bdc31bb370925458c494cbf9f Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Fri, 11 Sep 2020 11:53:21 +0300 Subject: [PATCH] Fix insertion of packages and imports after the file annotation --- .../src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy b/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy index 2e17f10bf70..6a630bf9724 100644 --- a/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy +++ b/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy @@ -282,7 +282,7 @@ class RunExternalTestGroup extends JavaExec { text = text.replaceFirst(packagePattern, "package $pkg") } else { pkg = sourceName - text = insertInTextAfter(text, "\npackage $pkg\n", "@file:Suppress") + text = insertInTextAfter(text, "\npackage $pkg\n", "@file:") } if (text =~ boxPattern) { imports.add("${pkg}.*") @@ -331,7 +331,7 @@ class RunExternalTestGroup extends JavaExec { pkg = 'package ' + (text =~ packagePattern)[0][1] text = text.replaceFirst(packagePattern, '') } - text = insertInTextAfter(text, (pkg ? "\n$pkg\n" : "") + "import $sourceName.*\n", "@file:Suppress") + text = insertInTextAfter(text, (pkg ? "\n$pkg\n" : "") + "import $sourceName.*\n", "@file:") } // now replace all package usages in full qualified names def res = "" // filesToCompile