Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuqiang
skiko
Commits
16b2dee5
Unverified
Commit
16b2dee5
authored
Sep 16, 2021
by
Shagen Ogandzhanian
Committed by
GitHub
Sep 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Postprocess skiko.js file directly while adding to the jar (#196)
parent
3cc441cc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
17 deletions
+9
-17
build.gradle.kts
skiko/build.gradle.kts
+9
-17
No files found.
skiko/build.gradle.kts
View file @
16b2dee5
...
@@ -343,7 +343,7 @@ fun List<String>.findAllFiles(suffix: String): List<String> = this
...
@@ -343,7 +343,7 @@ fun List<String>.findAllFiles(suffix: String): List<String> = this
.
filter
{
it
.
endsWith
(
suffix
)
}
.
filter
{
it
.
endsWith
(
suffix
)
}
val
wasmCompile
Task
=
project
.
tasks
.
register
<
Exec
>(
"wasmCompile"
)
{
val
wasmCompile
=
project
.
tasks
.
register
<
Exec
>(
"wasmCompile"
)
{
dependsOn
(
skiaWasmDir
)
dependsOn
(
skiaWasmDir
)
val
skiaDir
=
skiaWasmDir
.
get
().
absolutePath
val
skiaDir
=
skiaWasmDir
.
get
().
absolutePath
val
outDir
=
"$buildDir/wasm"
val
outDir
=
"$buildDir/wasm"
...
@@ -381,19 +381,6 @@ val wasmCompileTask = project.tasks.register<Exec>("wasmCompile") {
...
@@ -381,19 +381,6 @@ val wasmCompileTask = project.tasks.register<Exec>("wasmCompile") {
outputs
.
files
(
outJs
,
outWasm
)
outputs
.
files
(
outJs
,
outWasm
)
}
}
val
wasmJsPatcher
=
project
.
tasks
.
register
<
Exec
>(
"wasmJsPatcher"
)
{
dependsOn
(
wasmCompileTask
)
val
inJs
=
wasmCompileTask
.
get
().
outputs
.
files
.
single
{
it
.
name
.
endsWith
(
".js"
)
}
val
outDir
=
"$buildDir/wasm"
val
outJs
=
"$outDir/skiko_processed.js"
commandLine
=
listOf
(
"bash"
,
"-c"
,
"sed 's/_org_jetbrains_/org_jetbrains_/g' ${inJs.absolutePath} > ${outJs}"
)
inputs
.
files
(
inJs
)
outputs
.
files
(
outJs
)
}
// Very hacky way to compile native bridges and add the
// Very hacky way to compile native bridges and add the
// resulting object files into the final native klib.
// resulting object files into the final native klib.
project
.
tasks
.
register
<
Exec
>(
"nativeBridgesCompile"
)
{
project
.
tasks
.
register
<
Exec
>(
"nativeBridgesCompile"
)
{
...
@@ -672,9 +659,14 @@ val skikoJvmRuntimeJar by project.tasks.registering(Jar::class) {
...
@@ -672,9 +659,14 @@ val skikoJvmRuntimeJar by project.tasks.registering(Jar::class) {
val
skikoWasmJar
by
project
.
tasks
.
registering
(
Jar
::
class
)
{
val
skikoWasmJar
by
project
.
tasks
.
registering
(
Jar
::
class
)
{
// We produce jar that contains .js of wrapper/bindings and .wasm with Skia + bindings.
// We produce jar that contains .js of wrapper/bindings and .wasm with Skia + bindings.
from
(
wasmCompileTask
.
get
().
outputs
.
files
.
single
{
it
.
name
.
endsWith
(
".wasm"
)})
val
wasmOutputs
=
wasmCompile
.
get
().
outputs
from
(
wasmJsPatcher
.
get
().
outputs
)
from
(
wasmOutputs
.
files
.
single
{
it
.
name
.
endsWith
(
".wasm"
)})
rename
{
if
(
it
==
"skiko_processed.js"
)
"skiko.js"
else
it
}
from
(
wasmOutputs
)
{
include
(
"skiko.js"
)
filter
{
line
->
line
.
replace
(
"_org_jetbrains_"
,
"org_jetbrains_"
)
}
}
archiveBaseName
.
set
(
"skiko-wasm"
)
archiveBaseName
.
set
(
"skiko-wasm"
)
doLast
{
doLast
{
println
(
"Wasm and JS at ${outputs.files.files.single()}"
)
println
(
"Wasm and JS at ${outputs.files.files.single()}"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment