Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8292391: Add support for optional signing of native libraries
Reviewed-by: arapte
  • Loading branch information
kevinrushforth committed Aug 23, 2022
1 parent b951503 commit dee34b4
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions build.gradle
Expand Up @@ -5033,6 +5033,9 @@ compileTargets { t ->
def doStrip = targetProperties.containsKey('strip') && IS_RELEASE
def strip = doStrip ? targetProperties.strip : null
def stripArgs = doStrip ? targetProperties.stripArgs : null
def doSign = rootProject.hasProperty('codeSignCmd') && IS_RELEASE
def signCmd = doSign ? rootProject.ext.codeSignCmd : null
def signArgs = doSign ? rootProject.ext.codeSignArgs : null
def useLipo = targetProperties.containsKey('useLipo') ? targetProperties.useLipo : false
def modLibDest = targetProperties.modLibDest
def moduleNativeDirName = "${platformPrefix}module-$modLibDest"
Expand Down Expand Up @@ -5126,6 +5129,23 @@ compileTargets { t ->
}
}
}
if (doSign) {
doLast {
def inputFiles = fileTree(dir: destDirName)
inputFiles.include("*.dll")
inputFiles.include("*.dylib")
inputFiles.include("*.so")
// FIXME: if we ever need to sign on Windows platforms, we must
// exclude the Microsoft DLLs (VS2017DLLNames and WinSDKDLLNames)

inputFiles.each { file ->
exec {
def cmd = [ signCmd, signArgs, file ].flatten()
commandLine(cmd)
}
}
}
}
}

def buildModuleMediaTask = task("buildModuleMedia$t.capital", type: Copy, dependsOn: [mediaProject.assemble, prepOpenJfxStubs]) {
Expand Down Expand Up @@ -5180,6 +5200,23 @@ compileTargets { t ->
}
}
}
if (doSign && IS_COMPILE_MEDIA) {
doLast {
def inputFiles = fileTree(dir: destDirName)
inputFiles.include("*.dll")
inputFiles.include("*.dylib")
inputFiles.include("*.so")
// FIXME: if we ever need to sign on Windows platforms, we must
// exclude the Microsoft DLLs (VS2017DLLNames and WinSDKDLLNames)

inputFiles.each { file ->
exec {
def cmd = [ signCmd, signArgs, file ].flatten()
commandLine(cmd)
}
}
}
}
}

def buildModuleWeb = task("buildModuleWeb$t.capital", type: Copy, dependsOn: [webProject.assemble, prepOpenJfxStubs]) {
Expand Down Expand Up @@ -5212,6 +5249,23 @@ compileTargets { t ->
}
}
}
if (doSign && IS_COMPILE_WEBKIT) {
doLast {
def inputFiles = fileTree(dir: destDirName)
inputFiles.include("*.dll")
inputFiles.include("*.dylib")
inputFiles.include("*.so")
// FIXME: if we ever need to sign on Windows platforms, we must
// exclude the Microsoft DLLs (VS2017DLLNames and WinSDKDLLNames)

inputFiles.each { file ->
exec {
def cmd = [ signCmd, signArgs, file ].flatten()
commandLine(cmd)
}
}
}
}
}

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

1 comment on commit dee34b4

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.