[build] Add a task to re-generate math.js
This commit is contained in:
@@ -301,9 +301,6 @@ targetList.each { target ->
|
||||
|
||||
task("${target}PlatformLibs") {
|
||||
dependsOn ":platformLibs:${target}Install"
|
||||
if (target == 'wasm32') {
|
||||
dependsOn 'Interop:JsRuntime:installJsRuntime'
|
||||
}
|
||||
}
|
||||
|
||||
task("${target}CrossDist") {
|
||||
|
||||
@@ -51,3 +51,29 @@ task clean {
|
||||
delete buildDir
|
||||
}
|
||||
}
|
||||
|
||||
task generateJsMath {
|
||||
dependsOn ':dist'
|
||||
doLast {
|
||||
def jsinteropScript = isWindows() ? "jsinterop.bat" : "jsinterop"
|
||||
def jsinterop = "$distDir/bin/$jsinteropScript"
|
||||
def targetDir = "$buildDir/generated"
|
||||
def firstLine = true
|
||||
"$jsinterop -pkg kotlinx.interop.wasm.math -o $targetDir/math -target wasm32".execute().waitFor()
|
||||
copy {
|
||||
from("$targetDir/math-build/natives/js_stubs.js")
|
||||
into('src/main/js')
|
||||
rename { "math.js" }
|
||||
filter { line ->
|
||||
if (firstLine) {
|
||||
firstLine = false
|
||||
return "// NOTE: THIS FILE IS AUTO-GENERATED!\n" +
|
||||
"// Run ':runtime:generateJsMath' to re-generate it.\n\n" +
|
||||
"$line"
|
||||
} else {
|
||||
return line
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2018 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.
|
||||
*/
|
||||
// NOTE: THIS FILE IS AUTO-GENERATED!
|
||||
// Run ':runtime:generateJsMath' to re-generate it.
|
||||
|
||||
konan.libraries.push ({
|
||||
|
||||
|
||||
Reference in New Issue
Block a user