Skip to content

Commit 89b8dc7

Browse files
committed
Also release the win-x86 DLL
1 parent 9684a81 commit 89b8dc7

File tree

4 files changed

+33
-30
lines changed

4 files changed

+33
-30
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,24 @@ jobs:
4141
CALL bootstrap.bat
4242
4343
- name: 'Compress documentation for release'
44-
if: github.ref == 'refs/heads/main'
4544
shell: pwsh
4645
run: |
4746
Compress-Archive -Path dist\doc\* -DestinationPath dist\documentation.zip
4847
4948
- name: 'Compress .jar files for release'
50-
if: github.ref == 'refs/heads/main'
5149
shell: pwsh
5250
run: |
5351
Compress-Archive -Path dist\*.jar -DestinationPath dist\java.zip
5452
55-
- name: 'Compress .dll files for release'
56-
if: github.ref == 'refs/heads/main'
53+
- name: 'Compress win-x64 DLL file for release'
5754
shell: pwsh
5855
run: |
59-
Compress-Archive -Path dist\*.dll -DestinationPath dist\win-x64.zip
56+
Compress-Archive -Path build_x64\Release\AdsToJava-3.dll -DestinationPath dist\win-x64.zip
57+
58+
- name: 'Compress win-x86 DLL file for release'
59+
shell: pwsh
60+
run: |
61+
Compress-Archive -Path build_win32\Release\AdsToJava-3.dll -DestinationPath dist\win-x86.zip
6062
6163
- name: Create release
6264
if: github.ref == 'refs/heads/main'
@@ -101,3 +103,14 @@ jobs:
101103
asset_path: ./dist/win-x64.zip
102104
asset_name: win-x64.zip
103105
asset_content_type: application/zip
106+
107+
- name: 'Upload release asset: win-x86.zip'
108+
if: github.ref == 'refs/heads/main'
109+
uses: actions/upload-release-asset@v1
110+
env:
111+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112+
with:
113+
upload_url: ${{ steps.create_release.outputs.upload_url }}
114+
asset_path: ./dist/win-x86.zip
115+
asset_name: win-x86.zip
116+
asset_content_type: application/zip

cpp/CMakeLists.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.18.0)
2-
project(AdsToJava VERSION 3.0.0)
2+
project(AdsToJava-3 VERSION 3.0.0)
33

44
set(CMAKE_CXX_STANDARD 17)
55
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -29,17 +29,17 @@ if(MSVC)
2929
${CMAKE_CURRENT_SOURCE_DIR}/version.rc.in
3030
${CMAKE_CURRENT_BINARY_DIR}/version.rc
3131
@ONLY)
32-
add_library(AdsToJava SHARED ${SOURCES}
32+
add_library(AdsToJava-3 SHARED ${SOURCES}
3333
${CMAKE_CURRENT_BINARY_DIR}/version.rc)
3434

3535
if (STRICT_WARNINGS)
36-
target_compile_options(AdsToJava PRIVATE /W4 /WX)
36+
target_compile_options(AdsToJava-3 PRIVATE /W4 /WX)
3737
endif()
3838
else()
39-
add_library(AdsToJava SHARED ${SOURCES})
39+
add_library(AdsToJava-3 SHARED ${SOURCES})
4040

4141
if (STRICT_WARNINGS)
42-
target_compile_options(AdsToJava PRIVATE -Wall -Wextra -Wpedantic -Werror)
42+
target_compile_options(AdsToJava-3 PRIVATE -Wall -Wextra -Wpedantic -Werror)
4343
endif()
4444
endif()
4545

@@ -48,17 +48,17 @@ if (NOT WIN32)
4848
add_compile_definitions(POSIX)
4949
endif()
5050

51-
target_include_directories(AdsToJava PRIVATE "$ENV{JAVA_HOME}/include/")
51+
target_include_directories(AdsToJava-3 PRIVATE "$ENV{JAVA_HOME}/include/")
5252
if (WIN32)
53-
target_include_directories(AdsToJava PRIVATE "$ENV{JAVA_HOME}/include/win32/")
53+
target_include_directories(AdsToJava-3 PRIVATE "$ENV{JAVA_HOME}/include/win32/")
5454
elseif (EXISTS "$ENV{JAVA_HOME}/include/freebsd")
55-
target_include_directories(AdsToJava PRIVATE "$ENV{JAVA_HOME}/include/freebsd/")
55+
target_include_directories(AdsToJava-3 PRIVATE "$ENV{JAVA_HOME}/include/freebsd/")
5656
else()
57-
target_include_directories(AdsToJava PRIVATE "$ENV{JAVA_HOME}/include/unix/")
57+
target_include_directories(AdsToJava-3 PRIVATE "$ENV{JAVA_HOME}/include/unix/")
5858
endif()
5959

6060
if (EXISTS "dependencies")
61-
target_include_directories(AdsToJava PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/AdsApi/TcAdsDll/Include/")
61+
target_include_directories(AdsToJava-3 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/AdsApi/TcAdsDll/Include/")
6262
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
6363
find_library(TC_ADS_DLL_LIBRARY NAMES "TcAdsDll" "libTcAdsDll" HINTS "${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/AdsApi/TcAdsDll/Lib/" REQUIRED)
6464
else()
@@ -78,9 +78,9 @@ elseif (WIN32)
7878

7979
if(EXISTS "${TWINCAT_INSTALL_DIR}/sdk/Include")
8080
# preferring the sdk/Include directory because the header files from ../AdsApi/TcAdsDll/Include/ might be too old
81-
target_include_directories(AdsToJava PRIVATE "${TWINCAT_INSTALL_DIR}/sdk/Include/")
81+
target_include_directories(AdsToJava-3 PRIVATE "${TWINCAT_INSTALL_DIR}/sdk/Include/")
8282
else()
83-
target_include_directories(AdsToJava PRIVATE "${TWINCAT_INSTALL_DIR}/../AdsApi/TcAdsDll/Include")
83+
target_include_directories(AdsToJava-3 PRIVATE "${TWINCAT_INSTALL_DIR}/../AdsApi/TcAdsDll/Include")
8484
endif()
8585

8686
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
@@ -89,14 +89,14 @@ elseif (WIN32)
8989
find_library(TC_ADS_DLL_LIBRARY NAMES "TcAdsDll" HINTS "${TWINCAT_INSTALL_DIR}/../AdsApi/TcAdsDll/Lib/x64/" "${TWINCAT_INSTALL_DIR}/../AdsApi/TcAdsDll/x64/lib/" REQUIRED)
9090
endif()
9191
else()
92-
target_include_directories(AdsToJava PRIVATE "/usr/local/include/")
92+
target_include_directories(AdsToJava-3 PRIVATE "/usr/local/include/")
9393
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
9494
find_library(TC_ADS_DLL_LIBRARY NAMES "libTcAdsDll" HINTS "/usr/local/lib32/" REQUIRED)
9595
else()
9696
find_library(TC_ADS_DLL_LIBRARY NAMES "libTcAdsDll" HINTS "/usr/local/lib/" REQUIRED)
9797
endif()
9898
endif()
99-
target_link_libraries(AdsToJava "${TC_ADS_DLL_LIBRARY}")
99+
target_link_libraries(AdsToJava-3 "${TC_ADS_DLL_LIBRARY}")
100100

101101
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
102102
get_filename_component(SDK_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" REALPATH)
@@ -113,7 +113,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
113113

114114
list(GET EXISTING_KIT_VER_BIND_DIRS 0 LATEST_EXISTING_KIT_VER_BIND_DIR)
115115
find_library(VERSION_LIBRARY NAMES "Version" HINTS "${LATEST_EXISTING_KIT_VER_BIND_DIR}" REQUIRED)
116-
target_link_libraries(AdsToJava "${VERSION_LIBRARY}")
116+
target_link_libraries(AdsToJava-3 "${VERSION_LIBRARY}")
117117
endif()
118118

119119
set(CPACK_PROJECT_NAME ${PROJECT_NAME})

run/copy_to_dist.bat

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,3 @@ IF EXIST build_x64 (
1414
)
1515
)
1616
)
17-
IF EXIST dist\AdsToJava.dll (
18-
move dist\AdsToJava.dll dist\AdsToJava-3.dll || exit /b %errorlevel%
19-
)

run/copy_to_dist.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,3 @@ elif [ -d "./build" ]; then
1616
cp ./build/Release/*.dll ./dist/
1717
fi
1818
fi
19-
20-
if [ -f "./dist/AdsToJava.dll" ]; then
21-
mv ./dist/AdsToJava.dll ./dist/AdsToJava-3.dll
22-
fi
23-
if [ -f "./dist/libAdsToJava.so" ]; then
24-
mv ./dist/libAdsToJava.so ./dist/libAdsToJava-3.so
25-
fi

0 commit comments

Comments
 (0)