Build: Use same com.eclipsesource.j2v8 artifact for compilation

We can't reuse caches from different platform when we compile against
different jar on each platform. Since they have same api we may use
platform specific jars only for runtime.
This commit is contained in:
Vyacheslav Gerasimov
2020-02-26 03:21:17 +03:00
parent a4030d3abf
commit c57f466494
2 changed files with 3 additions and 14 deletions
+1 -13
View File
@@ -1,4 +1,3 @@
import org.gradle.internal.os.OperatingSystem
plugins {
kotlin("jvm")
@@ -10,18 +9,7 @@ dependencies {
compile(project(":js:js.ast"))
compile(project(":js:js.translator"))
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
val currentOs = OperatingSystem.current()
when {
currentOs.isWindows -> {
val suffix = if (currentOs.toString().endsWith("64")) "_64" else ""
compileOnly("com.eclipsesource.j2v8:j2v8_win32_x86$suffix:4.6.0")
}
currentOs.isMacOsX -> compileOnly("com.eclipsesource.j2v8:j2v8_macosx_x86_64:4.6.0")
currentOs.run { isLinux || isUnix } -> compileOnly("com.eclipsesource.j2v8:j2v8_linux_x86_64:4.8.0")
else -> logger.error("unsupported platform $currentOs - can not compile com.eclipsesource.j2v8 dependency")
}
compileOnly("com.eclipsesource.j2v8:j2v8_linux_x86_64:4.6.0")
}
sourceSets {
+2 -1
View File
@@ -76,7 +76,8 @@ dependencies {
}
}
testCompile(j2v8idString)
testCompileOnly("com.eclipsesource.j2v8:j2v8_linux_x86_64:4.8.0")
testRuntimeOnly(j2v8idString)
testRuntime(kotlinStdlib())
testJsRuntime(kotlinStdlib("js"))