Skip to content

Commit de40905

Browse files
committed
Adds annotations artifact to classpath container.
1 parent e4ac93f commit de40905

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

kotlin-bundled-compiler/get_bundled.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@
192192
<include name="Kotlin/kotlinc/lib/allopen-compiler-plugin.jar"/>
193193
<include name="Kotlin/kotlinc/lib/noarg-compiler-plugin.jar"/>
194194
<include name="Kotlin/kotlinc/lib/sam-with-receiver-compiler-plugin.jar"/>
195+
<include name="Kotlin/kotlinc/lib/annotations-13.0.jar"/>
195196
</patternset>
196197
<mapper type="flatten"/>
197198
</unzip>

kotlin-eclipse-core/src/org/jetbrains/kotlin/core/KotlinClasspathContainer.kt

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,34 @@ import org.eclipse.jdt.core.IJavaProject
2424
import org.eclipse.jdt.core.JavaCore
2525
import org.jetbrains.kotlin.core.model.KotlinJavaManager
2626
import org.jetbrains.kotlin.core.utils.ProjectUtils
27-
import java.util.ArrayList
28-
import kotlin.jvm.JvmStatic
27+
import java.util.*
2928

3029
val runtimeContainerId: IPath = Path("org.jetbrains.kotlin.core.KOTLIN_CONTAINER")
3130

3231
fun newExportedLibraryEntry(path: IPath): IClasspathEntry = JavaCore.newLibraryEntry(path, null, null, true)
3332

34-
public class KotlinClasspathContainer(val javaProject: IJavaProject) : IClasspathContainer {
33+
class KotlinClasspathContainer(val javaProject: IJavaProject) : IClasspathContainer {
3534
companion object {
3635
val CONTAINER_ENTRY: IClasspathEntry = JavaCore.newContainerEntry(runtimeContainerId)
3736
val LIB_RUNTIME_NAME = "kotlin-stdlib"
3837
val LIB_RUNTIME_SRC_NAME = "kotlin-stdlib-sources"
3938
val LIB_REFLECT_NAME = "kotlin-reflect"
4039
val LIB_SCRIPT_RUNTIME_NAME = "kotlin-script-runtime"
41-
40+
val LIB_ANNOTATIONS_1_3 = "annotations-13.0"
41+
4242
@JvmStatic
43-
public fun getPathToLightClassesFolder(javaProject: IJavaProject): IPath {
44-
return Path(javaProject.getProject().getName()).append(KotlinJavaManager.KOTLIN_BIN_FOLDER).makeAbsolute()
43+
fun getPathToLightClassesFolder(javaProject: IJavaProject): IPath {
44+
return Path(javaProject.project.name).append(KotlinJavaManager.KOTLIN_BIN_FOLDER).makeAbsolute()
4545
}
4646
}
47-
48-
override public fun getClasspathEntries() : Array<IClasspathEntry> {
47+
48+
override fun getClasspathEntries(): Array<IClasspathEntry> {
4949
val entries = ArrayList<IClasspathEntry>()
5050

5151
val kotlinBinFolderEntry = newExportedLibraryEntry(getPathToLightClassesFolder(javaProject))
5252
entries.add(kotlinBinFolderEntry)
53-
54-
val project = javaProject.getProject()
53+
54+
val project = javaProject.project
5555
if (!ProjectUtils.isMavenProject(project) && !ProjectUtils.isGradleProject(project)) {
5656
val kotlinRuntimeEntry = JavaCore.newLibraryEntry(
5757
LIB_RUNTIME_NAME.buildLibPath(),
@@ -60,20 +60,22 @@ public class KotlinClasspathContainer(val javaProject: IJavaProject) : IClasspat
6060
true)
6161
val kotlinReflectEntry = newExportedLibraryEntry(LIB_REFLECT_NAME.buildLibPath())
6262
val kotlinScriptRuntime = newExportedLibraryEntry(LIB_SCRIPT_RUNTIME_NAME.buildLibPath())
63+
val annotations13 = newExportedLibraryEntry(LIB_ANNOTATIONS_1_3.buildLibPath())
6364

6465
entries.add(kotlinRuntimeEntry)
6566
entries.add(kotlinReflectEntry)
6667
entries.add(kotlinScriptRuntime)
68+
entries.add(annotations13)
6769
}
6870

6971
return entries.toTypedArray()
7072
}
71-
72-
override public fun getDescription() : String = "Kotlin Runtime Library"
73-
74-
override public fun getKind() : Int = IClasspathContainer.K_APPLICATION
75-
76-
override public fun getPath() : IPath = runtimeContainerId
73+
74+
override fun getDescription(): String = "Kotlin Runtime Library"
75+
76+
override fun getKind(): Int = IClasspathContainer.K_APPLICATION
77+
78+
override fun getPath(): IPath = runtimeContainerId
7779
}
7880

7981
fun String.buildLibPath(): Path = Path(ProjectUtils.buildLibPath(this))

0 commit comments

Comments
 (0)