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
a7a3556d
Unverified
Commit
a7a3556d
authored
Feb 25, 2021
by
Nikolay Igotti
Committed by
GitHub
Feb 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sealing on Linux (#68)
parent
6f6bf094
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
build.gradle.kts
skiko/build.gradle.kts
+20
-1
sealer
skiko/tools/sealer
+0
-0
No files found.
skiko/build.gradle.kts
View file @
a7a3556d
...
@@ -317,6 +317,21 @@ fun localSign(signer: String, lib: File): File {
...
@@ -317,6 +317,21 @@ fun localSign(signer: String, lib: File): File {
return
lib
return
lib
}
}
// See https://github.com/olonho/sealer.
fun
sealBinary
(
sealer
:
String
,
lib
:
File
)
{
println
(
"Sealing $lib by $sealer"
)
val
proc
=
ProcessBuilder
(
sealer
,
"-f"
,
lib
.
absolutePath
,
"-p"
,
"Java_"
)
.
redirectOutput
(
ProcessBuilder
.
Redirect
.
INHERIT
)
.
redirectError
(
ProcessBuilder
.
Redirect
.
INHERIT
)
.
start
()
proc
.
waitFor
(
2
,
TimeUnit
.
MINUTES
)
if
(
proc
.
exitValue
()
!=
0
)
{
throw
GradleException
(
"Cannot seal $lib"
)
}
println
(
"Sealed!"
)
}
fun
remoteSign
(
signHost
:
String
,
lib
:
File
,
out
:
File
)
{
fun
remoteSign
(
signHost
:
String
,
lib
:
File
,
out
:
File
)
{
println
(
"Remote signing $lib on $signHost"
)
println
(
"Remote signing $lib on $signHost"
)
val
user
=
skiko
.
signUser
?:
error
(
"signUser is null"
)
val
user
=
skiko
.
signUser
?:
error
(
"signUser is null"
)
...
@@ -445,12 +460,16 @@ val maybeSign by project.tasks.registering {
...
@@ -445,12 +460,16 @@ val maybeSign by project.tasks.registering {
outputs
.
files
(
output
)
outputs
.
files
(
output
)
doLast
{
doLast
{
if
(
targetOs
==
OS
.
Linux
)
{
// Linux requires additional sealing to run on wider set of platforms.
val
sealer
=
"$projectDir/tools/sealer"
sealBinary
(
sealer
,
lib
)
}
if
(
skiko
.
signHost
!=
null
)
{
if
(
skiko
.
signHost
!=
null
)
{
remoteSign
(
skiko
.
signHost
!!
,
lib
,
output
)
remoteSign
(
skiko
.
signHost
!!
,
lib
,
output
)
}
else
{
}
else
{
lib
.
copyTo
(
output
,
overwrite
=
true
)
lib
.
copyTo
(
output
,
overwrite
=
true
)
}
}
}
}
}
}
...
...
skiko/tools/sealer
0 → 100755
View file @
a7a3556d
File added
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