Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
95035b3d
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,发现更多精彩内容 >>
提交
95035b3d
编写于
9月 04, 2017
作者:
I
Ilya Chernikov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix various tests
上级
98413f20
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
92 addition
and
21 deletion
+92
-21
build.gradle.kts
build.gradle.kts
+24
-6
buildSrc/src/main/kotlin/tasks.kt
buildSrc/src/main/kotlin/tasks.kt
+3
-0
compiler/build.gradle.kts
compiler/build.gradle.kts
+1
-0
compiler/container/build.gradle.kts
compiler/container/build.gradle.kts
+2
-0
compiler/tests/org/jetbrains/kotlin/daemon/CompilerDaemonTest.kt
...r/tests/org/jetbrains/kotlin/daemon/CompilerDaemonTest.kt
+9
-5
compiler/tests/org/jetbrains/kotlin/scripts/ScriptTemplateTest.kt
.../tests/org/jetbrains/kotlin/scripts/ScriptTemplateTest.kt
+2
-2
core/util.runtime/build.gradle.kts
core/util.runtime/build.gradle.kts
+1
-1
idea/idea-gradle/build.gradle.kts
idea/idea-gradle/build.gradle.kts
+20
-1
idea/idea-maven/build.gradle.kts
idea/idea-maven/build.gradle.kts
+7
-0
j2k/build.gradle.kts
j2k/build.gradle.kts
+1
-0
libraries/stdlib/js/build.gradle
libraries/stdlib/js/build.gradle
+5
-2
libraries/tools/binary-compatibility-validator/build.gradle
libraries/tools/binary-compatibility-validator/build.gradle
+6
-0
libraries/tools/binary-compatibility-validator/src/test/kotlin/org.jetbrains.kotlin.tools.tests/CasesPublicAPITest.kt
...in/org.jetbrains.kotlin.tools.tests/CasesPublicAPITest.kt
+9
-4
plugins/android-extensions/android-extensions-idea/build.gradle.kts
...droid-extensions/android-extensions-idea/build.gradle.kts
+1
-0
prepare/compiler/build.gradle.kts
prepare/compiler/build.gradle.kts
+1
-0
未找到文件。
build.gradle.kts
浏览文件 @
95035b3d
...
...
@@ -69,12 +69,14 @@ val distDir = "$rootDir/dist"
val
distKotlinHomeDir
=
"$distDir/kotlinc"
val
distLibDir
=
"$distKotlinHomeDir/lib"
val
ideaPluginDir
=
"$distDir/artifacts/Kotlin"
val
ideaUltimatePluginDir
=
"$distDir/artifacts/KotlinUltimate"
extra
[
"distDir"
]
=
distDir
extra
[
"distKotlinHomeDir"
]
=
distKotlinHomeDir
extra
[
"distLibDir"
]
=
project
.
file
(
distLibDir
)
extra
[
"libsDir"
]
=
project
.
file
(
distLibDir
)
extra
[
"ideaPluginDir"
]
=
project
.
file
(
ideaPluginDir
)
extra
[
"ideaUltimatePluginDir"
]
=
project
.
file
(
ideaUltimatePluginDir
)
extra
[
"isSonatypeRelease"
]
=
false
Properties
().
apply
{
...
...
@@ -247,36 +249,44 @@ tasks {
dependsOn
(
":kotlin-test:kotlin-test-common:test"
,
":kotlin-test:kotlin-test-jvm:test"
,
":kotlin-test:kotlin-test-junit:test"
,
// ":kotlin-test:kotlin-test-js:test",
":kotlin-stdlib:test"
,
":kotlin-stdlib-jre7:test"
,
":kotlin-stdlib-jre8:test"
,
// ":kotlin-stdlib-js:test",
// ":tools:binary-compatibility-validator:test",
":tools:binary-compatibility-validator:test"
,
":kotlin-reflect:test"
)
}
"core-libs-check"
{
dependsOn
(
"core-libs-tests"
)
}
"compiler-tests"
{
dependsOn
(
"dist"
)
afterEvaluate
{
dependsOn
(
"dist"
)
}
dependsOn
(
":compiler:test"
,
":compiler:container:test"
,
":compiler:tests-java8:test"
)
}
"compiler-check"
{
dependsOn
(
"compiler-tests"
)
}
"js-tests"
{
dependsOn
(
"dist"
)
dependsOn
(
":js:js.tests:test"
)
dependsOn
(
":kotlin-test:kotlin-test-js:test"
,
":kotlin-stdlib-js:test"
,
":js:js.tests:test"
)
}
"js-check"
{
dependsOn
(
"js-tests"
)
}
"jps-tests"
{
dependsOn
(
"dist"
)
dependsOn
(
":jps-plugin:test"
)
}
"check"
{
dependsOn
(
"test"
)
}
"idea-plugin-main-tests"
{
dependsOn
(
"dist"
)
dependsOn
(
":idea:test"
)
}
"idea-plugin-main-check"
{
dependsOn
(
"idea-plugin-main-tests"
)
}
"idea-plugin-additional-tests"
{
dependsOn
(
"dist"
)
...
...
@@ -285,11 +295,14 @@ tasks {
":j2k:test"
,
":eval4j:test"
)
}
"idea-plugin-additional-check"
{
dependsOn
(
"idea-plugin-additional-tests"
)
}
"idea-plugin-tests"
{
dependsOn
(
"dist"
)
dependsOn
(
"idea-plugin-main-tests"
,
"idea-plugin-additional-tests"
)
}
"idea-plugin-check"
{
dependsOn
(
"idea-plugin-tests"
)
}
"android-tests"
{
dependsOn
(
"dist"
)
...
...
@@ -298,6 +311,7 @@ tasks {
":kotlin-annotation-processing:test"
,
":compiler:android-tests:test"
)
}
"android-check"
{
dependsOn
(
"android-tests"
)
}
"plugins-tests"
{
dependsOn
(
"dist"
)
...
...
@@ -307,6 +321,7 @@ tasks {
":plugins:uast-kotlin:test"
,
":kotlin-annotation-processing-gradle:test"
)
}
"plugins-check"
{
dependsOn
(
"plugins-tests"
)
}
"scripting-tests"
{
dependsOn
(
"dist"
)
...
...
@@ -314,18 +329,21 @@ tasks {
":examples:kotlin-jsr223-local-example:test"
,
":examples:kotlin-jsr223-daemon-local-eval-example:test"
)
}
"scripting-check"
{
dependsOn
(
"scripting-tests"
)
}
"other-tests"
{
dependsOn
(
"dist"
)
dependsOn
(
":kotlin-build-common:test"
,
":generators:test"
)
}
"other-check"
{
dependsOn
(
"other-tests"
)
}
"test"
{
doLast
{
throw
GradleException
(
"Don't use directly, use aggregate tasks *-
tests
instead"
)
throw
GradleException
(
"Don't use directly, use aggregate tasks *-
check
instead"
)
}
}
"check"
{
dependsOn
(
"test"
)
}
}
fun
jdkPath
(
version
:
String
):
String
{
...
...
buildSrc/src/main/kotlin/tasks.kt
浏览文件 @
95035b3d
...
...
@@ -2,6 +2,7 @@
import
org.gradle.api.*
import
org.gradle.api.internal.tasks.testing.filter.DefaultTestFilter
import
org.gradle.api.plugins.JavaPluginConvention
import
org.gradle.kotlin.dsl.*
import
org.gradle.api.tasks.testing.Test
import
org.gradle.kotlin.dsl.extra
...
...
@@ -33,6 +34,8 @@ fun Project.projectTest(body: Test.() -> Unit = {}): Test = (tasks.findByName("t
systemProperty
(
"idea.is.unit.test"
,
"true"
)
environment
(
"NO_FS_ROOTS_ACCESS_CHECK"
,
"true"
)
environment
(
"KOTLIN_HOME"
,
rootProject
.
extra
[
"distKotlinHomeDir"
])
environment
(
"PROJECT_CLASSES_DIRS"
,
the
<
JavaPluginConvention
>().
sourceSets
.
getByName
(
"test"
).
output
.
classesDirs
.
asPath
)
environment
(
"PROJECT_BUILD_DIR"
,
buildDir
)
systemProperty
(
"jps.kotlin.home"
,
rootProject
.
extra
[
"distKotlinHomeDir"
])
ignoreFailures
=
System
.
getenv
(
"kotlin_build_ignore_test_failures"
)
?.
let
{
it
==
"yes"
}
?:
false
body
()
...
...
compiler/build.gradle.kts
浏览文件 @
95035b3d
...
...
@@ -30,6 +30,7 @@ val testDistProjects = listOf(
":kotlin-test:kotlin-test-junit"
,
":kotlin-test:kotlin-test-js"
,
":kotlin-daemon-client"
,
":kotlin-preloader"
,
":android-extensions-compiler"
,
":kotlin-ant"
)
...
...
compiler/container/build.gradle.kts
浏览文件 @
95035b3d
...
...
@@ -7,6 +7,8 @@ dependencies {
compile
(
project
(
":core:util.runtime"
))
compile
(
commonDep
(
"javax.inject"
))
compile
(
ideaSdkCoreDeps
(
"intellij-core"
))
compileOnly
(
project
(
":kotlin-stdlib"
))
testCompile
(
project
(
":kotlin-stdlib"
))
testCompile
(
projectDist
(
":kotlin-test:kotlin-test-jvm"
))
testCompile
(
projectDist
(
":kotlin-test:kotlin-test-junit"
))
testCompile
(
commonDep
(
"junit:junit"
))
...
...
compiler/tests/org/jetbrains/kotlin/daemon/CompilerDaemonTest.kt
浏览文件 @
95035b3d
...
...
@@ -884,11 +884,15 @@ open class TestKotlinScriptDummyDependenciesResolver : DependenciesResolver {
@ScriptTemplateDefinition
(
resolver
=
TestKotlinScriptDummyDependenciesResolver
::
class
)
abstract
class
ScriptWithNoParam
internal
fun
classpathFromClassloader
():
List
<
File
>
=
(
TestKotlinScriptDummyDependenciesResolver
::
class
.
java
.
classLoader
as
?
URLClassLoader
)
?.
urLs
?.
mapNotNull
(
URL
::
toFile
)
?.
filter
{
it
.
path
.
contains
(
"out"
)
&&
it
.
path
.
contains
(
"test"
)
}
?:
emptyList
()
internal
fun
classpathFromClassloader
():
List
<
File
>
{
val
additionalClasspath
=
System
.
getProperty
(
"kotlin.test.script.classpath"
)
?.
split
(
File
.
pathSeparator
)
?.
map
{
File
(
it
)
}.
orEmpty
()
return
((
TestKotlinScriptDummyDependenciesResolver
::
class
.
java
.
classLoader
as
?
URLClassLoader
)
?.
urLs
?.
mapNotNull
(
URL
::
toFile
)
?.
filter
{
it
.
path
.
contains
(
"out"
)
&&
it
.
path
.
contains
(
"test"
)
}
?:
emptyList
()
)
+
additionalClasspath
}
internal
fun
URL
.
toFile
()
=
try
{
...
...
compiler/tests/org/jetbrains/kotlin/scripts/ScriptTemplateTest.kt
浏览文件 @
95035b3d
...
...
@@ -97,7 +97,7 @@ class ScriptTemplateTest {
Assert
.
assertNull
(
compileScript
(
"fib_ext_ann.kts"
,
ScriptWithIntParamAndDummyResolver
::
class
,
null
,
includeKotlinRuntime
=
false
))
val
messageCollector
=
TestMessageCollector
()
val
aClass
=
compileScript
(
"fib_ext_ann.kts"
,
ScriptWithIntParam
::
class
,
null
,
includeKotlinRuntime
=
false
,
messageCollector
=
messageCollector
)
val
aClass
=
compileScript
(
"fib_ext_ann.kts"
,
ScriptWithIntParam
::
class
,
null
,
messageCollector
=
messageCollector
)
Assert
.
assertNotNull
(
"Compilation failed:\n$messageCollector"
,
aClass
)
val
out
=
captureOut
{
aClass
!!
.
getConstructor
(
Integer
.
TYPE
).
newInstance
(
4
)
...
...
@@ -117,7 +117,7 @@ class ScriptTemplateTest {
}
val
messageCollector
=
TestMessageCollector
()
val
aClass
=
compileScript
(
"fib_ext_ann2.kts"
,
ScriptWithIntParam
::
class
,
null
,
includeKotlinRuntime
=
false
,
messageCollector
=
messageCollector
)
val
aClass
=
compileScript
(
"fib_ext_ann2.kts"
,
ScriptWithIntParam
::
class
,
null
,
messageCollector
=
messageCollector
)
Assert
.
assertNotNull
(
"Compilation failed:\n$messageCollector"
,
aClass
)
val
out
=
captureOut
{
aClass
!!
.
getConstructor
(
Integer
.
TYPE
).
newInstance
(
4
)
...
...
core/util.runtime/build.gradle.kts
浏览文件 @
95035b3d
...
...
@@ -8,7 +8,7 @@ jvmTarget = "1.6"
javaHome
=
rootProject
.
extra
[
"JDK_16"
]
as
String
dependencies
{
compile
(
projectDist
(
":kotlin-stdlib"
))
compile
Only
(
projectDist
(
":kotlin-stdlib"
))
}
sourceSets
{
...
...
idea/idea-gradle/build.gradle.kts
浏览文件 @
95035b3d
...
...
@@ -18,9 +18,28 @@ dependencies {
testCompile
(
projectTests
(
":idea"
))
testCompile
(
project
(
":idea:idea-test-framework"
))
testCompile
(
ideaSdkDeps
(
"openapi"
,
"idea"
,
"groovy-all"
))
testCompile
(
ideaPluginDeps
(
"gradle-wrapper"
,
"gradle-base-services"
,
"gradle-tooling-extension-impl"
,
"gradle-tooling-api"
,
"gradle"
,
plugin
=
"gradle"
))
testCompile
(
ideaPluginDeps
(
"Groovy"
,
plugin
=
"Groovy"
))
testCompile
(
ideaSdkDeps
(
"groovy-all"
))
testRuntime
(
project
(
":idea:idea-jvm"
))
testRuntime
(
project
(
":idea:idea-android"
))
testRuntime
(
project
(
":plugins:android-extensions-idea"
))
testRuntime
(
project
(
":plugins:lint"
))
testRuntime
(
project
(
":sam-with-receiver-ide-plugin"
))
testRuntime
(
project
(
":allopen-ide-plugin"
))
testRuntime
(
project
(
":noarg-ide-plugin"
))
testRuntime
(
ideaSdkDeps
(
"*.jar"
))
testRuntime
(
ideaPluginDeps
(
"*.jar"
,
plugin
=
"junit"
))
testRuntime
(
ideaPluginDeps
(
"jcommander"
,
"resources_en"
,
plugin
=
"testng"
))
testRuntime
(
ideaPluginDeps
(
"resources_en"
,
plugin
=
"properties"
))
testRuntime
(
ideaPluginDeps
(
"*.jar"
,
plugin
=
"gradle"
))
testRuntime
(
ideaPluginDeps
(
"*.jar"
,
plugin
=
"Groovy"
))
testRuntime
(
ideaPluginDeps
(
"jacocoant"
,
plugin
=
"coverage"
))
testRuntime
(
ideaPluginDeps
(
"*.jar"
,
plugin
=
"maven"
))
testRuntime
(
ideaPluginDeps
(
"*.jar"
,
plugin
=
"android"
))
}
sourceSets
{
...
...
idea/idea-maven/build.gradle.kts
浏览文件 @
95035b3d
...
...
@@ -23,6 +23,13 @@ dependencies {
testCompileOnly
(
ideaSdkDeps
(
"openapi"
,
"idea"
,
"gson"
))
testCompileOnly
(
ideaPluginDeps
(
"maven"
,
"maven-server-api"
,
plugin
=
"maven"
))
testRuntime
(
project
(
":idea:idea-jvm"
))
testRuntime
(
project
(
":idea:idea-android"
))
testRuntime
(
project
(
":plugins:android-extensions-idea"
))
testRuntime
(
project
(
":plugins:lint"
))
testRuntime
(
project
(
":sam-with-receiver-ide-plugin"
))
testRuntime
(
project
(
":allopen-ide-plugin"
))
testRuntime
(
project
(
":noarg-ide-plugin"
))
testRuntime
(
ideaSdkDeps
(
"*.jar"
))
testRuntime
(
ideaPluginDeps
(
"resources_en"
,
plugin
=
"junit"
))
testRuntime
(
ideaPluginDeps
(
"jcommander"
,
"resources_en"
,
plugin
=
"testng"
))
...
...
j2k/build.gradle.kts
浏览文件 @
95035b3d
...
...
@@ -18,6 +18,7 @@ dependencies {
testCompile
(
projectDist
(
":kotlin-test:kotlin-test-junit"
))
testCompile
(
commonDep
(
"junit:junit"
))
testCompile
(
project
(
":compiler.tests-common"
))
testRuntime
(
project
(
":idea:idea-jvm"
))
testRuntime
(
project
(
":idea:idea-android"
))
testRuntime
(
project
(
":plugins:android-extensions-idea"
))
testRuntime
(
project
(
":sam-with-receiver-ide-plugin"
))
...
...
libraries/stdlib/js/build.gradle
浏览文件 @
95035b3d
...
...
@@ -19,9 +19,12 @@ def jsSrcDir = "${jsLibrariesDir}/src"
def
jsTestSrcDir
=
"${jsLibrariesDir}/test"
def
jsSrcJsDir
=
"${jsSrcDir}/js"
def
jsOutputFile
=
"${buildDir}/classes/kotlin.js"
def
jsTestOutputFile
=
"${buildDir}/classes/test/kotlin-stdlib-js_test.js"
def
kotlinTestJsOutputFile
=
"${project(':kotlin-test:kotlin-test-js').buildDir}/classes/main/kotlin-test.js"
def
kotlinTestJsTestOutputFile
=
"${project(':kotlin-test:kotlin-test-js').buildDir}/classes/test/kotlin-test-js_test.js"
// TODO: take from sourcesets' outputs
def
jsTestOutputFile
=
"${buildDir}/classes/kotlin/test/kotlin-stdlib-js_test.js"
def
kotlinTestJsTestOutputFile
=
"${project(':kotlin-test:kotlin-test-js').buildDir}/classes/kotlin/test/kotlin-test-js_test.js"
sourceSets
{
...
...
libraries/tools/binary-compatibility-validator/build.gradle
浏览文件 @
95035b3d
...
...
@@ -40,4 +40,10 @@ test {
systemProperty
'overwrite.output'
,
System
.
getProperty
(
"overwrite.output"
,
"false"
)
systemProperty
'kotlinVersion'
,
project
.
version
jvmArgs
'-ea'
ignoreFailures
=
System
.
getenv
(
"kotlin_build_ignore_test_failures"
)
==
'yes'
environment
(
"PROJECT_CLASSES_DIRS"
,
sourceSets
.
test
.
output
.
classesDirs
.
asPath
)
environment
(
"PROJECT_BUILD_DIR"
,
buildDir
)
workingDir
=
projectDir
}
\ No newline at end of file
libraries/tools/binary-compatibility-validator/src/test/kotlin/org.jetbrains.kotlin.tools.tests/CasesPublicAPITest.kt
浏览文件 @
95035b3d
...
...
@@ -8,8 +8,13 @@ import java.io.File
class
CasesPublicAPITest
{
companion
object
{
val
visibilities
by
lazy
{
readKotlinVisibilities
(
File
(
"build/cases-declarations.json"
))
}
val
baseClassPath
=
File
(
"build/classes/test/cases"
).
absoluteFile
val
visibilities
by
lazy
{
readKotlinVisibilities
(
File
(
System
.
getenv
(
"PROJECT_BUILD_DIR"
)
?:
"build"
,
"cases-declarations.json"
))
}
val
baseClassPaths
:
List
<
File
>
=
(
System
.
getenv
(
"PROJECT_CLASSES_DIRS"
)
?.
let
{
it
.
split
(
File
.
pathSeparator
)
}
?:
listOf
(
"build/classes/kotlin/test/cases"
,
"build/classes/java/test/cases"
))
.
mapNotNull
{
File
(
it
,
"cases"
).
canonicalFile
.
takeIf
{
it
.
isDirectory
}
}
.
takeIf
{
it
.
isNotEmpty
()
}
?:
throw
IllegalStateException
(
"Unable to get classes output dirs, set PROJECT_CLASSES_DIRS environment variable"
)
val
baseOutputPath
=
File
(
"src/test/kotlin/cases"
)
}
...
...
@@ -42,8 +47,8 @@ class CasesPublicAPITest {
private
fun
snapshotAPIAndCompare
(
testClassRelativePath
:
String
)
{
val
testClassPath
=
baseClassPath
.
resolve
(
testClassRelativePath
)
val
testClasses
=
testClassPath
.
listFiles
()
?:
throw
IllegalStateException
(
"Cannot list files in $testClassPath"
)
val
testClassPath
s
=
baseClassPaths
.
map
{
it
.
resolve
(
testClassRelativePath
)
}
val
testClasses
=
testClassPath
s
.
flatMap
{
it
.
listFiles
()
?.
asIterable
()
?:
emptyList
()
}
val
testClassStreams
=
testClasses
.
asSequence
().
filter
{
it
.
name
.
endsWith
(
".class"
)
}.
map
{
it
.
inputStream
()
}
val
api
=
getBinaryAPI
(
testClassStreams
,
visibilities
).
filterOutNonPublic
()
...
...
plugins/android-extensions/android-extensions-idea/build.gradle.kts
浏览文件 @
95035b3d
...
...
@@ -20,6 +20,7 @@ dependencies {
testCompile
(
projectTests
(
":idea:idea-android"
))
testCompile
(
projectDist
(
":kotlin-test:kotlin-test-jvm"
))
testCompile
(
commonDep
(
"junit:junit"
))
testRuntime
(
project
(
":idea:idea-jvm"
))
testRuntime
(
project
(
":plugins:android-extensions-jps"
))
testRuntime
(
project
(
":sam-with-receiver-ide-plugin"
))
testRuntime
(
project
(
":noarg-ide-plugin"
))
...
...
prepare/compiler/build.gradle.kts
浏览文件 @
95035b3d
...
...
@@ -75,6 +75,7 @@ dependencies {
fatJarContents
(
ideaSdkDeps
(
"jna-platform"
))
fatJarContents
(
commonDep
(
"javax.inject"
))
fatJarContents
(
commonDep
(
"org.jline"
,
"jline"
))
fatJarContents
(
commonDep
(
"org.fusesource.jansi"
,
"jansi"
))
fatJarContents
(
protobufFull
())
fatJarContents
(
commonDep
(
"com.github.spullara.cli-parser"
,
"cli-parser"
))
fatJarContents
(
commonDep
(
"com.google.code.findbugs"
,
"jsr305"
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录