Added JS target for benchmarksAnalyzer

This commit is contained in:
Elena Lepilkina
2019-01-29 16:43:42 +03:00
committed by LepilkinaElena
parent d9474a8319
commit f47feb9d85
4 changed files with 96 additions and 6 deletions
+35
View File
@@ -55,6 +55,11 @@ kotlin {
implementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
}
}
jsTest {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-test-js:$kotlinVersion"
}
}
nativeMain {
dependsOn commonMain
kotlin.srcDir 'src/main/kotlin-native'
@@ -65,6 +70,12 @@ kotlin {
}
kotlin.srcDir 'src/main/kotlin-jvm'
}
jsMain {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlinVersion"
}
kotlin.srcDir 'src/main/kotlin-js'
}
linuxMain { dependsOn nativeMain }
windowsMain { dependsOn nativeMain }
macosMain {dependsOn nativeMain }
@@ -104,6 +115,11 @@ kotlin {
}
}
}
fromPreset(presets.js, 'js') {
compilations.main.kotlinOptions {
main = "noCall"
}
}
configure([windows, linux, macos]) {
binaries {
@@ -123,4 +139,23 @@ def getMingwPath() {
if (directory == null)
directory = "c:/msys64/mingw64"
return directory
}
task assembleWeb(type: Sync) {
def runtimeDependencies = kotlin.targets.js.compilations.main.runtimeDependencyFiles
from(files {
runtimeDependencies.collect { File file ->
zipTree(file.absolutePath)
}
}.builtBy(runtimeDependencies)) {
includeEmptyDirs = false
include { fileTreeElement ->
def path = fileTreeElement.path
path.endsWith(".js") && (path.startsWith("META-INF/resources/") ||
!path.startsWith("META-INF/"))
}
}
from compileKotlinJs.destinationDir
into "${projectDir}/web"
}