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
20e72842
Commit
20e72842
authored
Feb 19, 2021
by
Nikolay Igotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework signing.
parent
b25d00bb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
+15
-19
build.gradle.kts
skiko/build.gradle.kts
+15
-19
No files found.
skiko/build.gradle.kts
View file @
20e72842
...
...
@@ -299,7 +299,7 @@ project.tasks.register<Exec>("objcCompile") {
outputs
.
files
(
outs
)
}
fun
localSign
(
signer
:
String
,
lib
:
File
)
{
fun
localSign
(
signer
:
String
,
lib
:
File
)
:
File
{
println
(
"Local signing $lib as $signer"
)
val
proc
=
ProcessBuilder
(
"codesign"
,
"-f"
,
"-s"
,
signer
,
lib
.
absolutePath
)
.
redirectOutput
(
ProcessBuilder
.
Redirect
.
PIPE
)
...
...
@@ -313,9 +313,10 @@ fun localSign(signer: String, lib: File) {
println
(
err
)
throw
GradleException
(
"Cannot sign $lib: $err"
)
}
return
lib
}
fun
remoteSign
(
signHost
:
String
,
lib
:
File
)
{
fun
remoteSign
(
signHost
:
String
,
lib
:
File
)
:
File
{
println
(
"Remote signing $lib on $signHost"
)
val
user
=
skiko
.
signUser
?:
error
(
"signUser is null"
)
val
token
=
skiko
.
signToken
?:
error
(
"signToken is null"
)
...
...
@@ -339,8 +340,7 @@ fun remoteSign(signHost: String, lib: File) {
println
(
err
)
throw
GradleException
(
"Cannot sign $lib: $err"
)
}
else
{
lib
.
delete
()
out
.
renameTo
(
lib
)
return
out
}
}
...
...
@@ -388,20 +388,6 @@ tasks.withType(LinkSharedLibrary::class.java).configureEach {
)
}
}
doLast
{
val
dylib
=
outputs
.
files
.
files
.
singleOrNull
{
it
.
name
.
endsWith
(
".dylib"
)
}
logger
.
info
(
"Resulting dylib: $dylib"
)
if
(
dylib
!=
null
)
{
(
project
.
properties
[
"signer"
]
as
String
?)
?.
let
{
signer
->
localSign
(
signer
,
dylib
)
}
skiko
.
signHost
?.
let
{
signHost
->
remoteSign
(
signHost
,
dylib
)
}
}
}
}
extensions
.
configure
<
CppLibrary
>
{
...
...
@@ -459,7 +445,17 @@ val skikoJvmRuntimeJar by project.tasks.registering(Jar::class) {
dependsOn
(
createChecksums
)
from
(
skikoJvmJar
.
map
{
zipTree
(
it
.
archiveFile
)
})
val
linkTask
=
project
.
tasks
.
withType
(
LinkSharedLibrary
::
class
.
java
).
single
{
it
.
name
.
contains
(
buildType
.
id
)
}
from
(
linkTask
.
outputs
.
files
.
filter
{
it
.
isFile
})
val
lib
=
linkTask
.
outputs
.
files
.
single
{
it
.
isFile
}
val
maybeSigned
=
if
(
lib
.
name
.
endsWith
(
".dylib"
))
{
println
(
"Resulting dylib: $lib"
)
skiko
.
signHost
?.
let
{
signHost
->
remoteSign
(
signHost
,
lib
)
}
?:
lib
}
else
{
lib
}
from
(
maybeSigned
)
rename
(
"${lib.name}.signed"
,
lib
.
name
)
if
(
targetOs
.
isWindows
)
{
from
(
files
(
skiaDir
.
map
{
it
.
resolve
(
"out/${buildType.id}-x64/icudtl.dat"
)
}))
}
...
...
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