Skip to content

Commit

Permalink
Everywhere: Move the Ladybird folder to UI
Browse files Browse the repository at this point in the history
  • Loading branch information
trflynn89 authored and awesomekling committed Nov 10, 2024
1 parent 93712b2 commit db47cc4
Show file tree
Hide file tree
Showing 203 changed files with 266 additions and 244 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lagom-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: libweb-test-artifacts-${{ inputs.os_name }}
path: ${{ github.workspace }}/Build/Ladybird/test-dumps
path: ${{ github.workspace }}/Build/UI/test-dumps
retention-days: 7
if-no-files-found: ignore

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
# === BUILD ===

- name: Build and Test
working-directory: ${{ github.workspace }}/Ladybird/Android
working-directory: ${{ github.workspace }}/UI/Android
run: ./gradlew connectedAndroidTest
env:
GRADLE_OPTS: '-Xmx3072m'
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if (VCPKG_TARGET_ANDROID)
# If we are building for Android, we must load vcpkg_android.cmake before the project() declaration.
# This ensures that the CMAKE_TOOLCHAIN_FILE is set correctly.
# (we cannot set CMAKE_TOOLCHAIN_FILE from Gradle, unfortunately, so this is the only place we can do it.)
include("Ladybird/Android/vcpkg_android.cmake")
include("UI/Android/vcpkg_android.cmake")
endif()

# Pass additional information to vcpkg toolchain files if we are using vcpkg.
Expand All @@ -28,7 +28,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(LADYBIRD_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
list(APPEND CMAKE_MODULE_PATH "${LADYBIRD_SOURCE_DIR}/Meta/CMake")

include(Ladybird/cmake/EnableLagom.cmake)
include(UI/cmake/EnableLagom.cmake)
include(use_linker)
include(lagom_options NO_POLICY_SCOPE)
include(lagom_compile_options)
Expand Down Expand Up @@ -90,7 +90,7 @@ include(CTest) # for BUILD_TESTING option, default ON

if (ENABLE_GUI_TARGETS)
add_subdirectory(Services)
add_subdirectory(Ladybird)
add_subdirectory(UI)
endif()

add_custom_target(lint-shell-scripts
Expand Down
4 changes: 2 additions & 2 deletions Documentation/BuildInstructionsLadybird.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ pkgman install cmake cmd:python3 ninja openal_devel qt6_base_devel qt6_multimedi
### Android:

On a Unix-like platform, install the prerequisites for that platform and then see the [Android Studio guide](EditorConfiguration/AndroidStudioConfiguration.md).
Or, download a version of Gradle >= 8.0.0, and run the ``gradlew`` program in ``Ladybird/Android``
Or, download a version of Gradle >= 8.0.0, and run the ``gradlew`` program in ``UI/Android``

## Build steps

Expand Down Expand Up @@ -281,7 +281,7 @@ The script Meta/ladybird.sh and the default preset in CMakePresets.json both def
`Build/release`. For distribution purposes, or when building multiple configurations, it may be useful to create a custom
CMake build directory.

The install rules in Ladybird/cmake/InstallRules.cmake define which binaries and libraries will be
The install rules in UI/cmake/InstallRules.cmake define which binaries and libraries will be
installed into the configured CMAKE_PREFIX_PATH or path passed to ``cmake --install``.

Note that when using a custom build directory rather than Meta/ladybird.sh, the user may need to provide
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ Ensure that your system has the following tools available:

## Opening the project

After opening the ``ladybird`` directory in Android Studio (NOT the Ladybird/Android directory!)
After opening the ``ladybird`` directory in Android Studio (NOT the UI/Android directory!)
there should be a pop-up in the bottom left indicating that an Android Gradle project was detected
in ``Ladybird/Android``.
in ``UI/Android``.

In the top left of the screen in the Project view, navigate to ``Ladybird/Android``. Or, click the
In the top left of the screen in the Project view, navigate to ``UI/Android``. Or, click the
highlighted text in the notification for that path. Open the ``settings.gradle.kts`` file. At the
top of the file should be a banner that says ``Code Insight unavailable (related Gradle project not
linked).`` Click the ``Link Gradle project`` text on the right side of the banner. After the IDE
Expand Down
4 changes: 2 additions & 2 deletions Documentation/Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Tests of internal C++ code go in their own `TestFoo.cpp` file in `Tests/LibWeb`.
> To reproduce a CI failure, see the section on [Running with Sanitizers](#running-with-sanitizers).
The easiest way to run tests is to use the `ladybird.sh` script. The LibWeb tests are registered with CMake as a test in
`Ladybird/CMakeLists.txt`. Using the built-in test filtering, you can run all tests with `Meta/ladybird.sh test` or run
`UI/CMakeLists.txt`. Using the built-in test filtering, you can run all tests with `Meta/ladybird.sh test` or run
just the LibWeb tests with `Meta/ladybird.sh test LibWeb`. The second way is to invoke the headless browser test runner
directly. See the invocation in `Ladybird/CMakeLists.txt` for the expected command line arguments.
directly. See the invocation in `UI/CMakeLists.txt` for the expected command line arguments.

A third way is to invoke `ctest` directly. The simplest method is to use the `default` preset from ``CMakePresets.json``:

Expand Down
Empty file.
2 changes: 1 addition & 1 deletion Meta/Lagom/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Lagom is used by the Serenity project in the following ways:
- [Build tools](./Tools) required to build Serenity itself using Serenity's own C++ libraries are in Lagom.
- [Unit tests](../../Documentation/Testing.md) in CI are built using the Lagom build for host systems to ensure portability.
- [Continuous fuzzing](#fuzzing-on-oss-fuzz) is done with the help of OSS-fuzz using the Lagom build.
- [The Ladybird browser](../../Ladybird/README.md) uses Lagom to provide LibWeb and LibJS for non-Serenity systems.
- [The Ladybird browser](../../README.md) uses Lagom to provide LibWeb and LibJS for non-Serenity systems.
- [ECMA 262 spec tests](https://ladybirdbrowser.github.io/libjs-website/test262) for LibJS are run per-commit and tracked on [LibJS website](https://ladybirdbrowser.github.io/libjs-website/).
- [Wasm spec tests](https://ladybirdbrowser.github.io/libjs-website/wasm) for LibWasm are run per-commit and tracked on [LibJS website](https://ladybirdbrowser.github.io/libjs-website/).

Expand Down
9 changes: 1 addition & 8 deletions Meta/check-style.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@

# We check that "#pragma once" is present
PRAGMA_ONCE_STRING = '#pragma once'
PRAGMA_ONCE_CHECK_EXCLUDES = {
'Ladybird/AppKit/System/Detail/Header.h',
'Ladybird/AppKit/System/Detail/Footer.h',
}

# We make sure that there's a blank line before and after pragma once
GOOD_PRAGMA_ONCE_PATTERN = re.compile('(^|\\S\n\n)#pragma once(\n\n\\S.|$)')
Expand Down Expand Up @@ -105,10 +101,7 @@ def run():
if not GOOD_LICENSE_HEADER_PATTERN.search(file_content):
errors_license.append(filename)
if filename.endswith('.h'):
if is_in_prefix_list(filename, PRAGMA_ONCE_CHECK_EXCLUDES):
# File was excluded
pass
elif GOOD_PRAGMA_ONCE_PATTERN.search(file_content):
if GOOD_PRAGMA_ONCE_PATTERN.search(file_content):
# Excellent, the formatting is correct.
pass
elif PRAGMA_ONCE_STRING in file_content:
Expand Down
6 changes: 3 additions & 3 deletions Services/ImageDecoder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ set(SOURCES

if (ANDROID)
add_library(imagedecoderservice SHARED
${LADYBIRD_SOURCE_DIR}/Ladybird/Android/src/main/cpp/ImageDecoderService.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/Android/src/main/cpp/LadybirdServiceBaseJNI.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/Utilities.cpp
${LADYBIRD_SOURCE_DIR}/UI/Android/src/main/cpp/ImageDecoderService.cpp
${LADYBIRD_SOURCE_DIR}/UI/Android/src/main/cpp/LadybirdServiceBaseJNI.cpp
${LADYBIRD_SOURCE_DIR}/UI/Utilities.cpp
${SOURCES}
)
else()
Expand Down
6 changes: 3 additions & 3 deletions Services/RequestServer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ set(SOURCES

if (ANDROID)
add_library(requestserverservice SHARED
${LADYBIRD_SOURCE_DIR}/Ladybird/Android/src/main/cpp/RequestServerService.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/Android/src/main/cpp/LadybirdServiceBaseJNI.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/Utilities.cpp
${LADYBIRD_SOURCE_DIR}/UI/Android/src/main/cpp/RequestServerService.cpp
${LADYBIRD_SOURCE_DIR}/UI/Android/src/main/cpp/LadybirdServiceBaseJNI.cpp
${LADYBIRD_SOURCE_DIR}/UI/Utilities.cpp
${SOURCES}
)
else()
Expand Down
30 changes: 15 additions & 15 deletions Services/WebContent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ include(fontconfig)
include(pulseaudio)

set(SOURCES
${LADYBIRD_SOURCE_DIR}/Ladybird/FontPlugin.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/HelperProcess.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/ImageCodecPlugin.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/Utilities.cpp
${LADYBIRD_SOURCE_DIR}/UI/FontPlugin.cpp
${LADYBIRD_SOURCE_DIR}/UI/HelperProcess.cpp
${LADYBIRD_SOURCE_DIR}/UI/ImageCodecPlugin.cpp
${LADYBIRD_SOURCE_DIR}/UI/Utilities.cpp
ConnectionFromClient.cpp
ConsoleGlobalEnvironmentExtensions.cpp
BackingStoreManager.cpp
Expand All @@ -17,10 +17,10 @@ set(SOURCES

if (ANDROID)
add_library(webcontentservice SHARED
${LADYBIRD_SOURCE_DIR}/Ladybird/Android/src/main/cpp/WebContentService.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/Android/src/main/cpp/WebContentServiceJNI.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/Android/src/main/cpp/LadybirdServiceBaseJNI.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/Android/src/main/cpp/JNIHelpers.cpp
${LADYBIRD_SOURCE_DIR}/UI/Android/src/main/cpp/WebContentService.cpp
${LADYBIRD_SOURCE_DIR}/UI/Android/src/main/cpp/WebContentServiceJNI.cpp
${LADYBIRD_SOURCE_DIR}/UI/Android/src/main/cpp/LadybirdServiceBaseJNI.cpp
${LADYBIRD_SOURCE_DIR}/UI/Android/src/main/cpp/JNIHelpers.cpp
${SOURCES}
)
target_link_libraries(webcontentservice PRIVATE android)
Expand All @@ -41,9 +41,9 @@ endif()

if (ENABLE_QT)
qt_add_executable(WebContent
${LADYBIRD_SOURCE_DIR}/Ladybird/Qt/EventLoopImplementationQt.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/Qt/EventLoopImplementationQtEventTarget.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/Qt/StringUtils.cpp
${LADYBIRD_SOURCE_DIR}/UI/Qt/EventLoopImplementationQt.cpp
${LADYBIRD_SOURCE_DIR}/UI/Qt/EventLoopImplementationQtEventTarget.cpp
${LADYBIRD_SOURCE_DIR}/UI/Qt/StringUtils.cpp
main.cpp
)
target_link_libraries(WebContent PRIVATE Qt::Core)
Expand All @@ -53,8 +53,8 @@ if (ENABLE_QT)
find_package(Qt6 REQUIRED COMPONENTS Multimedia)

target_sources(WebContent PRIVATE
${LADYBIRD_SOURCE_DIR}/Ladybird/Qt/AudioCodecPluginQt.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/Qt/AudioThread.cpp
${LADYBIRD_SOURCE_DIR}/UI/Qt/AudioCodecPluginQt.cpp
${LADYBIRD_SOURCE_DIR}/UI/Qt/AudioThread.cpp
)

target_link_libraries(WebContent PRIVATE Qt::Multimedia)
Expand All @@ -68,8 +68,8 @@ target_link_libraries(WebContent PRIVATE webcontentservice LibURL)

target_sources(webcontentservice PUBLIC FILE_SET ladybird TYPE HEADERS
BASE_DIRS ${LADYBIRD_SOURCE_DIR}
FILES ${LADYBIRD_SOURCE_DIR}/Ladybird/FontPlugin.h
${LADYBIRD_SOURCE_DIR}/Ladybird/ImageCodecPlugin.h
FILES ${LADYBIRD_SOURCE_DIR}/UI/FontPlugin.h
${LADYBIRD_SOURCE_DIR}/UI/ImageCodecPlugin.h
)
target_sources(webcontentservice PUBLIC FILE_SET server TYPE HEADERS
BASE_DIRS ${LADYBIRD_SOURCE_DIR}/Services
Expand Down
10 changes: 5 additions & 5 deletions Services/WebContent/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
*/

#include <AK/LexicalPath.h>
#include <Ladybird/FontPlugin.h>
#include <Ladybird/ImageCodecPlugin.h>
#include <Ladybird/Utilities.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/EventLoop.h>
#include <LibCore/LocalServer.h>
Expand All @@ -29,16 +26,19 @@
#include <LibWeb/PermissionsPolicy/AutoplayAllowlist.h>
#include <LibWeb/Platform/AudioCodecPluginAgnostic.h>
#include <LibWeb/Platform/EventLoopPluginSerenity.h>
#include <UI/FontPlugin.h>
#include <UI/ImageCodecPlugin.h>
#include <UI/Utilities.h>
#include <WebContent/ConnectionFromClient.h>
#include <WebContent/PageClient.h>
#include <WebContent/WebDriverConnection.h>

#if defined(HAVE_QT)
# include <Ladybird/Qt/EventLoopImplementationQt.h>
# include <QCoreApplication>
# include <UI/Qt/EventLoopImplementationQt.h>

# if defined(HAVE_QT_MULTIMEDIA)
# include <Ladybird/Qt/AudioCodecPluginQt.h>
# include <UI/Qt/AudioCodecPluginQt.h>
# endif
#endif

Expand Down
2 changes: 1 addition & 1 deletion Services/WebDriver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set(SOURCES
${LADYBIRD_SOURCE_DIR}/Ladybird/Utilities.cpp
${LADYBIRD_SOURCE_DIR}/UI/Utilities.cpp
Client.cpp
Session.cpp
WebContentConnection.cpp
Expand Down
2 changes: 1 addition & 1 deletion Services/WebDriver/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

#include <AK/Platform.h>
#include <Ladybird/Utilities.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/Directory.h>
#include <LibCore/EventLoop.h>
Expand All @@ -15,6 +14,7 @@
#include <LibCore/TCPServer.h>
#include <LibMain/Main.h>
#include <LibWeb/WebDriver/Capabilities.h>
#include <UI/Utilities.h>
#include <WebDriver/Client.h>

static Vector<ByteString> certificates;
Expand Down
12 changes: 6 additions & 6 deletions Services/WebWorker/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
include(fontconfig)

set(WEBWORKER_SOURCES
${LADYBIRD_SOURCE_DIR}/Ladybird/FontPlugin.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/HelperProcess.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/Utilities.cpp
${LADYBIRD_SOURCE_DIR}/UI/FontPlugin.cpp
${LADYBIRD_SOURCE_DIR}/UI/HelperProcess.cpp
${LADYBIRD_SOURCE_DIR}/UI/Utilities.cpp
ConnectionFromClient.cpp
DedicatedWorkerHost.cpp
PageHost.cpp
Expand All @@ -26,9 +26,9 @@ endif()

if (ENABLE_QT)
qt_add_executable(WebWorker
${LADYBIRD_SOURCE_DIR}/Ladybird/Qt/EventLoopImplementationQt.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/Qt/EventLoopImplementationQtEventTarget.cpp
${LADYBIRD_SOURCE_DIR}/Ladybird/Qt/StringUtils.cpp
${LADYBIRD_SOURCE_DIR}/UI/Qt/EventLoopImplementationQt.cpp
${LADYBIRD_SOURCE_DIR}/UI/Qt/EventLoopImplementationQtEventTarget.cpp
${LADYBIRD_SOURCE_DIR}/UI/Qt/StringUtils.cpp
main.cpp
)
target_link_libraries(WebWorker PRIVATE Qt::Core)
Expand Down
8 changes: 4 additions & 4 deletions Services/WebWorker/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
* SPDX-License-Identifier: BSD-2-Clause
*/

#include <Ladybird/FontPlugin.h>
#include <Ladybird/HelperProcess.h>
#include <Ladybird/Utilities.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/EventLoop.h>
#include <LibCore/LocalServer.h>
Expand All @@ -22,11 +19,14 @@
#include <LibWeb/Platform/EventLoopPlugin.h>
#include <LibWeb/Platform/EventLoopPluginSerenity.h>
#include <LibWeb/WebSockets/WebSocket.h>
#include <UI/FontPlugin.h>
#include <UI/HelperProcess.h>
#include <UI/Utilities.h>
#include <WebWorker/ConnectionFromClient.h>

#if defined(HAVE_QT)
# include <Ladybird/Qt/EventLoopImplementationQt.h>
# include <QCoreApplication>
# include <UI/Qt/EventLoopImplementationQt.h>
#endif

static ErrorOr<void> initialize_resource_loader(JS::Heap&, int request_server_socket);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <AK/HashMap.h>
#include <AK/LexicalPath.h>
#include <AK/OwnPtr.h>
#include <Ladybird/Utilities.h>
#include <LibArchive/TarStream.h>
#include <LibCore/DirIterator.h>
#include <LibCore/Directory.h>
Expand All @@ -20,6 +19,7 @@
#include <LibCore/Timer.h>
#include <LibFileSystem/FileSystem.h>
#include <LibWebView/Application.h>
#include <UI/Utilities.h>
#include <jni.h>

static ErrorOr<void> extract_tar_archive(String archive_file, ByteString output_directory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include "LadybirdServiceBase.h"
#include <AK/Atomic.h>
#include <AK/Format.h>
#include <Ladybird/Utilities.h>
#include <LibCore/ResourceImplementationFile.h>
#include <UI/Utilities.h>
#include <jni.h>

JavaVM* global_vm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "LadybirdServiceBase.h"
#include <AK/LexicalPath.h>
#include <AK/OwnPtr.h>
#include <Ladybird/Utilities.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/EventLoop.h>
#include <LibCore/LocalServer.h>
Expand All @@ -19,6 +18,7 @@
#include <RequestServer/ConnectionFromClient.h>
#include <RequestServer/HttpProtocol.h>
#include <RequestServer/HttpsProtocol.h>
#include <UI/Utilities.h>

// FIXME: Share b/w RequestServer and WebSocket
static ErrorOr<ByteString> find_certificates(StringView serenity_resource_root)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
#include "WebContentService.h"
#include "LadybirdServiceBase.h"
#include <AK/LexicalPath.h>
#include <Ladybird/FontPlugin.h>
#include <Ladybird/HelperProcess.h>
#include <Ladybird/ImageCodecPlugin.h>
#include <Ladybird/Utilities.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/EventLoop.h>
#include <LibCore/LocalServer.h>
Expand All @@ -29,6 +25,10 @@
#include <LibWeb/Platform/AudioCodecPluginAgnostic.h>
#include <LibWeb/Platform/EventLoopPluginSerenity.h>
#include <LibWebView/RequestServerAdapter.h>
#include <UI/FontPlugin.h>
#include <UI/HelperProcess.h>
#include <UI/ImageCodecPlugin.h>
#include <UI/Utilities.h>
#include <WebContent/ConnectionFromClient.h>
#include <WebContent/PageHost.h>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit db47cc4

Please sign in to comment.