@@ -472,6 +472,7 @@ ext.IS_WORKER_DEBUG = Boolean.parseBoolean(WORKER_DEBUG);
472
472
defineProperty(" CONF" , " Debug" )
473
473
ext. IS_DEBUG_JAVA = CONF == " Debug" || CONF == " DebugNative"
474
474
ext. IS_DEBUG_NATIVE = CONF == " DebugNative"
475
+ ext. IS_RELEASE = ! ext. IS_DEBUG_JAVA
475
476
476
477
// Defines the compiler warning levels to use. If empty, then no warnings are generated. If
477
478
// not empty, then the expected syntax is as a space or comma separated list of names, such
@@ -5444,6 +5445,9 @@ compileTargets { t ->
5444
5445
5445
5446
def library = targetProperties. library
5446
5447
5448
+ def doStrip = targetProperties. containsKey(' strip' ) && IS_RELEASE
5449
+ def strip = doStrip ? targetProperties. strip : null
5450
+ def stripArgs = doStrip ? targetProperties. stripArgs : null
5447
5451
def useLipo = targetProperties. containsKey(' useLipo' ) ? targetProperties. useLipo : false
5448
5452
def modLibDest = targetProperties. modLibDest
5449
5453
def moduleNativeDirName = " ${ platformPrefix} module-$modLibDest "
@@ -5492,7 +5496,8 @@ compileTargets { t ->
5492
5496
group = " Basic"
5493
5497
description = " copies javafx.graphics native libraries"
5494
5498
5495
- into " ${ graphicsProject.buildDir} /${ moduleNativeDirName} "
5499
+ def destDirName = " ${ graphicsProject.buildDir} /${ moduleNativeDirName} "
5500
+ into destDirName
5496
5501
5497
5502
from(" ${ graphicsProject.buildDir} /libs/jsl-decora/${ t.name} /${ library(targetProperties.decora.lib)} " )
5498
5503
def libs = [' font' , ' prism' , ' prismSW' , ' glass' , ' iio' ]
@@ -5518,13 +5523,32 @@ compileTargets { t ->
5518
5523
from (" $winsdklib " );
5519
5524
}
5520
5525
}
5526
+
5527
+ if (doStrip) {
5528
+ doLast {
5529
+ def inputFiles = fileTree(dir : destDirName)
5530
+ inputFiles. include(" *.dll" )
5531
+ inputFiles. include(" *.dylib" )
5532
+ inputFiles. include(" *.so" )
5533
+ // FIXME: if we ever need to strip on Windows platforms, we must
5534
+ // exclude the Microsoft DLLs (VS2017DLLNames and WinSDKDLLNames)
5535
+
5536
+ inputFiles. each { file ->
5537
+ exec {
5538
+ def cmd = [ strip, stripArgs, file ]. flatten()
5539
+ commandLine(cmd)
5540
+ }
5541
+ }
5542
+ }
5543
+ }
5521
5544
}
5522
5545
5523
5546
def buildModuleMediaTask = task(" buildModuleMedia$t. capital " , type : Copy , dependsOn : mediaProject. assemble) {
5524
5547
group = " Basic"
5525
5548
description = " copies javafx.media native libraries"
5526
5549
5527
- into " ${ mediaProject.buildDir} /${ moduleNativeDirName} "
5550
+ def destDirName = " ${ mediaProject.buildDir} /${ moduleNativeDirName} "
5551
+ into destDirName
5528
5552
5529
5553
def mediaBuildType = project(" :media" ). ext. buildType
5530
5554
if (IS_COMPILE_MEDIA ) {
@@ -5555,13 +5579,30 @@ compileTargets { t ->
5555
5579
from (" $MEDIA_STUB /${ library("glib-lite")} " )
5556
5580
}
5557
5581
}
5582
+
5583
+ if (doStrip && IS_COMPILE_MEDIA ) {
5584
+ doLast {
5585
+ def inputFiles = fileTree(dir : destDirName)
5586
+ inputFiles. include(" *.dll" )
5587
+ inputFiles. include(" *.dylib" )
5588
+ inputFiles. include(" *.so" )
5589
+
5590
+ inputFiles. each { file ->
5591
+ exec {
5592
+ def cmd = [ strip, stripArgs, file ]. flatten()
5593
+ commandLine(cmd)
5594
+ }
5595
+ }
5596
+ }
5597
+ }
5558
5598
}
5559
5599
5560
5600
def buildModuleWeb = task(" buildModuleWeb$t. capital " , type : Copy , dependsOn : webProject. assemble) {
5561
5601
group = " Basic"
5562
5602
description = " copies javafx.web native libraries"
5563
5603
5564
- into " ${ webProject.buildDir} /${ moduleNativeDirName} "
5604
+ def destDirName = " ${ webProject.buildDir} /${ moduleNativeDirName} "
5605
+ into destDirName
5565
5606
5566
5607
if (IS_COMPILE_WEBKIT ) {
5567
5608
from (" ${ webProject.buildDir} /libs/${ t.name} /${ library('jfxwebkit')} " )
@@ -5570,6 +5611,22 @@ compileTargets { t ->
5570
5611
from (" $WEB_STUB /${ library('jfxwebkit')} " )
5571
5612
}
5572
5613
}
5614
+
5615
+ if (doStrip && IS_COMPILE_WEBKIT ) {
5616
+ doLast {
5617
+ def inputFiles = fileTree(dir : destDirName)
5618
+ inputFiles. include(" *.dll" )
5619
+ inputFiles. include(" *.dylib" )
5620
+ inputFiles. include(" *.so" )
5621
+
5622
+ inputFiles. each { file ->
5623
+ exec {
5624
+ def cmd = [ strip, stripArgs, file ]. flatten()
5625
+ commandLine(cmd)
5626
+ }
5627
+ }
5628
+ }
5629
+ }
5573
5630
}
5574
5631
5575
5632
def buildModuleSWT = task(" buildModuleSWT$t. capital " , type : Copy ) {
0 commit comments