@@ -459,6 +459,7 @@ ext.IS_WORKER_DEBUG = Boolean.parseBoolean(WORKER_DEBUG);
459
459
defineProperty(" CONF" , " Debug" )
460
460
ext. IS_DEBUG_JAVA = CONF == " Debug" || CONF == " DebugNative"
461
461
ext. IS_DEBUG_NATIVE = CONF == " DebugNative"
462
+ ext. IS_RELEASE = ! ext. IS_DEBUG_JAVA
462
463
463
464
// Specifies whether to enable the Maven publishing tasks
464
465
defineProperty(" MAVEN_PUBLISH" , " false" )
@@ -4961,6 +4962,9 @@ compileTargets { t ->
4961
4962
4962
4963
def library = targetProperties. library
4963
4964
4965
+ def doStrip = targetProperties. containsKey(' strip' ) && IS_RELEASE
4966
+ def strip = doStrip ? targetProperties. strip : null
4967
+ def stripArgs = doStrip ? targetProperties. stripArgs : null
4964
4968
def useLipo = targetProperties. containsKey(' useLipo' ) ? targetProperties. useLipo : false
4965
4969
def modLibDest = targetProperties. modLibDest
4966
4970
def moduleNativeDirName = " ${ platformPrefix} module-$modLibDest "
@@ -5009,7 +5013,8 @@ compileTargets { t ->
5009
5013
group = " Basic"
5010
5014
description = " copies javafx.graphics native libraries"
5011
5015
5012
- into " ${ graphicsProject.buildDir} /${ moduleNativeDirName} "
5016
+ def destDirName = " ${ graphicsProject.buildDir} /${ moduleNativeDirName} "
5017
+ into destDirName
5013
5018
5014
5019
from(" ${ graphicsProject.buildDir} /libs/jsl-decora/${ t.name} /${ library(targetProperties.decora.lib)} " )
5015
5020
def libs = [' font' , ' prism' , ' prismSW' , ' glass' , ' iio' ]
@@ -5035,13 +5040,32 @@ compileTargets { t ->
5035
5040
from (" $winsdklib " );
5036
5041
}
5037
5042
}
5043
+
5044
+ if (doStrip) {
5045
+ doLast {
5046
+ def inputFiles = fileTree(dir : destDirName)
5047
+ inputFiles. include(" *.dll" )
5048
+ inputFiles. include(" *.dylib" )
5049
+ inputFiles. include(" *.so" )
5050
+ // FIXME: if we ever need to strip on Windows platforms, we must
5051
+ // exclude the Microsoft DLLs (VS2017DLLNames and WinSDKDLLNames)
5052
+
5053
+ inputFiles. each { file ->
5054
+ exec {
5055
+ def cmd = [ strip, stripArgs, file ]. flatten()
5056
+ commandLine(cmd)
5057
+ }
5058
+ }
5059
+ }
5060
+ }
5038
5061
}
5039
5062
5040
5063
def buildModuleMediaTask = task(" buildModuleMedia$t. capital " , type : Copy , dependsOn : [mediaProject. assemble, prepOpenJfxStubs]) {
5041
5064
group = " Basic"
5042
5065
description = " copies javafx.media native libraries"
5043
5066
5044
- into " ${ mediaProject.buildDir} /${ moduleNativeDirName} "
5067
+ def destDirName = " ${ mediaProject.buildDir} /${ moduleNativeDirName} "
5068
+ into destDirName
5045
5069
5046
5070
def mediaBuildType = project(" :media" ). ext. buildType
5047
5071
if (IS_COMPILE_MEDIA ) {
@@ -5072,13 +5096,30 @@ compileTargets { t ->
5072
5096
from (" $MEDIA_STUB /${ library("glib-lite")} " )
5073
5097
}
5074
5098
}
5099
+
5100
+ if (doStrip && IS_COMPILE_MEDIA ) {
5101
+ doLast {
5102
+ def inputFiles = fileTree(dir : destDirName)
5103
+ inputFiles. include(" *.dll" )
5104
+ inputFiles. include(" *.dylib" )
5105
+ inputFiles. include(" *.so" )
5106
+
5107
+ inputFiles. each { file ->
5108
+ exec {
5109
+ def cmd = [ strip, stripArgs, file ]. flatten()
5110
+ commandLine(cmd)
5111
+ }
5112
+ }
5113
+ }
5114
+ }
5075
5115
}
5076
5116
5077
5117
def buildModuleWeb = task(" buildModuleWeb$t. capital " , type : Copy , dependsOn : [webProject. assemble, prepOpenJfxStubs]) {
5078
5118
group = " Basic"
5079
5119
description = " copies javafx.web native libraries"
5080
5120
5081
- into " ${ webProject.buildDir} /${ moduleNativeDirName} "
5121
+ def destDirName = " ${ webProject.buildDir} /${ moduleNativeDirName} "
5122
+ into destDirName
5082
5123
5083
5124
if (IS_COMPILE_WEBKIT ) {
5084
5125
from (" ${ webProject.buildDir} /libs/${ t.name} /${ library('jfxwebkit')} " )
@@ -5087,6 +5128,22 @@ compileTargets { t ->
5087
5128
from (" $WEB_STUB /${ library('jfxwebkit')} " )
5088
5129
}
5089
5130
}
5131
+
5132
+ if (doStrip && IS_COMPILE_WEBKIT ) {
5133
+ doLast {
5134
+ def inputFiles = fileTree(dir : destDirName)
5135
+ inputFiles. include(" *.dll" )
5136
+ inputFiles. include(" *.dylib" )
5137
+ inputFiles. include(" *.so" )
5138
+
5139
+ inputFiles. each { file ->
5140
+ exec {
5141
+ def cmd = [ strip, stripArgs, file ]. flatten()
5142
+ commandLine(cmd)
5143
+ }
5144
+ }
5145
+ }
5146
+ }
5090
5147
}
5091
5148
5092
5149
def buildModuleSWT = task(" buildModuleSWT$t. capital " , type : Copy ) {
0 commit comments