changeset 5859:75fc25092d2e

RT-27943: Update JavaFX DLL Files to include appropriate meta data (Media part)
author Kirill Kirichenko <kirill.kirichenko@oracle.com>
date Mon, 02 Dec 2013 11:33:45 +0400
parents 207d6d1ca9a3
children 2e9dea67bf59
files build.gradle buildSrc/win.gradle modules/media/src/main/native/gstreamer/projects/win/fxplugins/Makefile modules/media/src/main/native/gstreamer/projects/win/glib-lite/Makefile modules/media/src/main/native/gstreamer/projects/win/gstreamer-lite/Makefile modules/media/src/main/native/jfxmedia/projects/win/Makefile
diffstat 6 files changed, 67 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Sun Dec 01 17:01:55 2013 -0500
+++ b/build.gradle	Mon Dec 02 11:33:45 2013 +0400
@@ -1849,7 +1849,7 @@
 
                     if (t.name == "win") {
                         environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
-                        args(IS_64 ? "ARCH=x64" : "ARCH=x32")
+                        args(IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.jfxmediaRcFile}")
                     } else {
                         args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
 
@@ -1873,7 +1873,7 @@
 
                         if (t.name == "win") {
                             environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
-                            args(IS_64 ? "ARCH=x64" : "ARCH=x32")
+                            args(IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.gstreamerRcFile}")
                         } else
                             args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
                     }
@@ -1906,7 +1906,7 @@
                             }
                             environment(winEnv)
 
-                            args(IS_64 ? "ARCH=x64" : "ARCH=x32")
+                            args(IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.fxpluginsRcFile}")
                         } else
                             args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
                     }
@@ -1934,19 +1934,60 @@
                 buildNative.dependsOn buildAVPlugin
             }
 
-            if (t.name == "win" || t.name == "mac") {
+            if (t.name == "win") {
+                def buildResources = task("buildResources") << {
+                    def rcOutputDir = "${nativeOutputDir}/${buildType}"
+                    mkdir rcOutputDir
+                    exec {
+                        environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
+                        commandLine (WIN.media.rcCompiler)
+                        args(WIN.media.glibRcFlags)
+                        args("/Fo${rcOutputDir}/${WIN.media.glibRcFile}", WIN.media.rcSource)
+                    }
+
+                    exec {
+                        environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
+                        commandLine (WIN.media.rcCompiler)
+                        args(WIN.media.gstreamerRcFlags)
+                        args("/Fo${rcOutputDir}/${WIN.media.gstreamerRcFile}", WIN.media.rcSource)
+                    }
+
+                    exec {
+                        environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
+                        commandLine (WIN.media.rcCompiler)
+                        args(WIN.media.fxpluginsRcFlags)
+                        args("/Fo${rcOutputDir}/${WIN.media.fxpluginsRcFile}", WIN.media.rcSource)
+                    }
+
+                    exec {
+                        environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
+                        commandLine (WIN.media.rcCompiler)
+                        args(WIN.media.jfxmediaRcFlags)
+                        args("/Fo${rcOutputDir}/${WIN.media.jfxmediaRcFile}", WIN.media.rcSource)
+                    }
+                }
+                
+                def buildGlib = task("build${t.capital}Glib", dependsOn: [buildResources]) {
+                    enabled = IS_COMPILE_MEDIA
+                    doLast {
+                        exec {
+                            environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
+                            commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
+                            args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite",
+                                 IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.glibRcFile}")
+                        }
+                    }
+                }
+                buildGStreamer.dependsOn buildGlib
+                
+            } else if (t.name == "mac") {
                 def buildGlib = task("build${t.capital}Glib") {
                     enabled = IS_COMPILE_MEDIA
                     doLast {
                         exec {
                             commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
                             args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite")
-
-                            if (t.name == "win") {
-                                environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
-                                args(IS_64 ? "ARCH=x64" : "ARCH=x32")
-                            } else
-                                args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
+                            args ("CC=${mediaProperties.compiler}", "LINK=${mediaProperties.linker}", "LIB=${mediaProperties.lib}")
                         }
                     }
                 }
--- a/buildSrc/win.gradle	Sun Dec 01 17:01:55 2013 -0500
+++ b/buildSrc/win.gradle	Mon Dec 02 11:33:45 2013 +0400
@@ -308,3 +308,15 @@
 WIN.fontT2K.rcCompiler = rcCompiler;
 WIN.fontT2K.rcSource = defaultRcSource
 WIN.fontT2K.rcFlags = ["/d", "JFX_FNAME=javafx_font_t2k.dll", "/d", "JFX_INTERNAL_NAME=fontT2K", rcFlags].flatten();
+
+WIN.media = [:]
+WIN.media.rcCompiler = rcCompiler
+WIN.media.rcSource = defaultRcSource
+WIN.media.glibRcFile = "glib-lite.res"
+WIN.media.gstreamerRcFile = "gstreamer-lite.res"
+WIN.media.fxpluginsRcFile = "fxplugins.res"
+WIN.media.jfxmediaRcFile = "jfxmedia.res"
+WIN.media.glibRcFlags = ["/d", "JFX_FNAME=glib-lite.dll", "/d", "JFX_INTERNAL_NAME=glib", rcFlags].flatten()
+WIN.media.gstreamerRcFlags = ["/d", "JFX_FNAME=gstreamer-lite.dll", "/d", "JFX_INTERNAL_NAME=gstreamer", rcFlags].flatten()
+WIN.media.fxpluginsRcFlags = ["/d", "JFX_FNAME=fxplugins.dll", "/d", "JFX_INTERNAL_NAME=fxplugins", rcFlags].flatten()
+WIN.media.jfxmediaRcFlags = ["/d", "JFX_FNAME=jfxmedia.dll", "/d", "JFX_INTERNAL_NAME=jfxmedia", rcFlags].flatten()
--- a/modules/media/src/main/native/gstreamer/projects/win/fxplugins/Makefile	Sun Dec 01 17:01:55 2013 -0500
+++ b/modules/media/src/main/native/gstreamer/projects/win/fxplugins/Makefile	Mon Dec 02 11:33:45 2013 +0400
@@ -142,7 +142,7 @@
 	$(MAKE) $(TARGET)
 
 $(TARGET): $(OBJECTS) $(LIBS)
-	$(LINK) $(LDFLAGS) $(foreach object,$(OBJECTS),$(shell cygpath -ma $(object))) $(foreach lib,$(LIBS),$(shell cygpath -ma $(lib)))
+	$(LINK) $(LDFLAGS) $(shell cygpath -ma $(RESOURCE)) $(foreach object,$(OBJECTS),$(shell cygpath -ma $(object))) $(foreach lib,$(LIBS),$(shell cygpath -ma $(lib)))
 
 $(OBJECTS): | $(DEP_DIRS)
 
--- a/modules/media/src/main/native/gstreamer/projects/win/glib-lite/Makefile	Sun Dec 01 17:01:55 2013 -0500
+++ b/modules/media/src/main/native/gstreamer/projects/win/glib-lite/Makefile	Mon Dec 02 11:33:45 2013 +0400
@@ -51,7 +51,7 @@
 default: $(TARGET)
 
 $(TARGET): $(LIBS)
-	$(LINK) $(LDFLAGS) $(foreach lib,$(LIBS),$(shell cygpath -ma $(lib))) 
+	$(LINK) $(LDFLAGS) $(shell cygpath -ma $(RESOURCE)) $(foreach lib,$(LIBS),$(shell cygpath -ma $(lib))) 
 
 $(BUILD_DIR)/$(GLIB_TARGET):
 	$(MAKE) TARGET=$(BUILD_DIR)/$(GLIB_TARGET) -f Makefile.glib
--- a/modules/media/src/main/native/gstreamer/projects/win/gstreamer-lite/Makefile	Sun Dec 01 17:01:55 2013 -0500
+++ b/modules/media/src/main/native/gstreamer/projects/win/gstreamer-lite/Makefile	Mon Dec 02 11:33:45 2013 +0400
@@ -54,7 +54,7 @@
 	$(MAKE) $(TARGET)
 
 $(TARGET): $(LIBS)
-	$(LINK) $(LDFLAGS) $(foreach lib,$(LIBS),$(shell cygpath -ma $(lib)))
+	$(LINK) $(LDFLAGS) $(shell cygpath -ma $(RESOURCE)) $(foreach lib,$(LIBS),$(shell cygpath -ma $(lib)))
 
 $(GSTREAMER_TARGET):
 	$(MAKE) TARGET=$(BUILD_DIR)/$(GSTREAMER_TARGET) -f Makefile.gstreamer
--- a/modules/media/src/main/native/jfxmedia/projects/win/Makefile	Sun Dec 01 17:01:55 2013 -0500
+++ b/modules/media/src/main/native/jfxmedia/projects/win/Makefile	Mon Dec 02 11:33:45 2013 +0400
@@ -145,7 +145,7 @@
 default: $(TARGET)
 
 $(TARGET): $(DEPFILE) $(OBJECTS) 
-	$(LINK) $(LDFLAGS) $(foreach object,$(OBJECTS),$(shell cygpath -ma $(object)))
+	$(LINK) $(LDFLAGS) $(shell cygpath -ma $(RESOURCE)) $(foreach object,$(OBJECTS),$(shell cygpath -ma $(object)))
 
 $(DEPFILE): | $(DEP_DIRS)
 	@echo $(DEPTOKEN) > $(DEPFILE)