Skip to content

Commit 923bf38

Browse files
committed
[Build] Remove SWT library version information built into binaries
This removes all native/library version information that is currently built into the native binaries of SWT. Consequently the library-version information is only capture in the name of the native binariy files and in the 'Library' java class. This allows to just rename the binary files in case just the library version has changed without a change in the native sources. This happens for example if only the native sources for another platform are changed.
1 parent 3e59697 commit 923bf38

File tree

12 files changed

+16
-41
lines changed

12 files changed

+16
-41
lines changed

Jenkinsfile

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,24 +161,20 @@ pipeline {
161161
if (nativesChanged || params.forceNativeBuilds) {
162162
NATIVES_CHANGED = true
163163
def swtVersions = getSWTVersions()
164-
withEnv(['swt_version='+swtVersions['swt_version'], 'new_version='+swtVersions['new_version'], 'rev='+swtVersions['rev'], 'new_rev='+swtVersions['new_rev'],
165-
'comma_ver='+swtVersions['comma_ver'], "new_comma_ver=${swtVersions['maj_ver']},${swtVersions['min_ver']},${swtVersions['new_rev']},0" ]) {
166-
sh '''
164+
sh """
167165
# Delete native binaries to be replaced by subsequent binaries build
168166
rm binaries/org.eclipse.swt.gtk.*/libswt-*.so
169167
rm binaries/org.eclipse.swt.win32.*/swt-*.dll
170168
rm binaries/org.eclipse.swt.cocoa.*/libswt-*.jnilib
171169
172-
echo "Incrementing version from ${swt_version} to ${new_version}; new comma_ver=${new_comma_ver}"
170+
echo "Incrementing version from ${swtVersions.swt_version} to ${swtVersions.new_version}"
173171
174-
libraryFile='bundles/org.eclipse.swt/Eclipse SWT PI/common/org/eclipse/swt/internal/Library.java'
175-
sed -i -e "s/REVISION = ${rev}/REVISION = ${new_rev}/g" "$libraryFile"
172+
sed -i -e "s/REVISION = ${swtVersions.rev}/REVISION = ${swtVersions.new_rev}/g" \
173+
'bundles/org.eclipse.swt/Eclipse SWT PI/common/org/eclipse/swt/internal/Library.java'
176174
177-
commonMakeFile='bundles/org.eclipse.swt/Eclipse SWT/common/library/make_common.mak'
178-
sed -i -e "s/rev=${rev}/rev=${new_rev}/g" "$commonMakeFile"
179-
sed -i -e "s/comma_ver=${comma_ver}/comma_ver=${new_comma_ver}/g" "$commonMakeFile"
180-
'''
181-
}
175+
sed -i -e "s/rev=${swtVersions.rev}/rev=${swtVersions.new_rev}/g" \
176+
'bundles/org.eclipse.swt/Eclipse SWT/common/library/make_common.mak'
177+
"""
182178
// Collect SWT-native's sources
183179
dir('bundles/org.eclipse.swt') {
184180
for (ws in ['cocoa', 'gtk', 'win32']) {

bundles/org.eclipse.swt/Eclipse SWT AWT/win32/library/swt_awt.rc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "windows.h"
1616

1717
VS_VERSION_INFO VERSIONINFO
18-
FILEVERSION SWT_COMMA_VERSION
1918
PRODUCTVERSION 0,0,0,0
2019
FILEFLAGSMASK 0x3fL
2120
#ifdef _DEBUG
@@ -33,9 +32,8 @@ BEGIN
3332
BEGIN
3433
VALUE "CompanyName", "Eclipse Foundation\0"
3534
VALUE "FileDescription", "SWT for Windows native library\0"
36-
VALUE "FileVersion", SWT_FILE_VERSION
3735
VALUE "InternalName", "SWT\0"
38-
VALUE "LegalCopyright", "Copyright (c) 2000, 2006 IBM Corp. All Rights Reserved.\0"
36+
VALUE "LegalCopyright", "Copyright (c) 2000, 2025 IBM Corp. All Rights Reserved.\0"
3937
VALUE "OriginalFilename", SWT_ORG_FILENAME
4038
VALUE "ProductName", "Standard Widget Toolkit\0"
4139
VALUE "ProductVersion", "0,0,0,0\0"

bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/library/swt_wgl.rc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "windows.h"
1616

1717
VS_VERSION_INFO VERSIONINFO
18-
FILEVERSION SWT_COMMA_VERSION
1918
PRODUCTVERSION 0,0,0,0
2019
FILEFLAGSMASK 0x3fL
2120
#ifdef _DEBUG
@@ -33,9 +32,8 @@ BEGIN
3332
BEGIN
3433
VALUE "CompanyName", "Eclipse Foundation\0"
3534
VALUE "FileDescription", "SWT for Windows native library\0"
36-
VALUE "FileVersion", SWT_FILE_VERSION
3735
VALUE "InternalName", "SWT\0"
38-
VALUE "LegalCopyright", "Copyright (c) 2000, 2006 IBM Corp. All Rights Reserved.\0"
36+
VALUE "LegalCopyright", "Copyright (c) 2000, 2025 IBM Corp. All Rights Reserved.\0"
3937
VALUE "OriginalFilename", SWT_ORG_FILENAME
4038
VALUE "ProductName", "Standard Widget Toolkit\0"
4139
VALUE "ProductVersion", "0,0,0,0\0"

bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ AWT_LIB = lib$(AWT_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).jnilib
3333
AWT_OBJECTS = swt_awt.o
3434

3535
#SWT_DEBUG = -g
36-
CFLAGS = -c -xobjective-c -Wall $(ARCHS) -DSWT_VERSION=$(SWT_VERSION) $(SWT_DEBUG) -DUSE_ASSEMBLER -DCOCOA -DATOMIC \
36+
CFLAGS = -c -xobjective-c -Wall $(ARCHS) $(SWT_DEBUG) -DUSE_ASSEMBLER -DCOCOA -DATOMIC \
3737
-I $(SWT_JAVA_HOME)/include \
3838
-I $(SWT_JAVA_HOME)/include/darwin \
3939
-I /System/Library/Frameworks/Cocoa.framework/Headers \

bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ WEBKIT_OBJECTS = swt.o webkitgtk.o webkitgtk_structs.o webkitgtk_stats.o webkitg
100100
GLX_OBJECTS = swt.o glx.o glx_structs.o glx_stats.o
101101

102102
CFLAGS := $(CFLAGS) \
103-
-DSWT_VERSION=$(SWT_VERSION) \
104103
$(SWT_DEBUG) \
105104
$(SWT_WEBKIT_DEBUG) \
106105
-DLINUX -DGTK \

bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/javaw.exe.manifest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
<!--<gdiScaling xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">true</gdiScaling>-->
1717
</windowsSettings>
1818
</application>
19-
<!--Specifically targeting your application for Windows 8.1 or Windows 10: https://msdn.microsoft.com/en-us/library/windows/desktop/dn481241(v=vs.85).aspx -->
19+
<!--Specifically targeting your application for Windows 8.1 or Windows 10: https://learn.microsoft.com/en-us/windows/win32/sysinfo/targeting-your-application-at-windows-8-1?redirectedfrom=MSDN -->
2020
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
2121
<application>
22-
<!-- Windows 10 -->
22+
<!-- Windows 10 and Windows 11 -->
2323
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
2424
<!-- Windows 8.1 -->
2525
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>

bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ WGL_OBJS = wgl.obj wgl_structs.obj wgl_stats.obj
4848

4949
#CFLAGS = $(cdebug) $(cflags) $(cvarsmt) $(CFLAGS) \
5050
CFLAGS = -O1 /WX /W4 -DNDEBUG -DUNICODE -D_UNICODE /c $(cflags) $(cvarsmt) $(CFLAGS) \
51-
-DSWT_VERSION=$(maj_ver)$(min_ver) -DSWT_REVISION=$(rev) -DUSE_ASSEMBLER \
51+
-DUSE_ASSEMBLER \
5252
/I"$(SWT_JAVA_HOME)\include" /I"$(SWT_JAVA_HOME)\include\win32" /I.
5353

54-
RCFLAGS = $(rcflags) $(rcvars) $(RCFLAGS) -DSWT_FILE_VERSION=\"$(maj_ver).$(min_ver).$(rev).0\" -DSWT_COMMA_VERSION=$(comma_ver)
54+
RCFLAGS = $(rcflags) $(rcvars) $(RCFLAGS)
5555
ldebug = /RELEASE /INCREMENTAL:NO /NOLOGO
5656
dlllflags = -dll /WX
5757
guilibsmt = kernel32.lib ws2_32.lib mswsock.lib advapi32.lib bufferoverflowu.lib user32.lib gdi32.lib comdlg32.lib winspool.lib

bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@
1818

1919
#define OS_NATIVE(func) Java_org_eclipse_swt_internal_win32_OS_##func
2020

21-
__declspec(dllexport) HRESULT DllGetVersion(DLLVERSIONINFO *dvi);
22-
HRESULT DllGetVersion(DLLVERSIONINFO *dvi)
23-
{
24-
dvi->dwMajorVersion = SWT_VERSION / 1000;
25-
dvi->dwMinorVersion = SWT_VERSION % 1000;
26-
dvi->dwBuildNumber = SWT_REVISION;
27-
dvi->dwPlatformID = DLLVER_PLATFORM_WINDOWS;
28-
return 1;
29-
}
30-
3121
HINSTANCE g_hInstance = NULL;
3222
BOOL WINAPI DllMain(HANDLE hInstDLL, DWORD dwReason, LPVOID lpvReserved)
3323
{

bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt.rc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
MANIFEST_RESOURCE_ID RT_MANIFEST "javaw.exe.manifest"
2020

2121
VS_VERSION_INFO VERSIONINFO
22-
FILEVERSION SWT_COMMA_VERSION
2322
PRODUCTVERSION 0,0,0,0
2423
FILEFLAGSMASK 0x3fL
2524
#ifdef _DEBUG
@@ -37,9 +36,8 @@ BEGIN
3736
BEGIN
3837
VALUE "CompanyName", "Eclipse Foundation\0"
3938
VALUE "FileDescription", "SWT for Windows native library\0"
40-
VALUE "FileVersion", SWT_FILE_VERSION
4139
VALUE "InternalName", "SWT\0"
42-
VALUE "LegalCopyright", "Copyright (c) 2000, 2011 IBM Corp. All Rights Reserved.\0"
40+
VALUE "LegalCopyright", "Copyright (c) 2000, 2025 IBM Corp. All Rights Reserved.\0"
4341
VALUE "OriginalFilename", SWT_ORG_FILENAME
4442
VALUE "ProductName", "Standard Widget Toolkit\0"
4543
VALUE "ProductVersion", "0,0,0,0\0"

bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt_gdip.rc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "windows.h"
1616

1717
VS_VERSION_INFO VERSIONINFO
18-
FILEVERSION SWT_COMMA_VERSION
1918
PRODUCTVERSION 0,0,0,0
2019
FILEFLAGSMASK 0x3fL
2120
#ifdef _DEBUG
@@ -33,9 +32,8 @@ BEGIN
3332
BEGIN
3433
VALUE "CompanyName", "Eclipse Foundation\0"
3534
VALUE "FileDescription", "SWT for Windows native library\0"
36-
VALUE "FileVersion", SWT_FILE_VERSION
3735
VALUE "InternalName", "SWT\0"
38-
VALUE "LegalCopyright", "Copyright (c) 2000, 2011 IBM Corp. All Rights Reserved.\0"
36+
VALUE "LegalCopyright", "Copyright (c) 2000, 2025 IBM Corp. All Rights Reserved.\0"
3937
VALUE "OriginalFilename", SWT_ORG_FILENAME
4038
VALUE "ProductName", "Standard Widget Toolkit\0"
4139
VALUE "ProductVersion", "0,0,0,0\0"

0 commit comments

Comments
 (0)