Skip to content

Commit dee34b4

Browse files
committedAug 23, 2022
8292391: Add support for optional signing of native libraries
Reviewed-by: arapte
1 parent b951503 commit dee34b4

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
 

‎build.gradle

+54
Original file line numberDiff line numberDiff line change
@@ -5033,6 +5033,9 @@ compileTargets { t ->
50335033
def doStrip = targetProperties.containsKey('strip') && IS_RELEASE
50345034
def strip = doStrip ? targetProperties.strip : null
50355035
def stripArgs = doStrip ? targetProperties.stripArgs : null
5036+
def doSign = rootProject.hasProperty('codeSignCmd') && IS_RELEASE
5037+
def signCmd = doSign ? rootProject.ext.codeSignCmd : null
5038+
def signArgs = doSign ? rootProject.ext.codeSignArgs : null
50365039
def useLipo = targetProperties.containsKey('useLipo') ? targetProperties.useLipo : false
50375040
def modLibDest = targetProperties.modLibDest
50385041
def moduleNativeDirName = "${platformPrefix}module-$modLibDest"
@@ -5126,6 +5129,23 @@ compileTargets { t ->
51265129
}
51275130
}
51285131
}
5132+
if (doSign) {
5133+
doLast {
5134+
def inputFiles = fileTree(dir: destDirName)
5135+
inputFiles.include("*.dll")
5136+
inputFiles.include("*.dylib")
5137+
inputFiles.include("*.so")
5138+
// FIXME: if we ever need to sign on Windows platforms, we must
5139+
// exclude the Microsoft DLLs (VS2017DLLNames and WinSDKDLLNames)
5140+
5141+
inputFiles.each { file ->
5142+
exec {
5143+
def cmd = [ signCmd, signArgs, file ].flatten()
5144+
commandLine(cmd)
5145+
}
5146+
}
5147+
}
5148+
}
51295149
}
51305150

51315151
def buildModuleMediaTask = task("buildModuleMedia$t.capital", type: Copy, dependsOn: [mediaProject.assemble, prepOpenJfxStubs]) {
@@ -5180,6 +5200,23 @@ compileTargets { t ->
51805200
}
51815201
}
51825202
}
5203+
if (doSign && IS_COMPILE_MEDIA) {
5204+
doLast {
5205+
def inputFiles = fileTree(dir: destDirName)
5206+
inputFiles.include("*.dll")
5207+
inputFiles.include("*.dylib")
5208+
inputFiles.include("*.so")
5209+
// FIXME: if we ever need to sign on Windows platforms, we must
5210+
// exclude the Microsoft DLLs (VS2017DLLNames and WinSDKDLLNames)
5211+
5212+
inputFiles.each { file ->
5213+
exec {
5214+
def cmd = [ signCmd, signArgs, file ].flatten()
5215+
commandLine(cmd)
5216+
}
5217+
}
5218+
}
5219+
}
51835220
}
51845221

51855222
def buildModuleWeb = task("buildModuleWeb$t.capital", type: Copy, dependsOn: [webProject.assemble, prepOpenJfxStubs]) {
@@ -5212,6 +5249,23 @@ compileTargets { t ->
52125249
}
52135250
}
52145251
}
5252+
if (doSign && IS_COMPILE_WEBKIT) {
5253+
doLast {
5254+
def inputFiles = fileTree(dir: destDirName)
5255+
inputFiles.include("*.dll")
5256+
inputFiles.include("*.dylib")
5257+
inputFiles.include("*.so")
5258+
// FIXME: if we ever need to sign on Windows platforms, we must
5259+
// exclude the Microsoft DLLs (VS2017DLLNames and WinSDKDLLNames)
5260+
5261+
inputFiles.each { file ->
5262+
exec {
5263+
def cmd = [ signCmd, signArgs, file ].flatten()
5264+
commandLine(cmd)
5265+
}
5266+
}
5267+
}
5268+
}
52155269
}
52165270

52175271
def buildModuleSWT = task("buildModuleSWT$t.capital", type: Copy) {

0 commit comments

Comments
 (0)
Please sign in to comment.