Ladybird/Android: Move gradle files to Ladybird/Android directory

And add documentation for how to use the thing
This commit is contained in:
Andrew Kaster 2023-09-14 15:59:33 -06:00 committed by Andrew Kaster
parent ec05b4bc0a
commit 78ebeb6a5a
Notes: sideshowbarker 2024-07-17 03:14:39 +09:00
10 changed files with 35 additions and 11 deletions

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

View file

@ -63,6 +63,11 @@ On Windows:
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.
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
### Using serenity.sh

View file

@ -1,8 +1,8 @@
import com.android.build.gradle.internal.tasks.factory.dependsOn
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.android.application") version "8.1.1"
id("org.jetbrains.kotlin.android") version "1.9.0"
}
var cacheDir = System.getenv("SERENITY_CACHE_DIR") ?: "$buildDir/caches"
@ -11,11 +11,12 @@ task<Exec>("buildLagomTools") {
commandLine = listOf("./BuildLagomTools.sh")
environment = mapOf(
"BUILD_DIR" to "$buildDir",
"CACHE_DIR" to "$cacheDir",
"CACHE_DIR" to cacheDir,
"PATH" to System.getenv("PATH")!!
)
}
tasks.named("preBuild").dependsOn("buildLagomTools")
tasks.named("prepareKotlinBuildScriptModel").dependsOn("buildLagomTools")
android {
namespace = "org.serenityos.ladybird"

View file

View file

@ -14,5 +14,3 @@ dependencyResolutionManagement {
}
rootProject.name = "Ladybird"
include("Ladybird")
project(":Ladybird").projectDir = file("Ladybird/Android")

View file

@ -83,7 +83,7 @@ jobs:
- task: Gradle@2
inputs:
workingDirectory: ''
workingDirectory: 'Ladybird/Android'
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
jdkVersionOption: '17'

View file

@ -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
}