Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
7e2c2ef6
K
kotlin
项目概览
硅谷海盗
/
kotlin
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kotlin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7e2c2ef6
编写于
10月 08, 2015
作者:
D
Dmitry Jemerov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
restore compilation after rebase of dropping external annotations; fix affected tests
上级
c41aefe2
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
12 addition
and
72 deletion
+12
-72
ant/src/org/jetbrains/kotlin/ant/KotlinCompilerAdapter.kt
ant/src/org/jetbrains/kotlin/ant/KotlinCompilerAdapter.kt
+0
-12
compiler/cli/src/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt
...ler/cli/src/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt
+0
-13
compiler/testData/modules.xml/typeTestModule.txt
compiler/testData/modules.xml/typeTestModule.txt
+0
-1
compiler/tests/org/jetbrains/kotlin/test/ConfigurationKind.kt
...iler/tests/org/jetbrains/kotlin/test/ConfigurationKind.kt
+3
-5
compiler/util/src/org/jetbrains/kotlin/modules/Module.kt
compiler/util/src/org/jetbrains/kotlin/modules/Module.kt
+0
-2
idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/PluginTestCaseBase.java
...rc/org/jetbrains/kotlin/idea/test/PluginTestCaseBase.java
+1
-22
idea/testData/intentions/convertToBlockBody/implicitlyNonUnitFun.kt.after
...tentions/convertToBlockBody/implicitlyNonUnitFun.kt.after
+1
-1
idea/testData/quickfix/supertypeInitialization/addImport.kt.after
...tData/quickfix/supertypeInitialization/addImport.kt.after
+1
-1
idea/testData/quickfix/supertypeInitialization/multipleConstructors.kt.after
...fix/supertypeInitialization/multipleConstructors.kt.after
+1
-1
jps-plugin/src/org/jetbrains/kotlin/compilerRunner/KotlinCompilerRunner.kt
...g/jetbrains/kotlin/compilerRunner/KotlinCompilerRunner.kt
+0
-1
jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilderModuleScriptGenerator.java
.../kotlin/jps/build/KotlinBuilderModuleScriptGenerator.java
+0
-11
libraries/tools/kotlin-gradle-plugin-core/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt
...rc/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt
+2
-2
libraries/tools/kotlin-maven-plugin/src/main/java/org/jetbrains/kotlin/maven/K2JVMCompileMojo.java
...ain/java/org/jetbrains/kotlin/maven/K2JVMCompileMojo.java
+3
-0
未找到文件。
ant/src/org/jetbrains/kotlin/ant/KotlinCompilerAdapter.kt
浏览文件 @
7e2c2ef6
...
...
@@ -27,20 +27,10 @@ import java.io.File
import
java.util.*
class
KotlinCompilerAdapter
:
Javac13
()
{
var
externalAnnotations
:
Path
?
=
null
var
moduleName
:
String
?
=
null
var
additionalArguments
:
MutableList
<
Commandline
.
Argument
>
=
ArrayList
(
0
)
fun
createExternalAnnotations
():
Path
{
if
(
externalAnnotations
==
null
)
{
externalAnnotations
=
Path
(
getProject
())
}
return
externalAnnotations
!!
.
createPath
()
}
fun
createCompilerArg
():
Commandline
.
Argument
{
val
argument
=
Commandline
.
Argument
()
additionalArguments
.
add
(
argument
)
...
...
@@ -70,8 +60,6 @@ class KotlinCompilerAdapter : Javac13() {
// it is constructed only of sources which are newer than classes with the same name
kotlinc
.
src
=
javac
.
srcdir
kotlinc
.
externalAnnotations
=
externalAnnotations
if
(
moduleName
==
null
)
{
moduleName
=
javac
.
defaultModuleName
}
...
...
compiler/cli/src/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt
浏览文件 @
7e2c2ef6
...
...
@@ -121,8 +121,6 @@ public open class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
configuration
.
addJvmClasspathRoots
(
getClasspath
(
paths
,
arguments
))
configuration
.
addAll
(
JVMConfigurationKeys
.
ANNOTATIONS_PATH_KEY
,
getAnnotationsPath
(
paths
,
arguments
))
configuration
.
put
(
JVMConfigurationKeys
.
MODULE_NAME
,
arguments
.
moduleName
?:
JvmAbi
.
DEFAULT_MODULE_NAME
)
if
(
arguments
.
module
==
null
&&
arguments
.
freeArgs
.
isEmpty
()
&&
!
arguments
.
version
)
{
...
...
@@ -287,17 +285,6 @@ public open class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
}
return
classpath
}
private
fun
getAnnotationsPath
(
paths
:
KotlinPaths
,
arguments
:
K2JVMCompilerArguments
):
List
<
File
>
{
val
annotationsPath
=
arrayListOf
<
File
>()
if
(
arguments
.
annotations
!=
null
)
{
annotationsPath
.
addAll
(
arguments
.
annotations
.
split
(
File
.
pathSeparatorChar
).
map
{
File
(
it
)
})
}
if
(!
arguments
.
noJdkAnnotations
)
{
annotationsPath
.
add
(
paths
.
getJdkAnnotationsPath
())
}
return
annotationsPath
}
}
}
...
...
compiler/testData/modules.xml/typeTestModule.txt
浏览文件 @
7e2c2ef6
...
...
@@ -3,4 +3,3 @@ name
outputDir=out
sources=[]
classpath=[]
annotations=[]
compiler/tests/org/jetbrains/kotlin/test/ConfigurationKind.kt
浏览文件 @
7e2c2ef6
...
...
@@ -17,12 +17,10 @@
package
org.jetbrains.kotlin.test
public
enum
class
ConfigurationKind
(
public
val
withJdkAnnotations
:
Boolean
,
public
val
withRuntime
:
Boolean
,
public
val
withReflection
:
Boolean
)
{
JDK_ONLY
(
withJdkAnnotations
=
false
,
withRuntime
=
false
,
withReflection
=
false
),
JDK_AND_ANNOTATIONS
(
withJdkAnnotations
=
true
,
withRuntime
=
false
,
withReflection
=
false
),
NO_KOTLIN_REFLECT
(
withJdkAnnotations
=
true
,
withRuntime
=
true
,
withReflection
=
false
),
ALL
(
withJdkAnnotations
=
true
,
withRuntime
=
true
,
withReflection
=
true
),
JDK_ONLY
(
withRuntime
=
false
,
withReflection
=
false
),
NO_KOTLIN_REFLECT
(
withRuntime
=
true
,
withReflection
=
false
),
ALL
(
withRuntime
=
true
,
withReflection
=
true
),
}
compiler/util/src/org/jetbrains/kotlin/modules/Module.kt
浏览文件 @
7e2c2ef6
...
...
@@ -27,7 +27,5 @@ public interface Module {
public
fun
getClasspathRoots
():
List
<
String
>
public
fun
getAnnotationsRoots
():
List
<
String
>
public
fun
getJavaSourceRoots
():
List
<
String
>
}
idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/PluginTestCaseBase.java
浏览文件 @
7e2c2ef6
...
...
@@ -18,13 +18,7 @@ package org.jetbrains.kotlin.idea.test;
import
com.intellij.openapi.projectRoots.JavaSdk
;
import
com.intellij.openapi.projectRoots.Sdk
;
import
com.intellij.openapi.projectRoots.SdkModificator
;
import
com.intellij.openapi.projectRoots.impl.JavaSdkImpl
;
import
com.intellij.openapi.roots.AnnotationOrderRootType
;
import
com.intellij.openapi.util.text.StringUtil
;
import
com.intellij.openapi.vfs.JarFileSystem
;
import
com.intellij.openapi.vfs.LocalFileSystem
;
import
com.intellij.openapi.vfs.VirtualFile
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.kotlin.test.JetTestUtils
;
...
...
@@ -43,13 +37,7 @@ public class PluginTestCaseBase {
@NotNull
private
static
Sdk
getSdk
(
String
sdkHome
)
{
Sdk
sdk
=
JavaSdk
.
getInstance
().
createJdk
(
"JDK"
,
sdkHome
,
true
);
SdkModificator
modificator
=
sdk
.
getSdkModificator
();
VirtualFile
file
=
LocalFileSystem
.
getInstance
().
findFileByIoFile
(
getJdkAnnotationsJar
());
assert
file
!=
null
;
modificator
.
addRoot
(
JarFileSystem
.
getInstance
().
getJarRootForLocalFile
(
file
),
AnnotationOrderRootType
.
getInstance
());
modificator
.
commitChanges
();
return
sdk
;
return
JavaSdk
.
getInstance
().
createJdk
(
"JDK"
,
sdkHome
,
true
);
}
@NotNull
...
...
@@ -64,15 +52,6 @@ public class PluginTestCaseBase {
return
getSdk
(
javaHome
);
}
@NotNull
public
static
File
getJdkAnnotationsJar
()
{
File
jdkAnnotations
=
new
File
(
JetTestUtils
.
getHomeDirectory
(),
"dist/kotlinc/lib/kotlin-jdk-annotations.jar"
);
if
(!
jdkAnnotations
.
exists
())
{
throw
new
RuntimeException
(
"Kotlin JDK annotations jar not found; please run 'ant dist' to build it"
);
}
return
jdkAnnotations
;
}
public
static
boolean
isAllFilesPresentTest
(
@NotNull
String
testName
)
{
return
StringUtil
.
startsWithIgnoreCase
(
testName
,
"allFilesPresentIn"
);
}
...
...
idea/testData/intentions/convertToBlockBody/implicitlyNonUnitFun.kt.after
浏览文件 @
7e2c2ef6
...
...
@@ -2,6 +2,6 @@ import java.net.URI
// WITH_RUNTIME
fun foo(): URI {
fun foo(): URI
?
{
return java.io.File("x").toURI()
}
\ No newline at end of file
idea/testData/quickfix/supertypeInitialization/addImport.kt.after
浏览文件 @
7e2c2ef6
...
...
@@ -2,4 +2,4 @@
import java.io.DataInputStream
import java.io.InputStream
class C(p0: InputStream) : DataInputStream<caret>(p0)
class C(p0: InputStream
?
) : DataInputStream<caret>(p0)
idea/testData/quickfix/supertypeInitialization/multipleConstructors.kt.after
浏览文件 @
7e2c2ef6
...
...
@@ -2,4 +2,4 @@
// ACTION: Add constructor parameters from ArrayList(Int)
import java.util.ArrayList
class C(p0: MutableCollection<out String>) : ArrayList<String><caret>(p0)
class C(p0: MutableCollection<out String>
?
) : ArrayList<String><caret>(p0)
jps-plugin/src/org/jetbrains/kotlin/compilerRunner/KotlinCompilerRunner.kt
浏览文件 @
7e2c2ef6
...
...
@@ -246,7 +246,6 @@ public object KotlinCompilerRunner {
with
(
settings
)
{
module
=
moduleFile
.
absolutePath
noStdlib
=
true
noJdkAnnotations
=
true
noJdk
=
true
}
}
...
...
jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilderModuleScriptGenerator.java
浏览文件 @
7e2c2ef6
...
...
@@ -21,7 +21,6 @@ import com.intellij.openapi.util.io.FileUtil;
import
com.intellij.openapi.util.text.StringUtil
;
import
com.intellij.util.containers.ContainerUtil
;
import
com.intellij.util.containers.MultiMap
;
import
kotlin.CollectionsKt
;
import
kotlin.io.FilesKt
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
...
...
@@ -140,15 +139,5 @@ public class KotlinBuilderModuleScriptGenerator {
return
result
;
}
@NotNull
private
static
JpsSdkType
getSdkType
(
@NotNull
JpsModule
module
)
{
for
(
JpsDependencyElement
dependency
:
module
.
getDependenciesList
().
getDependencies
())
{
if
(
dependency
instanceof
JpsSdkDependency
)
{
return
((
JpsSdkDependency
)
dependency
).
getSdkType
();
}
}
return
JpsJavaSdkType
.
INSTANCE
;
}
private
KotlinBuilderModuleScriptGenerator
()
{}
}
libraries/tools/kotlin-gradle-plugin-core/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt
浏览文件 @
7e2c2ef6
...
...
@@ -36,11 +36,11 @@ import org.gradle.api.tasks.compile.JavaCompile
import
org.jetbrains.org.objectweb.asm.ClassWriter
import
java.io.IOException
import
java.lang.ref.WeakReference
val
DEFAULT_ANNOTATIONS
=
"org.jebrains.kotlin.gradle.defaultAnnotations"
import
java.io.File
import
java.util.HashSet
val
DEFAULT_ANNOTATIONS
=
"org.jebrains.kotlin.gradle.defaultAnnotations"
val
ANNOTATIONS_PLUGIN_NAME
=
"org.jetbrains.kotlin.kapt"
abstract
class
AbstractKotlinCompile
<
T
:
CommonCompilerArguments
>()
:
AbstractCompile
()
{
...
...
libraries/tools/kotlin-maven-plugin/src/main/java/org/jetbrains/kotlin/maven/K2JVMCompileMojo.java
浏览文件 @
7e2c2ef6
...
...
@@ -97,6 +97,9 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArgumen
getLog
().
info
(
"Classes directory is "
+
output
);
arguments
.
destination
=
output
;
arguments
.
moduleName
=
moduleName
;
getLog
().
info
(
"Module name is "
+
moduleName
);
try
{
Args
.
parse
(
arguments
,
ArrayUtil
.
toStringArray
(
args
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录