Remove Gradle plugin dependency on Apache Commons
We have used `commons-lang` to detect
if current OS is a Windows.
`org.apache.commons.lang.SystemUtils` also
tries to parse JDK version in `clinit` and,
as of AC version 2.4, fails on JDK 9.
I preferred to remove the dependency completely
and copy an implementation of `isWindows` from Intellij
platform, because the code is quite simple
and minimizing unnecessary dependencies will help to avoid
compatibility problems in future.
Gradle plugin also declares a dependency on `commons-io`,
but it seems unused, so the dependency is also removed.
#KT-18832 fixed
This commit is contained in:
@@ -35,9 +35,6 @@ dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-compiler-runner:$kotlin_version"
|
||||
compile "org.jetbrains.kotlin:kotlin-annotation-processing:$kotlin_version"
|
||||
|
||||
compile 'commons-io:commons-io:2.4'
|
||||
compile 'commons-lang:commons-lang:2.4'
|
||||
|
||||
compileOnly 'com.android.tools.build:gradle:2.0.0'
|
||||
compileOnly 'org.codehaus.groovy:groovy-all:2.3.9'
|
||||
compileOnly 'org.jetbrains.kotlin:gradle-api:2.2'
|
||||
|
||||
+2
-2
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.plugin
|
||||
|
||||
import org.apache.commons.lang.SystemUtils
|
||||
import org.gradle.BuildAdapter
|
||||
import org.gradle.BuildResult
|
||||
import org.gradle.api.invocation.Gradle
|
||||
@@ -27,6 +26,7 @@ import org.jetbrains.kotlin.com.intellij.openapi.vfs.impl.jar.CoreJarFileSystem
|
||||
import org.jetbrains.kotlin.compilerRunner.DELETED_SESSION_FILE_PREFIX
|
||||
import org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner
|
||||
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
|
||||
import org.jetbrains.kotlin.gradle.utils.isWindows
|
||||
import org.jetbrains.kotlin.incremental.BuildCacheStorage
|
||||
import org.jetbrains.kotlin.incremental.multiproject.ArtifactDifferenceRegistryProvider
|
||||
import org.jetbrains.kotlin.incremental.relativeToRoot
|
||||
@@ -190,7 +190,7 @@ internal class CompilerServicesCleanup() {
|
||||
// clearing jar cache to avoid problems like KT-9440 (unable to clean/rebuild a project due to locked jar file)
|
||||
// problem is known to happen only on windows - the reason (seems) related to http://bugs.java.com/view_bug.do?bug_id=6357433
|
||||
// clean cache only when running on windows
|
||||
if (SystemUtils.IS_OS_WINDOWS) {
|
||||
if (isWindows) {
|
||||
cleanJarCache()
|
||||
}
|
||||
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright 2010-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.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle.utils
|
||||
|
||||
import java.util.*
|
||||
|
||||
// Based on org.jetbrains.kotlin.com.intellij.openapi.util.SystemInfoRt from Intellij platform
|
||||
internal val isWindows: Boolean =
|
||||
System.getProperty("os.name")?.toLowerCase(Locale.US)?.startsWith("windows") ?: false
|
||||
Reference in New Issue
Block a user