@@ -461,6 +461,7 @@ ext.IS_WORKER_DEBUG = Boolean.parseBoolean(WORKER_DEBUG);
461
461
defineProperty(" CONF" , " Debug" )
462
462
ext. IS_DEBUG_JAVA = CONF == " Debug" || CONF == " DebugNative"
463
463
ext. IS_DEBUG_NATIVE = CONF == " DebugNative"
464
+ ext. IS_RELEASE = ! ext. IS_DEBUG_JAVA
464
465
465
466
// Specifies whether to enable the Maven publishing tasks
466
467
defineProperty(" MAVEN_PUBLISH" , " false" )
@@ -4977,6 +4978,9 @@ compileTargets { t ->
4977
4978
4978
4979
def library = targetProperties. library
4979
4980
4981
+ def doStrip = targetProperties. containsKey(' strip' ) && IS_RELEASE
4982
+ def strip = doStrip ? targetProperties. strip : null
4983
+ def stripArgs = doStrip ? targetProperties. stripArgs : null
4980
4984
def useLipo = targetProperties. containsKey(' useLipo' ) ? targetProperties. useLipo : false
4981
4985
def modLibDest = targetProperties. modLibDest
4982
4986
def moduleNativeDirName = " ${ platformPrefix} module-$modLibDest "
@@ -5025,7 +5029,8 @@ compileTargets { t ->
5025
5029
group = " Basic"
5026
5030
description = " copies javafx.graphics native libraries"
5027
5031
5028
- into " ${ graphicsProject.buildDir} /${ moduleNativeDirName} "
5032
+ def destDirName = " ${ graphicsProject.buildDir} /${ moduleNativeDirName} "
5033
+ into destDirName
5029
5034
5030
5035
from(" ${ graphicsProject.buildDir} /libs/jsl-decora/${ t.name} /${ library(targetProperties.decora.lib)} " )
5031
5036
def libs = [' font' , ' prism' , ' prismSW' , ' glass' , ' iio' ]
@@ -5051,13 +5056,32 @@ compileTargets { t ->
5051
5056
from (" $winsdklib " );
5052
5057
}
5053
5058
}
5059
+
5060
+ if (doStrip) {
5061
+ doLast {
5062
+ def inputFiles = fileTree(dir : destDirName)
5063
+ inputFiles. include(" *.dll" )
5064
+ inputFiles. include(" *.dylib" )
5065
+ inputFiles. include(" *.so" )
5066
+ // FIXME: if we ever need to strip on Windows platforms, we must
5067
+ // exclude the Microsoft DLLs (VS2017DLLNames and WinSDKDLLNames)
5068
+
5069
+ inputFiles. each { file ->
5070
+ exec {
5071
+ def cmd = [ strip, stripArgs, file ]. flatten()
5072
+ commandLine(cmd)
5073
+ }
5074
+ }
5075
+ }
5076
+ }
5054
5077
}
5055
5078
5056
5079
def buildModuleMediaTask = task(" buildModuleMedia$t. capital " , type : Copy , dependsOn : [mediaProject. assemble, prepOpenJfxStubs]) {
5057
5080
group = " Basic"
5058
5081
description = " copies javafx.media native libraries"
5059
5082
5060
- into " ${ mediaProject.buildDir} /${ moduleNativeDirName} "
5083
+ def destDirName = " ${ mediaProject.buildDir} /${ moduleNativeDirName} "
5084
+ into destDirName
5061
5085
5062
5086
def mediaBuildType = project(" :media" ). ext. buildType
5063
5087
if (IS_COMPILE_MEDIA ) {
@@ -5088,13 +5112,30 @@ compileTargets { t ->
5088
5112
from (" $MEDIA_STUB /${ library("glib-lite")} " )
5089
5113
}
5090
5114
}
5115
+
5116
+ if (doStrip && IS_COMPILE_MEDIA ) {
5117
+ doLast {
5118
+ def inputFiles = fileTree(dir : destDirName)
5119
+ inputFiles. include(" *.dll" )
5120
+ inputFiles. include(" *.dylib" )
5121
+ inputFiles. include(" *.so" )
5122
+
5123
+ inputFiles. each { file ->
5124
+ exec {
5125
+ def cmd = [ strip, stripArgs, file ]. flatten()
5126
+ commandLine(cmd)
5127
+ }
5128
+ }
5129
+ }
5130
+ }
5091
5131
}
5092
5132
5093
5133
def buildModuleWeb = task(" buildModuleWeb$t. capital " , type : Copy , dependsOn : [webProject. assemble, prepOpenJfxStubs]) {
5094
5134
group = " Basic"
5095
5135
description = " copies javafx.web native libraries"
5096
5136
5097
- into " ${ webProject.buildDir} /${ moduleNativeDirName} "
5137
+ def destDirName = " ${ webProject.buildDir} /${ moduleNativeDirName} "
5138
+ into destDirName
5098
5139
5099
5140
if (IS_COMPILE_WEBKIT ) {
5100
5141
from (" ${ webProject.buildDir} /libs/${ t.name} /${ library('jfxwebkit')} " )
@@ -5103,6 +5144,22 @@ compileTargets { t ->
5103
5144
from (" $WEB_STUB /${ library('jfxwebkit')} " )
5104
5145
}
5105
5146
}
5147
+
5148
+ if (doStrip && IS_COMPILE_WEBKIT ) {
5149
+ doLast {
5150
+ def inputFiles = fileTree(dir : destDirName)
5151
+ inputFiles. include(" *.dll" )
5152
+ inputFiles. include(" *.dylib" )
5153
+ inputFiles. include(" *.so" )
5154
+
5155
+ inputFiles. each { file ->
5156
+ exec {
5157
+ def cmd = [ strip, stripArgs, file ]. flatten()
5158
+ commandLine(cmd)
5159
+ }
5160
+ }
5161
+ }
5162
+ }
5106
5163
}
5107
5164
5108
5165
def buildModuleSWT = task(" buildModuleSWT$t. capital " , type : Copy ) {
0 commit comments