Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
b6c892b7
Commit
b6c892b7
authored
7 years ago
by
Dmitry Trofimov
Browse files
Options
Download
Email Patches
Plain Diff
More paths fixes
parent
785ee6b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
python/tools/src/com/jetbrains/python/tools/BuildStubsForSdk.kt
+1
-1
.../tools/src/com/jetbrains/python/tools/BuildStubsForSdk.kt
tools/index-tools/src/org/jetbrains/index/stubs/StubsGenerator.kt
+7
-7
...dex-tools/src/org/jetbrains/index/stubs/StubsGenerator.kt
with
8 additions
and
8 deletions
+8
-8
python/tools/src/com/jetbrains/python/tools/BuildStubsForSdk.kt
+
1
-
1
View file @
b6c892b7
...
...
@@ -47,7 +47,7 @@ fun main(args: Array<String>) {
if
(
System
.
getenv
().
containsKey
(
MERGE_STUBS_FROM_PATHS
))
{
mergeStubs
(
System
.
getenv
(
MERGE_STUBS_FROM_PATHS
).
split
(
File
.
pathSeparatorChar
),
"$baseDir
/$
stubsFileName
"
,
mergeStubs
(
System
.
getenv
(
MERGE_STUBS_FROM_PATHS
).
split
(
File
.
pathSeparatorChar
),
"$baseDir
"
,
stubsFileName
,
"${PathManager.getHomePath()}/python/testData/empty"
,
stubsVersion
)
}
else
{
...
...
This diff is collapsed.
Click to expand it.
tools/index-tools/src/org/jetbrains/index/stubs/StubsGenerator.kt
+
7
-
7
View file @
b6c892b7
...
...
@@ -125,7 +125,7 @@ fun writeStubsVersionFile(stubsStorageFilePath: String, stubsVersion: String) {
FileUtil
.
writeToFile
(
File
(
stubsStorageFilePath
+
".version"
),
stubsVersion
)
}
fun
mergeStubs
(
paths
:
List
<
String
>,
stubsFilePath
:
String
,
projectPath
:
String
,
stubsVersion
:
String
)
{
fun
mergeStubs
(
paths
:
List
<
String
>,
stubsFilePath
:
String
,
stubsFileName
:
String
,
projectPath
:
String
,
stubsVersion
:
String
)
{
val
app
=
IdeaTestApplication
.
getInstance
()
val
project
=
ProjectManager
.
getInstance
().
loadAndOpenProject
(
projectPath
)
!!
// we don't need a project here, but I didn't find a better way to wait until indexes and components are initialized
...
...
@@ -133,7 +133,7 @@ fun mergeStubs(paths: List<String>, stubsFilePath: String, projectPath: String,
try
{
val
stubExternalizer
=
StubTreeExternalizer
()
val
storageFile
=
File
(
stubsFilePath
+
".input"
)
val
storageFile
=
File
(
stubsFilePath
,
stubsFileName
+
".input"
)
if
(
storageFile
.
exists
())
{
storageFile
.
delete
()
}
...
...
@@ -141,7 +141,7 @@ fun mergeStubs(paths: List<String>, stubsFilePath: String, projectPath: String,
val
storage
=
PersistentHashMap
<
HashCode
,
SerializedStubTree
>(
storageFile
,
HashCodeDescriptor
.
instance
,
stubExternalizer
)
val
stringEnumeratorFile
=
File
(
stubsFilePath
+
".names"
)
val
stringEnumeratorFile
=
File
(
stubsFilePath
,
stubsFileName
+
".names"
)
if
(
stringEnumeratorFile
.
exists
())
{
stringEnumeratorFile
.
delete
()
}
...
...
@@ -150,16 +150,16 @@ fun mergeStubs(paths: List<String>, stubsFilePath: String, projectPath: String,
val
map
=
HashMap
<
HashCode
,
Int
>()
println
(
"Writing results to $st
ubsFil
ePath"
)
println
(
"Writing results to $
{
st
orageFile.absolut
ePath
}
"
)
for
(
path
in
paths
)
{
println
(
"Reading stubs from $path"
)
var
count
=
0
val
fromStorageFile
=
File
(
path
+
".input"
)
val
fromStorageFile
=
File
(
path
,
stubsFileName
+
".input"
)
val
fromStorage
=
PersistentHashMap
<
HashCode
,
SerializedStubTree
>(
fromStorageFile
,
HashCodeDescriptor
.
instance
,
stubExternalizer
)
val
serializationManager
=
SerializationManagerImpl
(
File
(
stubsFile
Path
+
".names"
))
val
serializationManager
=
SerializationManagerImpl
(
File
(
path
,
stubsFile
Name
+
".names"
))
try
{
fromStorage
.
processKeysWithExistingMapping
(
...
...
@@ -213,7 +213,7 @@ fun mergeStubs(paths: List<String>, stubsFilePath: String, projectPath: String,
println
(
"Total items in storage: $total"
)
writeStubsVersionFile
(
st
ubsFilePath
,
stubsVersion
)
writeStubsVersionFile
(
st
ringEnumeratorFile
.
nameWithoutExtension
,
stubsVersion
)
for
(
i
in
2
..
paths
.
size
)
{
val
count
=
map
.
entries
.
stream
().
filter
({
e
->
e
.
value
==
i
}).
count
()
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment