mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
Ladybird/Android: Move gradle files to Ladybird/Android directory
And add documentation for how to use the thing
This commit is contained in:
parent
ec05b4bc0a
commit
78ebeb6a5a
Notes:
sideshowbarker
2024-07-17 03:14:39 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/78ebeb6a5a Pull-request: https://github.com/SerenityOS/serenity/pull/21065 Reviewed-by: https://github.com/bugaevc
10 changed files with 35 additions and 11 deletions
25
Documentation/AndroidStudioConfiguration.md
Normal file
25
Documentation/AndroidStudioConfiguration.md
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
## Android Studio Project Configuration
|
||||||
|
|
||||||
|
The Android port of Ladybird has straightforward integration with the Android Studio IDE.
|
||||||
|
|
||||||
|
After opening the ``serenity`` directory in Android Studio (NOT the Ladybird/Android directory!)
|
||||||
|
there should be a pop-up in the bottom left indicating that an Android Gradle project was detected
|
||||||
|
in ``Ladybird/Android``.
|
||||||
|
|
||||||
|
In the top left of the screen in the Project view, navigate to ``Ladybird/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
|
||||||
|
loads the Gradle view to the right of the code window, go back to the banner at the top of the
|
||||||
|
``settings.gradle.kts`` file and click ``Load Script Configurations`` to finish loading the Gradle
|
||||||
|
project.
|
||||||
|
|
||||||
|
Gradle will index the project, and download all the required plugins. If it complains about no NDK,
|
||||||
|
follow the instructions in Android Studio to install an appropriate NDK version. If it still
|
||||||
|
complains about the NDK version, open ``File->Invalidate Caches...`` and click ``Invalidate and
|
||||||
|
Restart``.
|
||||||
|
|
||||||
|
## Getting the most out of the IDE
|
||||||
|
|
||||||
|
See the sections in the [CLionConfiguration](CLionConfiguration.md) for [Excluding Build Artifacts](CLionConfiguration.md#excluding-build-artifacts),
|
||||||
|
and [Code Generation Settings](CLionConfiguration.md#code-generation-settings).
|
|
@ -63,6 +63,11 @@ On Windows:
|
||||||
WSL2/WSLg are preferred, as they provide a linux environment that matches one of the above distributions.
|
WSL2/WSLg are preferred, as they provide a linux environment that matches one of the above distributions.
|
||||||
MinGW/MSYS2 are not supported, but may work with sufficient elbow grease. Native Windows builds are not supported with either clang-cl or MSVC.
|
MinGW/MSYS2 are not supported, but may work with sufficient elbow grease. Native Windows builds are not supported with either clang-cl or MSVC.
|
||||||
|
|
||||||
|
For Android:
|
||||||
|
|
||||||
|
On a Unix-like platform, install the prerequisites for that platform and then see the [Android Studio guide](AndroidStudioConfiguration.md).
|
||||||
|
Or, download a version of Gradle >= 8.0.0, and run the ``gradlew`` program in ``Ladybird/Android``
|
||||||
|
|
||||||
## Build steps
|
## Build steps
|
||||||
|
|
||||||
### Using serenity.sh
|
### Using serenity.sh
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import com.android.build.gradle.internal.tasks.factory.dependsOn
|
import com.android.build.gradle.internal.tasks.factory.dependsOn
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("com.android.application")
|
id("com.android.application") version "8.1.1"
|
||||||
id("org.jetbrains.kotlin.android")
|
id("org.jetbrains.kotlin.android") version "1.9.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
var cacheDir = System.getenv("SERENITY_CACHE_DIR") ?: "$buildDir/caches"
|
var cacheDir = System.getenv("SERENITY_CACHE_DIR") ?: "$buildDir/caches"
|
||||||
|
@ -11,11 +11,12 @@ task<Exec>("buildLagomTools") {
|
||||||
commandLine = listOf("./BuildLagomTools.sh")
|
commandLine = listOf("./BuildLagomTools.sh")
|
||||||
environment = mapOf(
|
environment = mapOf(
|
||||||
"BUILD_DIR" to "$buildDir",
|
"BUILD_DIR" to "$buildDir",
|
||||||
"CACHE_DIR" to "$cacheDir",
|
"CACHE_DIR" to cacheDir,
|
||||||
"PATH" to System.getenv("PATH")!!
|
"PATH" to System.getenv("PATH")!!
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
tasks.named("preBuild").dependsOn("buildLagomTools")
|
tasks.named("preBuild").dependsOn("buildLagomTools")
|
||||||
|
tasks.named("prepareKotlinBuildScriptModel").dependsOn("buildLagomTools")
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "org.serenityos.ladybird"
|
namespace = "org.serenityos.ladybird"
|
||||||
|
|
0
gradlew → Ladybird/Android/gradlew
vendored
0
gradlew → Ladybird/Android/gradlew
vendored
|
@ -14,5 +14,3 @@ dependencyResolutionManagement {
|
||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = "Ladybird"
|
rootProject.name = "Ladybird"
|
||||||
include("Ladybird")
|
|
||||||
project(":Ladybird").projectDir = file("Ladybird/Android")
|
|
|
@ -83,7 +83,7 @@ jobs:
|
||||||
|
|
||||||
- task: Gradle@2
|
- task: Gradle@2
|
||||||
inputs:
|
inputs:
|
||||||
workingDirectory: ''
|
workingDirectory: 'Ladybird/Android'
|
||||||
gradleWrapperFile: 'gradlew'
|
gradleWrapperFile: 'gradlew'
|
||||||
gradleOptions: '-Xmx3072m'
|
gradleOptions: '-Xmx3072m'
|
||||||
jdkVersionOption: '17'
|
jdkVersionOption: '17'
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
||||||
plugins {
|
|
||||||
id("com.android.application") version "8.1.1" apply false
|
|
||||||
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
|
|
||||||
}
|
|
Loading…
Reference in a new issue