extract util methods that implemented in Kotlin from `projectModel-api` module to...
authorVladimir Krivosheev <vladimir.krivosheev@jetbrains.com>
Fri, 10 May 2019 10:56:07 +0000 (12:56 +0200)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Fri, 10 May 2019 13:08:56 +0000 (16:08 +0300)
* These methods implemented in Kotlin because because of using kotlin-only features or because Kotlin is a more suitable language. So, cannot be reimplemented in Java and moved to existing `util` module (this module is already bloated, but it is another topic).
* There are modules that depends only `util-ex`, but on on `projectModel-api`.

GitOrigin-RevId: c959763fb5b07abaf783ea4b1991b713bb3a1ad8

47 files changed:
.idea/modules.xml
java/java-analysis-api/intellij.java.analysis.iml
platform/analysis-api/intellij.platform.analysis.iml
platform/build-scripts/groovy/org/jetbrains/intellij/build/CommunityRepositoryModules.groovy
platform/built-in-server-api/intellij.platform.builtInServer.iml
platform/configuration-store-impl/intellij.platform.configurationStore.impl.iml
platform/configuration-store-impl/src/ExternalStorageConfigurationManagerImpl.kt [moved from platform/projectModel-api/src/com/intellij/openapi/project/ExternalStorageConfigurationManagerImpl.kt with 79% similarity]
platform/editor-ui-api/intellij.platform.editor.iml
platform/lang-api/intellij.platform.lang.iml
platform/object-serializer/intellij.platform.objectSerializer.iml
platform/object-serializer/intellij.platform.objectSerializer.tests.iml
platform/object-serializer/src/BaseState.kt [moved from platform/projectModel-api/src/com/intellij/openapi/components/BaseState.kt with 100% similarity]
platform/object-serializer/src/StoredPropertyBase.kt [moved from platform/projectModel-api/src/com/intellij/openapi/components/StoredPropertyBase.kt with 94% similarity]
platform/object-serializer/src/configurationStore/properties/CollectionStoredProperty.kt [moved from platform/projectModel-api/src/com/intellij/configurationStore/properties/CollectionStoredProperty.kt with 100% similarity]
platform/object-serializer/src/configurationStore/properties/FloatStoredProperty.kt [moved from platform/projectModel-api/src/com/intellij/configurationStore/properties/FloatStoredProperty.kt with 97% similarity]
platform/object-serializer/src/configurationStore/properties/IntStoredProperty.kt [moved from platform/projectModel-api/src/com/intellij/configurationStore/properties/IntStoredProperty.kt with 97% similarity]
platform/object-serializer/src/configurationStore/properties/LongStoredProperty.kt [moved from platform/projectModel-api/src/com/intellij/configurationStore/properties/LongStoredProperty.kt with 97% similarity]
platform/object-serializer/src/configurationStore/properties/MapStoredProperty.kt [moved from platform/projectModel-api/src/com/intellij/configurationStore/properties/MapStoredProperty.kt with 100% similarity]
platform/object-serializer/src/configurationStore/properties/ObjectStoredProperty.kt [moved from platform/projectModel-api/src/com/intellij/configurationStore/properties/ObjectStoredProperty.kt with 98% similarity]
platform/object-serializer/src/configurationStore/properties/StringStoredProperty.kt [moved from platform/projectModel-api/src/com/intellij/configurationStore/properties/StringStoredProperty.kt with 95% similarity]
platform/object-serializer/src/xml/KotlinAwareBeanBinding.kt [moved from platform/projectModel-api/src/com/intellij/configurationStore/KotlinAwareBeanBinding.kt with 98% similarity]
platform/object-serializer/src/xml/xmlSerializer.kt [moved from platform/projectModel-api/src/com/intellij/configurationStore/xmlSerializer.kt with 100% similarity]
platform/platform-api/intellij.platform.ide.iml
platform/projectModel-api/intellij.platform.projectModel.iml
platform/projectModel-api/src/com/intellij/openapi/application/pathManagerEx.kt [deleted file]
platform/projectModel-impl/intellij.platform.projectModel.impl.iml
platform/util-ex/intellij.platform.util.ex.iml [new file with mode: 0644]
platform/util-ex/src/com/intellij/application/Topics.kt [moved from platform/projectModel-api/src/com/intellij/application/Topics.kt with 92% similarity]
platform/util-ex/src/com/intellij/openapi/application/actions.kt [moved from platform/projectModel-api/src/com/intellij/openapi/application/actions.kt with 100% similarity]
platform/util-ex/src/com/intellij/openapi/application/pathManagerEx.kt [new file with mode: 0644]
platform/util-ex/src/com/intellij/openapi/command/actions.kt [moved from platform/projectModel-api/src/com/intellij/openapi/command/actions.kt with 100% similarity]
platform/util-ex/src/com/intellij/openapi/diagnostic/logger.kt [moved from platform/projectModel-api/src/com/intellij/openapi/diagnostic/logger.kt with 100% similarity]
platform/util-ex/src/com/intellij/util/KtUtils.kt [moved from platform/projectModel-api/src/com/intellij/util/KtUtils.kt with 100% similarity]
platform/util-ex/src/com/intellij/util/RecursionPreventingSafePublicationLazy.kt [moved from platform/projectModel-api/src/com/intellij/util/RecursionPreventingSafePublicationLazy.kt with 100% similarity]
platform/util-ex/src/com/intellij/util/concurrency/SynchronizedClearableLazy.kt [moved from platform/platform-impl/src/com/intellij/util/concurrency/SynchronizedClearableLazy.kt with 94% similarity]
platform/util-ex/src/com/intellij/util/containers/LookbackSequence.kt [moved from platform/projectModel-api/src/com/intellij/util/containers/LookbackSequence.kt with 100% similarity]
platform/util-ex/src/com/intellij/util/containers/util.kt [moved from platform/projectModel-api/src/com/intellij/util/containers/util.kt with 98% similarity]
platform/util-ex/src/com/intellij/util/io/DigestUtil.kt [moved from platform/projectModel-impl/src/com/intellij/util/io/DigestUtil.kt with 78% similarity]
platform/util-ex/src/com/intellij/util/io/io.kt [moved from platform/projectModel-api/src/com/intellij/util/io/io.kt with 100% similarity]
platform/util-ex/src/com/intellij/util/io/path.kt [moved from platform/projectModel-api/src/com/intellij/util/io/path.kt with 100% similarity]
platform/util-ex/src/com/intellij/util/jdom.kt [moved from platform/projectModel-api/src/com/intellij/util/jdom.kt with 100% similarity]
platform/util-ex/src/com/intellij/util/lazy.kt [moved from platform/projectModel-api/src/com/intellij/util/lazy.kt with 100% similarity]
platform/util-ex/src/org/jetbrains/concurrency/AsyncPromise.kt [moved from platform/projectModel-api/src/org/jetbrains/concurrency/AsyncPromise.kt with 98% similarity]
platform/util-ex/src/org/jetbrains/concurrency/AsyncValueLoader.java [moved from platform/platform-impl/src/org/jetbrains/concurrency/AsyncValueLoader.java with 98% similarity]
platform/util-ex/src/org/jetbrains/concurrency/PromiseManager.java [moved from platform/platform-impl/src/org/jetbrains/concurrency/PromiseManager.java with 98% similarity]
platform/util-ex/src/org/jetbrains/concurrency/promise-coroutines.kt [moved from platform/platform-impl/src/org/jetbrains/concurrency/promise-coroutines.kt with 97% similarity]
platform/util-ex/src/org/jetbrains/concurrency/promise.kt [moved from platform/projectModel-api/src/org/jetbrains/concurrency/promise.kt with 100% similarity]

index f92ad7d7b2104c9631082acb2c393770c02f15e3..4028c51c5440baa6a6c6acafc078d6e2de6fc7f0 100644 (file)
       <module fileurl="file://$PROJECT_DIR$/platform/usageView/intellij.platform.usageView.iml" filepath="$PROJECT_DIR$/platform/usageView/intellij.platform.usageView.iml" />
       <module fileurl="file://$PROJECT_DIR$/platform/util/intellij.platform.util.iml" filepath="$PROJECT_DIR$/platform/util/intellij.platform.util.iml" />
       <module fileurl="file://$PROJECT_DIR$/platform/util-class-loader/intellij.platform.util.classLoader.iml" filepath="$PROJECT_DIR$/platform/util-class-loader/intellij.platform.util.classLoader.iml" />
+      <module fileurl="file://$PROJECT_DIR$/platform/util-ex/intellij.platform.util.ex.iml" filepath="$PROJECT_DIR$/platform/util-ex/intellij.platform.util.ex.iml" />
       <module fileurl="file://$PROJECT_DIR$/platform/util-rt/intellij.platform.util.rt.iml" filepath="$PROJECT_DIR$/platform/util-rt/intellij.platform.util.rt.iml" />
       <module fileurl="file://$PROJECT_DIR$/platform/util/testSrc/intellij.platform.util.tests.iml" filepath="$PROJECT_DIR$/platform/util/testSrc/intellij.platform.util.tests.iml" />
       <module fileurl="file://$PROJECT_DIR$/platform/vcs-api/intellij.platform.vcs.iml" filepath="$PROJECT_DIR$/platform/vcs-api/intellij.platform.vcs.iml" />
index b7dc59075776ec46e30c74196fa6af2ec0fe6ea1..5333316574df930faaba18db5bbb41819bbe779c 100644 (file)
@@ -12,5 +12,6 @@
     <orderEntry type="module" module-name="intellij.platform.projectModel" />
     <orderEntry type="library" name="kotlin-stdlib-jdk8" level="project" />
     <orderEntry type="module" module-name="intellij.platform.uast" exported="" />
+    <orderEntry type="module" module-name="intellij.platform.objectSerializer" />
   </component>
 </module>
\ No newline at end of file
index 9b95ecc7e01083a4f3cd94c837ef59f47c03ed15..f728ea2a11f23e7328a445700e78b6828deeced7 100644 (file)
@@ -13,5 +13,6 @@
     <orderEntry type="module" module-name="intellij.platform.core" />
     <orderEntry type="module" module-name="intellij.platform.projectModel" />
     <orderEntry type="module" module-name="intellij.platform.editor" exported="" />
+    <orderEntry type="module" module-name="intellij.platform.objectSerializer" />
   </component>
 </module>
\ No newline at end of file
index 793abd8b677032b0af6a52748023effd0b92dafe..506f92775ed76999cff6ffdf581b85bfa0a72c18 100644 (file)
@@ -53,6 +53,7 @@ class CommunityRepositoryModules {
     "intellij.platform.analysis.impl",
     "intellij.platform.builtInServer.impl",
     "intellij.platform.core.impl",
+    "intellij.platform.util.ex",
     "intellij.platform.credentialStore",
     "intellij.platform.diff.impl",
     "intellij.platform.vcs.dvcs.impl",
index bca0b699b6eefdc57fc68ada9bec802714332c4b..54adeba5998b7b021dc39f39d45095f401248fcb 100644 (file)
@@ -12,5 +12,6 @@
     <orderEntry type="library" name="kotlin-stdlib-jdk8" level="project" />
     <orderEntry type="module" module-name="intellij.platform.ide" />
     <orderEntry type="library" name="netty-codec-http" level="project" />
+    <orderEntry type="module" module-name="intellij.platform.util.ex" />
   </component>
 </module>
\ No newline at end of file
index 48847932a60fb763d2338a14b93e8c05aaa1ed99..85f7b04fa5b833f526f393c26ad4567dc7da70c5 100644 (file)
@@ -23,5 +23,6 @@
     <orderEntry type="library" name="lz4-java" level="project" />
     <orderEntry type="library" scope="TEST" name="kotlin-test" level="project" />
     <orderEntry type="library" name="kotlinx-coroutines-jdk8" level="project" />
+    <orderEntry type="module" module-name="intellij.platform.objectSerializer" />
   </component>
 </module>
\ No newline at end of file
similarity index 79%
rename from platform/projectModel-api/src/com/intellij/openapi/project/ExternalStorageConfigurationManagerImpl.kt
rename to platform/configuration-store-impl/src/ExternalStorageConfigurationManagerImpl.kt
index 44fe9ea253d0859143cc6ce95f7f40fe242afee4..9f8307f70a919d126ca90a4fc0eebd0fb72b0b7b 100644 (file)
@@ -1,9 +1,8 @@
-// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 package com.intellij.openapi.project
 
 import com.intellij.openapi.components.BaseState
 import com.intellij.openapi.components.PersistentStateComponent
-import com.intellij.openapi.components.ServiceManager
 import com.intellij.openapi.components.State
 import com.intellij.openapi.util.ModificationTracker
 import com.intellij.util.xmlb.annotations.Property
@@ -14,7 +13,7 @@ class ExternalStorageConfiguration : BaseState() {
 }
 
 @State(name = "ExternalStorageConfigurationManager")
-class ExternalStorageConfigurationManagerImpl : PersistentStateComponent<ExternalStorageConfiguration>, ModificationTracker, ExternalStorageConfigurationManager {
+internal class ExternalStorageConfigurationManagerImpl : PersistentStateComponent<ExternalStorageConfiguration>, ModificationTracker, ExternalStorageConfigurationManager {
   private var state = ExternalStorageConfiguration()
 
   override fun getModificationCount(): Long = state.modificationCount
index 5bb6f034c8a66e3ae10fa1f5a89694c9ec2c0034..beee41826df69897c9d36b3810aa1d1569356446 100644 (file)
@@ -15,5 +15,7 @@
     <orderEntry type="library" name="kotlin-stdlib-jdk8" level="project" />
     <orderEntry type="library" name="JDOM" level="project" />
     <orderEntry type="library" name="jetbrains-annotations" level="project" />
+    <orderEntry type="module" module-name="intellij.platform.objectSerializer" />
+    <orderEntry type="module" module-name="intellij.platform.util.ex" />
   </component>
 </module>
\ No newline at end of file
index b9bd977487b5e6cf12df2f9c25ae518279fe1d78..d3f6c50a065eb7243e3fdb1ae31788bef9c8eacf 100644 (file)
@@ -18,5 +18,7 @@
     <orderEntry type="library" scope="TEST" name="Mocks" level="project" />
     <orderEntry type="library" scope="TEST" name="JUnit4" level="project" />
     <orderEntry type="library" scope="TEST" name="hamcrest" level="project" />
+    <orderEntry type="module" module-name="intellij.platform.util.ex" />
+    <orderEntry type="module" module-name="intellij.platform.objectSerializer" exported="" />
   </component>
 </module>
\ No newline at end of file
index b460216a98bc0546535da4a11ee27e812684872a..e438f77905905389b2619c09806111a33a9b2604 100644 (file)
@@ -2,8 +2,9 @@
 <module type="JAVA_MODULE" version="4">
   <component name="NewModuleRootManager" inherit-compiler-output="true">
     <exclude-output />
-    <content url="file://$MODULE_DIR$/src">
+    <content url="file://$MODULE_DIR$">
       <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+      <excludeFolder url="file://$MODULE_DIR$/testSnapshots" />
     </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
@@ -11,5 +12,9 @@
     <orderEntry type="library" name="ion" level="project" />
     <orderEntry type="module" module-name="intellij.platform.util" />
     <orderEntry type="library" name="kotlin-reflect" level="project" />
+    <orderEntry type="library" name="JDOM" level="project" />
+    <orderEntry type="module" module-name="intellij.platform.util.ex" />
+    <orderEntry type="module" module-name="intellij.platform.core" />
+    <orderEntry type="module" module-name="intellij.platform.projectModel" />
   </component>
 </module>
\ No newline at end of file
index 6c6eebddca4ac66610f849d3aed48dc4651dfddd..7f89d6a42ad69bfa1d96e30e4c5066bf950dde36 100644 (file)
@@ -2,9 +2,6 @@
 <module type="JAVA_MODULE" version="4">
   <component name="NewModuleRootManager" inherit-compiler-output="true">
     <exclude-output />
-    <content url="file://$MODULE_DIR$/testSnapshots">
-      <excludeFolder url="file://$MODULE_DIR$/testSnapshots" />
-    </content>
     <content url="file://$MODULE_DIR$/testSrc">
       <sourceFolder url="file://$MODULE_DIR$/testSrc" isTestSource="true" packagePrefix="com.intellij.util.serialization" />
     </content>
similarity index 94%
rename from platform/projectModel-api/src/com/intellij/openapi/components/StoredPropertyBase.kt
rename to platform/object-serializer/src/StoredPropertyBase.kt
index 7a9b55d68dd961444123182116598c7825cebb27..a0df8d3e2a55889d46605577f9cafaadcb84b4dc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 package com.intellij.openapi.components
 
 import org.jetbrains.annotations.ApiStatus
similarity index 97%
rename from platform/projectModel-api/src/com/intellij/configurationStore/properties/FloatStoredProperty.kt
rename to platform/object-serializer/src/configurationStore/properties/FloatStoredProperty.kt
index 117fd902ba56a982b0a249f1c0a8284d13ed6b4b..ce5e10568146822cbb565904a8b3d304e126c11f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 package com.intellij.configurationStore.properties
 
 import com.intellij.openapi.components.*
similarity index 97%
rename from platform/projectModel-api/src/com/intellij/configurationStore/properties/IntStoredProperty.kt
rename to platform/object-serializer/src/configurationStore/properties/IntStoredProperty.kt
index 8c8c9e85503a372274508bbbb2e873d20daaf2a0..028d187d5e807b73288809556cfbea1d7e528bac 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 package com.intellij.configurationStore.properties
 
 import com.intellij.openapi.components.*
similarity index 97%
rename from platform/projectModel-api/src/com/intellij/configurationStore/properties/LongStoredProperty.kt
rename to platform/object-serializer/src/configurationStore/properties/LongStoredProperty.kt
index 2ef03c5614fd589a15e61607a15e0a5021bb27fb..0c75e1875a27a80140620a4e056dc1546ad6bf7a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 package com.intellij.configurationStore.properties
 
 import com.intellij.openapi.components.*
similarity index 98%
rename from platform/projectModel-api/src/com/intellij/configurationStore/properties/ObjectStoredProperty.kt
rename to platform/object-serializer/src/configurationStore/properties/ObjectStoredProperty.kt
index f7222d35dfd6f74836cf7dd416f84c8fc7c09e39..0e025650bbec699ac9f78f2c22349859b4ce9ae4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 package com.intellij.configurationStore.properties
 
 import com.intellij.openapi.components.*
similarity index 95%
rename from platform/projectModel-api/src/com/intellij/configurationStore/properties/StringStoredProperty.kt
rename to platform/object-serializer/src/configurationStore/properties/StringStoredProperty.kt
index 5934091eb585e4f9332e6eb7671f23aeb00c43f1..1f5db07ec6b4da32e8d6539b29290cbe73e108bf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 package com.intellij.configurationStore.properties
 
 import com.intellij.openapi.components.*
similarity index 98%
rename from platform/projectModel-api/src/com/intellij/configurationStore/KotlinAwareBeanBinding.kt
rename to platform/object-serializer/src/xml/KotlinAwareBeanBinding.kt
index 42857a81c067e7d8088d7365016c8f4db21423e6..550e2106e7013c3da93c6acb86b44259edf7825f 100644 (file)
@@ -1,4 +1,5 @@
 // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+@file:Suppress("PackageDirectoryMismatch")
 package com.intellij.configurationStore
 
 import com.intellij.openapi.components.BaseState
index b9f3822ae2ac68dfa2deb01ee7bda092258721c3..f05a50271f357fa3f3a290b3c25dc3b3c7faf45d 100644 (file)
@@ -38,5 +38,7 @@
     <orderEntry type="library" exported="" name="rd-swing" level="project" />
     <orderEntry type="library" exported="" name="rd-core" level="project" />
     <orderEntry type="library" scope="RUNTIME" name="netty-handler-proxy" level="project" />
+    <orderEntry type="module" module-name="intellij.platform.util.ex" exported="" />
+    <orderEntry type="module" module-name="intellij.platform.objectSerializer" />
   </component>
 </module>
\ No newline at end of file
index 727d6e0718e6cae8ffe8d6b798345a28aeb1d6b1..eb8f23887c086cd96365086f7aaf2983b13f1526 100644 (file)
@@ -10,8 +10,6 @@
     <orderEntry type="module" module-name="intellij.platform.core" exported="" />
     <orderEntry type="module" module-name="intellij.platform.jps.model" exported="" />
     <orderEntry type="library" name="kotlin-stdlib-jdk8" level="project" />
-    <orderEntry type="library" name="kotlin-reflect" level="project" />
     <orderEntry type="library" name="JDOM" level="project" />
-    <orderEntry type="module" module-name="intellij.platform.objectSerializer" />
   </component>
 </module>
\ No newline at end of file
diff --git a/platform/projectModel-api/src/com/intellij/openapi/application/pathManagerEx.kt b/platform/projectModel-api/src/com/intellij/openapi/application/pathManagerEx.kt
deleted file mode 100644 (file)
index 149bfdc..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2000-2017 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-@file:JvmName("PathManagerEx")
-package com.intellij.openapi.application
-
-import com.intellij.openapi.diagnostic.Logger
-import java.io.IOException
-import java.nio.file.Path
-import java.nio.file.Paths
-
-private val LOG = Logger.getInstance("#com.intellij.openapi.application.PathManagerEx")
-
-/**
- * Absolute canonical path to system cache dir.
- */
-val appSystemDir: Path by lazy {
-  val path = Paths.get(PathManager.getSystemPath())
-  try {
-    return@lazy path.toRealPath()
-  }
-  catch (e: IOException) {
-    LOG.warn(e)
-  }
-  path
-}
index 7a45f76095df53374d89788deeb1cff9aa69cb6b..efaafcc48a73ece4b0d5d27a8a2a2e4896d5ee1b 100644 (file)
@@ -14,5 +14,7 @@
     <orderEntry type="module" module-name="intellij.platform.jps.model.serialization" exported="" />
     <orderEntry type="library" name="kotlin-stdlib-jdk8" level="project" />
     <orderEntry type="library" name="kotlinx-coroutines-jdk8" level="project" />
+    <orderEntry type="module" module-name="intellij.platform.objectSerializer" exported="" />
+    <orderEntry type="module" module-name="intellij.platform.util.ex" exported="" />
   </component>
 </module>
\ No newline at end of file
diff --git a/platform/util-ex/intellij.platform.util.ex.iml b/platform/util-ex/intellij.platform.util.ex.iml
new file mode 100644 (file)
index 0000000..37c15c9
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" name="kotlin-stdlib-jdk8" level="project" />
+    <orderEntry type="library" name="kotlin-reflect" level="project" />
+    <orderEntry type="module" module-name="intellij.platform.util" />
+    <orderEntry type="module" module-name="intellij.platform.core" />
+    <orderEntry type="library" name="JDOM" level="project" />
+    <orderEntry type="library" name="kotlinx-coroutines-jdk8" level="project" />
+  </component>
+</module>
\ No newline at end of file
similarity index 92%
rename from platform/projectModel-api/src/com/intellij/application/Topics.kt
rename to platform/util-ex/src/com/intellij/application/Topics.kt
index 8d2868d98580c4f25b5e6ff34e3cac7ae8b49b82..924896da2139457bb8cd3a9304bbfedd4c068a43 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 @file:JvmName("Topics")
 package com.intellij.application
 
diff --git a/platform/util-ex/src/com/intellij/openapi/application/pathManagerEx.kt b/platform/util-ex/src/com/intellij/openapi/application/pathManagerEx.kt
new file mode 100644 (file)
index 0000000..64ef17c
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+@file:JvmName("PathManagerEx")
+package com.intellij.openapi.application
+
+import com.intellij.openapi.diagnostic.Logger
+import java.io.IOException
+import java.nio.file.Path
+import java.nio.file.Paths
+
+private val LOG = Logger.getInstance("#com.intellij.openapi.application.PathManagerEx")
+
+/**
+ * Absolute canonical path to system cache dir.
+ */
+val appSystemDir: Path by lazy {
+  val path = Paths.get(PathManager.getSystemPath())
+  try {
+    return@lazy path.toRealPath()
+  }
+  catch (e: IOException) {
+    LOG.warn(e)
+  }
+  path
+}
similarity index 94%
rename from platform/platform-impl/src/com/intellij/util/concurrency/SynchronizedClearableLazy.kt
rename to platform/util-ex/src/com/intellij/util/concurrency/SynchronizedClearableLazy.kt
index dece53941d578c046e94afdef29ed24e75d4d49a..e47fefcfbe8582c5fd1b0d102af09f0cb66e6683 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 
 package com.intellij.util.concurrency
 
similarity index 98%
rename from platform/projectModel-api/src/com/intellij/util/containers/util.kt
rename to platform/util-ex/src/com/intellij/util/containers/util.kt
index 0bd0dbf107e22a880bfb37ac4fcbbd75c4ac25d4..241db57efbf2f65cb4054d952c79279ef8f8941d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 package com.intellij.util.containers
 
 import com.intellij.util.SmartList
similarity index 78%
rename from platform/projectModel-impl/src/com/intellij/util/io/DigestUtil.kt
rename to platform/util-ex/src/com/intellij/util/io/DigestUtil.kt
index 9d268aaee4e35d55c1c8dc8653cfd42a316d05c7..bfd8f76bb7e68ab161e0df5187f0cf09dfd260d3 100644 (file)
@@ -16,5 +16,6 @@ object DigestUtil {
   @JvmStatic
   fun sha256() = getMessageDigest("SHA-256")
 
-  private fun getMessageDigest(algorithm: String): MessageDigest = MessageDigest.getInstance(algorithm, sunSecurityProvider)
+  private fun getMessageDigest(algorithm: String): MessageDigest = MessageDigest.getInstance(algorithm,
+                                                                                             sunSecurityProvider)
 }
\ No newline at end of file
similarity index 98%
rename from platform/projectModel-api/src/org/jetbrains/concurrency/AsyncPromise.kt
rename to platform/util-ex/src/org/jetbrains/concurrency/AsyncPromise.kt
index 6cae878095ec67c9f5134704abdf8130eea672f7..044f96189301682bb992382fa60c65fc14dd9847 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 package org.jetbrains.concurrency
 
 import com.intellij.openapi.diagnostic.ControlFlowException
similarity index 98%
rename from platform/platform-impl/src/org/jetbrains/concurrency/AsyncValueLoader.java
rename to platform/util-ex/src/org/jetbrains/concurrency/AsyncValueLoader.java
index 4782efe390ec42ca7e81160f082239419552473f..7ff0d6aa0bf71758f6d481a0ba69b66e6f35a3cc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 package org.jetbrains.concurrency;
 
 import com.intellij.openapi.Disposable;
similarity index 98%
rename from platform/platform-impl/src/org/jetbrains/concurrency/PromiseManager.java
rename to platform/util-ex/src/org/jetbrains/concurrency/PromiseManager.java
index ecc3292189a5ace15fb3cf6a3f1b32c830abab94..5cbfb15046f5bd9e8d0a0fd780642afaec58c320 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 package org.jetbrains.concurrency;
 
 import com.intellij.util.concurrency.AtomicFieldUpdater;
similarity index 97%
rename from platform/platform-impl/src/org/jetbrains/concurrency/promise-coroutines.kt
rename to platform/util-ex/src/org/jetbrains/concurrency/promise-coroutines.kt
index 96d5380fec8af60dd342592430e557bede165a52..f93c4ac2d4648cb6fb331588a3ab7d59a8fbf0f6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 package org.jetbrains.concurrency
 
 import kotlinx.coroutines.CompletableDeferred