Skip to content
This repository was archived by the owner on Jun 19, 2024. It is now read-only.

Commit f574a56

Browse files
authored
Merge pull request #56 from LabyMod/develop
Release version 0.4.6
2 parents 0e49ba8 + 1a85aca commit f574a56

File tree

172 files changed

+17775
-8424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+17775
-8424
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: CI
2-
on: [push]
2+
on: [ push ]
33

44
jobs:
55
build-binaries-unix:
66
strategy:
77
fail-fast: false
88
matrix:
9-
os: [macos-latest, ubuntu-latest]
9+
os: [ macos-latest, ubuntu-latest ]
1010

1111
name: ${{ matrix.os }} build
1212
runs-on: ${{ matrix.os }}
@@ -20,23 +20,22 @@ jobs:
2020
uses: actions/setup-java@v1
2121
with:
2222
java-version: 8
23-
- name: Make gradlew executable
24-
run: "chmod +x gradlew"
2523
- name: Build native with gradle
26-
run: "./gradlew -PCI=true ultralight-java-native:build"
27-
- name: Prepare artifacts
24+
run: "./gradlew -PCI=true -Pultralight-java.base.native-binaries-folder=native-binaries/ultralight ultralight-java-native:build"
25+
shell: bash
26+
- name: Build gpu driver native with gradle
27+
run: "./gradlew -PCI=true -Pultralight-java.base.native-binaries-folder=native-binaries/ultralight -Pultralight-java.gpu.native-binaries-folder=native-binaries/ultralight-gpu ultralight-java-gpu-native:build"
2828
shell: bash
29-
run: |
30-
mkdir artifacts
31-
for file in $(cat ci/binaries); do # File generated by gradle
32-
echo "Found binary artifact ${file}"
33-
cp "${file}" artifacts
34-
done
3529
- name: Upload artifacts
3630
uses: actions/upload-artifact@v1
3731
with:
38-
name: native-binaries
39-
path: artifacts
32+
name: native-binaries-ultralight
33+
path: native-binaries/ultralight
34+
- name: Upload gpu artifacts
35+
uses: actions/upload-artifact@v1
36+
with:
37+
name: native-binaries-ultralight-gpu
38+
path: native-binaries/ultralight-gpu
4039

4140
build-binaries-windows:
4241
name: windows-latest build
@@ -52,24 +51,24 @@ jobs:
5251
with:
5352
java-version: 8
5453
- name: Build native with gradle (Windows)
55-
run: gradlew -PCI=true ultralight-java-native:build
54+
run: "./gradlew -PCI=true -Pultralight-java.base.native-binaries-folder=native-binaries/ultralight ultralight-java-native:build"
55+
shell: cmd
56+
- name: Build gpu driver native with gradle (Windows)
57+
run: "./gradlew -PCI=true -Pultralight-java.base.native-binaries-folder=native-binaries/ultralight -Pultralight-java.gpu.native-binaries-folder=native-binaries/ultralight-gpu ultralight-java-gpu-native:build"
5658
shell: cmd
57-
- name: Prepare artifacts
58-
shell: bash
59-
run: |
60-
mkdir artifacts
61-
for file in $(cat ci/binaries); do # File generated by gradle
62-
echo "Found binary artifact ${file}"
63-
cp "${file}" artifacts
64-
done
6559
- name: Upload artifacts
6660
uses: actions/upload-artifact@v1
6761
with:
68-
name: native-binaries
69-
path: artifacts
62+
name: native-binaries-ultralight
63+
path: native-binaries/ultralight/Debug
64+
- name: Upload gpu artifacts
65+
uses: actions/upload-artifact@v1
66+
with:
67+
name: native-binaries-ultralight-gpu
68+
path: native-binaries/ultralight-gpu/Debug
7069

7170
build-jars:
72-
needs: [build-binaries-unix, build-binaries-windows]
71+
needs: [ build-binaries-unix, build-binaries-windows ]
7372
runs-on: ubuntu-latest # Doesn't matter, but linux tends to be the fastest
7473

7574
name: Build final jars
@@ -86,19 +85,26 @@ jobs:
8685
- name: Download existing artifacts
8786
uses: actions/download-artifact@v1
8887
with:
89-
name: native-binaries
90-
path: native-binaries
88+
name: native-binaries-ultralight
89+
path: native-binaries/ultralight
90+
- name: Download existing gpu artifacts
91+
uses: actions/download-artifact@v1
92+
with:
93+
name: native-binaries-ultralight-gpu
94+
path: native-binaries/ultralight-gpu
9195
- name: Make gradlew executable
9296
run: "chmod +x gradlew"
9397
- name: Build base with gradle
94-
run: "./gradlew -PCI=true -PnativeBinaryExternalDir=native-binaries ultralight-java-base:build"
98+
run: "./gradlew -PCI=true -Pultralight-java.base.native-binaries-folder=native-binaries/ultralight ultralight-java-base:build"
99+
- name: Build gpu driver with gradle
100+
run: './gradlew -PCI=true -Pultralight-java.base.native-binaries-folder=native-binaries/ultralight -Pultralight-java.gpu.native-binaries-folder=native-binaries/ultralight-gpu ultralight-java-gpu:build'
95101
- name: Build lwjgl3-opengl example with gradle
96-
run: "./gradlew -PCI=true -PnativeBinaryExternalDir=native-binaries example:lwjgl3-opengl:build"
102+
run: "./gradlew -PCI=true -Pultralight-java.base.native-binaries-folder=native-binaries/ultralight -Pultralight-java.gpu.native-binaries-folder=native-binaries/ultralight-gpu example:lwjgl3-opengl:build"
97103
- name: Check license
98104
run: "./gradlew licenseCheck"
99105
- name: Deploy to OSSHR
100-
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
101-
run: "./gradlew -PCI=true -PenableSigning -PnativeBinaryExternalDir=native-binaries publish"
106+
if: github.ref == 'refs/heads/master'
107+
run: "./gradlew -PCI=true -PenableSigning -Pultralight-java.base.native-binaries-folder=native-binaries/ultralight -Pultralight-java.gpu.native-binaries-folder=native-binaries/ultralight-gpu publish"
102108
env:
103109
SIGNING_KEY: ${{ secrets.signingKey }}
104110
SIGNING_PASSWORD: ${{ secrets.signingPassword }}

ultralight-java-native/src/main/c/3rdparty/CMakeLists.txt renamed to 3rdparty/cmake/Ultralight.cmake

Lines changed: 93 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,93 @@
1-
################################
2-
# Set up 3rdparty dependencies #
3-
################################
4-
5-
# Set the architecture information for ultralight
6-
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
7-
set(ULTRALIGHT_ARCH "x64")
8-
elseif (CMAKE_SIZEOF_VOID_P EQUAL 4)
9-
set(ULTRALIGHT_ARCH "x86")
10-
else ()
11-
message(FATAL_ERROR "Unsupported pointer size ${CMAKE_SIZEOF_VOID_P}")
12-
endif ()
13-
14-
# Set the OS information for ultralight
15-
if (WIN32)
16-
set(ULTRALIGHT_OS_NAME "win")
17-
set(ULTRALIGHT_LINK_DIRECTORY "lib")
18-
elseif (APPLE)
19-
set(ULTRALIGHT_OS_NAME "mac")
20-
set(ULTRALIGHT_LINK_DIRECTORY "bin")
21-
elseif (UNIX)
22-
set(ULTRALIGHT_OS_NAME "linux")
23-
set(ULTRALIGHT_LINK_DIRECTORY "bin")
24-
else ()
25-
message(FATAL_ERROR "Unsupported operating system")
26-
endif ()
27-
28-
# Ultralight
29-
set(ULTRALIGHT_DIR "${CMAKE_CURRENT_BINARY_DIR}/ultralight-${ULTRALIGHT_OS_NAME}-${ULTRALIGHT_ARCH}")
30-
set(ULTRALIGHT_ARCHIVE "${ULTRALIGHT_DIR}/ultralight.7z")
31-
# 5011dbfee009074ca5883588fc164b5ba44bf165
32-
# Fix repaint bug on Windows (thanks for the report Dark Empath!)
33-
#
34-
# https://github.com/ultralight-ux/Ultralight/tree/5011dbfee009074ca5883588fc164b5ba44bf165
35-
set(ULTRALIGHT_VERSION "5011dbf")
36-
37-
# Check the version of ultralight
38-
set(ULTRALIGHT_VERSION_FILE "${ULTRALIGHT_DIR}/.version")
39-
if (EXISTS "${ULTRALIGHT_VERSION_FILE}")
40-
# The version file exists, read it
41-
file(READ "${ULTRALIGHT_VERSION_FILE}" ULTRALIGHT_INSTALLED_VERSION)
42-
endif ()
43-
44-
# Check if the installed version matches the target version
45-
if (NOT "${ULTRALIGHT_VERSION}" STREQUAL "${ULTRALIGHT_INSTALLED_VERSION}")
46-
# Versions do not match, erase the installed version
47-
file(REMOVE_RECURSE "${ULTRALIGHT_DIR}")
48-
endif ()
49-
50-
# Check if the ultralight directory exists
51-
if (NOT EXISTS "${ULTRALIGHT_DIR}")
52-
# It does not, download ultralight and extract it
53-
file(DOWNLOAD
54-
"https://ultralight-sdk.sfo2.cdn.digitaloceanspaces.com/ultralight-sdk-${ULTRALIGHT_VERSION}-${ULTRALIGHT_OS_NAME}-${ULTRALIGHT_ARCH}.7z"
55-
"${ULTRALIGHT_ARCHIVE}"
56-
SHOW_PROGRESS
57-
STATUS ULTRALIGHT_DOWNLOAD_STATUS
58-
LOG ULTRALIGHT_DOWNLOAD_LOG
59-
)
60-
61-
# Extract the status from the download return value
62-
list(GET ULTRALIGHT_DOWNLOAD_STATUS 0 ULTRALIGHT_DOWNLOAD_ERROR_CODE)
63-
list(GET ULTRALIGHT_DOWNLOAD_STATUS 1 ULTRALIGHT_DOWNLOAD_ERROR_MESSAGE)
64-
65-
# Check the download status
66-
if(NOT ULTRALIGHT_DOWNLOAD_ERROR_CODE EQUAL 0)
67-
# Download failed
68-
message(SEND_ERROR "Failed to download Ultralight: ${ULTRALIGHT_DOWNLOAD_ERROR_MESSAGE}\n\n${ULTRALIGHT_DOWNLOAD_LOG}")
69-
endif()
70-
71-
# Extract it
72-
execute_process(
73-
COMMAND "${CMAKE_COMMAND}" -E tar xvf "${ULTRALIGHT_ARCHIVE}"
74-
WORKING_DIRECTORY "${ULTRALIGHT_DIR}"
75-
RESULT_VARIABLE EXTRACT_ERROR
76-
)
77-
78-
if(EXTRACT_ERROR)
79-
message(FATAL_ERROR "Failed to extract the ultralight zip archive")
80-
endif()
81-
82-
# Delete the archive file
83-
file(REMOVE "${ULTRALIGHT_ARCHIVE}")
84-
85-
# Write the version file
86-
file(WRITE "${ULTRALIGHT_VERSION_FILE}" "${ULTRALIGHT_VERSION}")
87-
endif ()
88-
89-
# Add the ultralight target
90-
add_library(ultralight INTERFACE)
91-
target_include_directories(ultralight INTERFACE "${ULTRALIGHT_DIR}/include")
92-
target_link_directories(ultralight INTERFACE "${ULTRALIGHT_DIR}/${ULTRALIGHT_LINK_DIRECTORY}")
93-
target_link_libraries(ultralight INTERFACE AppCore Ultralight UltralightCore WebCore)
1+
################################
2+
# Set up 3rdparty dependencies #
3+
################################
4+
5+
# Set the architecture information for ultralight
6+
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
7+
set(ULTRALIGHT_ARCH "x64")
8+
elseif (CMAKE_SIZEOF_VOID_P EQUAL 4)
9+
set(ULTRALIGHT_ARCH "x86")
10+
else ()
11+
message(FATAL_ERROR "Unsupported pointer size ${CMAKE_SIZEOF_VOID_P}")
12+
endif ()
13+
14+
# Set the OS information for ultralight
15+
if (WIN32)
16+
set(ULTRALIGHT_OS_NAME "win")
17+
set(ULTRALIGHT_LINK_DIRECTORY "lib")
18+
elseif (APPLE)
19+
set(ULTRALIGHT_OS_NAME "mac")
20+
set(ULTRALIGHT_LINK_DIRECTORY "bin")
21+
elseif (UNIX)
22+
set(ULTRALIGHT_OS_NAME "linux")
23+
set(ULTRALIGHT_LINK_DIRECTORY "bin")
24+
else ()
25+
message(FATAL_ERROR "Unsupported operating system")
26+
endif ()
27+
28+
# Ultralight
29+
set(ULTRALIGHT_DIR "${CMAKE_CURRENT_BINARY_DIR}/ultralight-${ULTRALIGHT_OS_NAME}-${ULTRALIGHT_ARCH}")
30+
set(ULTRALIGHT_ARCHIVE "${ULTRALIGHT_DIR}/ultralight.7z")
31+
# 5011dbfee009074ca5883588fc164b5ba44bf165
32+
# Fix repaint bug on Windows (thanks for the report Dark Empath!)
33+
#
34+
# https://github.com/ultralight-ux/Ultralight/tree/5011dbfee009074ca5883588fc164b5ba44bf165
35+
set(ULTRALIGHT_VERSION "5011dbf")
36+
37+
# Check the version of ultralight
38+
set(ULTRALIGHT_VERSION_FILE "${ULTRALIGHT_DIR}/.version")
39+
if (EXISTS "${ULTRALIGHT_VERSION_FILE}")
40+
# The version file exists, read it
41+
file(READ "${ULTRALIGHT_VERSION_FILE}" ULTRALIGHT_INSTALLED_VERSION)
42+
endif ()
43+
44+
# Check if the installed version matches the target version
45+
if (NOT "${ULTRALIGHT_VERSION}" STREQUAL "${ULTRALIGHT_INSTALLED_VERSION}")
46+
# Versions do not match, erase the installed version
47+
file(REMOVE_RECURSE "${ULTRALIGHT_DIR}")
48+
endif ()
49+
50+
# Check if the ultralight directory exists
51+
if (NOT EXISTS "${ULTRALIGHT_DIR}")
52+
# It does not, download ultralight and extract it
53+
file(DOWNLOAD
54+
"https://ultralight-sdk.sfo2.cdn.digitaloceanspaces.com/ultralight-sdk-${ULTRALIGHT_VERSION}-${ULTRALIGHT_OS_NAME}-${ULTRALIGHT_ARCH}.7z"
55+
"${ULTRALIGHT_ARCHIVE}"
56+
SHOW_PROGRESS
57+
STATUS ULTRALIGHT_DOWNLOAD_STATUS
58+
LOG ULTRALIGHT_DOWNLOAD_LOG
59+
)
60+
61+
# Extract the status from the download return value
62+
list(GET ULTRALIGHT_DOWNLOAD_STATUS 0 ULTRALIGHT_DOWNLOAD_ERROR_CODE)
63+
list(GET ULTRALIGHT_DOWNLOAD_STATUS 1 ULTRALIGHT_DOWNLOAD_ERROR_MESSAGE)
64+
65+
# Check the download status
66+
if(NOT ULTRALIGHT_DOWNLOAD_ERROR_CODE EQUAL 0)
67+
# Download failed
68+
message(SEND_ERROR "Failed to download Ultralight: ${ULTRALIGHT_DOWNLOAD_ERROR_MESSAGE}\n\n${ULTRALIGHT_DOWNLOAD_LOG}")
69+
endif()
70+
71+
# Extract it
72+
execute_process(
73+
COMMAND "${CMAKE_COMMAND}" -E tar xvf "${ULTRALIGHT_ARCHIVE}"
74+
WORKING_DIRECTORY "${ULTRALIGHT_DIR}"
75+
RESULT_VARIABLE EXTRACT_ERROR
76+
)
77+
78+
if(EXTRACT_ERROR)
79+
message(FATAL_ERROR "Failed to extract the ultralight zip archive")
80+
endif()
81+
82+
# Delete the archive file
83+
file(REMOVE "${ULTRALIGHT_ARCHIVE}")
84+
85+
# Write the version file
86+
file(WRITE "${ULTRALIGHT_VERSION_FILE}" "${ULTRALIGHT_VERSION}")
87+
endif ()
88+
89+
# Add the ultralight target
90+
add_library(ultralight INTERFACE)
91+
target_include_directories(ultralight INTERFACE "${ULTRALIGHT_DIR}/include")
92+
target_link_directories(ultralight INTERFACE "${ULTRALIGHT_DIR}/${ULTRALIGHT_LINK_DIRECTORY}")
93+
target_link_libraries(ultralight INTERFACE AppCore Ultralight UltralightCore WebCore)

0 commit comments

Comments
 (0)