Skip to content

Commit 38f236a

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 (only) for Windows. It also removes declared constants that define such values for C-compilers from the build-scripts for all platforms, as they are not used (anymore, for Windows). Consequently the library-version information is only captured in the name of the native binary files and in the 'Library' java class. The previously built-in version-information (in the Windows binaries) is not used anywhere by SWT. It was just displayed if one inspected the 'Details' sectuin in the Properties-dialog of Windows file-explorer. With this removal it becomes possible 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 8ae6a51 commit 38f236a

File tree

11 files changed

+19
-47
lines changed

11 files changed

+19
-47
lines changed

Jenkinsfile

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -160,25 +160,19 @@ pipeline {
160160
}
161161
if (nativesChanged || params.forceNativeBuilds) {
162162
NATIVES_CHANGED = true
163-
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 '''
163+
def versions = getSWTVersions()
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}"
173-
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"
176-
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-
}
170+
echo "Incrementing version from ${versions.swt_version} to ${versions.new_version}"
171+
sed -i -e "s/REVISION = ${versions.rev}/REVISION = ${versions.new_rev}/g" \
172+
'bundles/org.eclipse.swt/Eclipse SWT PI/common/org/eclipse/swt/internal/Library.java'
173+
sed -i -e "s/rev=${versions.rev}/rev=${versions.new_rev}/g" \
174+
'bundles/org.eclipse.swt/Eclipse SWT/common/library/make_common.mak'
175+
"""
182176
// Collect SWT-native's sources
183177
dir('bundles/org.eclipse.swt') {
184178
for (ws in ['cocoa', 'gtk', 'win32']) {
@@ -348,13 +342,11 @@ pipeline {
348342
archiveArtifacts allowEmptyArchive: true, artifacts: '**/*.log,*/binaries/*/target/*.jar', excludes: '**/*-sources.jar'
349343
discoverGitReferenceBuild referenceJob: 'eclipse.platform.swt/master'
350344
// To accept unstable builds (test errors or new warnings introduced by third party changes) as reference using "ignoreQualityGate:true"
351-
recordIssues enabledForFailure: true, publishAllIssues: true, ignoreQualityGate:true,
352-
tools: [
345+
recordIssues enabledForFailure: true, publishAllIssues: true, ignoreQualityGate: true, tools: [
353346
eclipse(name: 'Compiler', pattern: '**/target/compilelogs/*.xml'),
354347
issues(name: 'API Tools', id: 'apitools', pattern: '**/target/apianalysis/*.xml'),
355348
javaDoc()
356-
],
357-
qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]]
349+
], qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]]
358350
recordIssues enabledForFailure: true, publishAllIssues: true, ignoreQualityGate:true, tool: mavenConsole(), qualityGates: [[threshold: 1, type: 'DELTA_ERROR', unstable: true]]
359351
}
360352
}

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 -->
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)