Skip to content

love-android as a library #290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

love-android as a library #290

wants to merge 19 commits into from

Conversation

eltonkola
Copy link

This is a suggestion about converting the app into a library, so we can publish an aar that can easily be integrated on a new app.

This is just a suggestion for now.

This pr does most of the job, but may be a few things what should be fixed.

My goal was to make it work with jitpack, but unfortunately was not able to make it work, if authors decide to consider this change, publishing in maven centra would be the real goal.

For now i modified the github action to upload the binaries, and successfully used it on my app via aar dependency :

flatDir {
dirs("app/libs")
}

implementation(mapOf("name" to "library-embed-record-release", "ext" to "aar"))

Copy link
Collaborator

@MikuAuahDark MikuAuahDark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In overall, I think you need to re-do this PR as it's quite messy. The commit history is also messy.

@@ -18,50 +21,121 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
submodules: false # We'll handle this manually for better control
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why we don't need to clone submodules? For someone who wants to compile from source quickly, they can just do:

$ git clone --recurse-submodules https://github.com/love2d/love-android
$ cd love-android
$ gradlew assemble

Instead of having to manually re-clone the needed repository (megasource and main LOVE)

@@ -18,50 +21,121 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
submodules: false # We'll handle this manually for better control
token: ${{ secrets.GITHUB_TOKEN }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

token is ${{ github.token }} (alias of secrets.GITHUB_TOKEN) by default. This is redundant.

Comment on lines +26 to +59
- name: Initialize Submodules (Robust)
run: |
echo "=== Initial Git Status ==="
git status
echo "=== Checking .gitmodules ==="
cat .gitmodules || echo "No .gitmodules found"
echo "=== Checking git config for submodules ==="
git config --list | grep submodule || echo "No submodule config found"
echo "=== Checking .git/modules ==="
ls -la .git/modules/ || echo "No .git/modules found"
echo "=== Force clean submodule state and re-init ==="
git submodule deinit --all --force || true
rm -rf .git/modules/library || true
rm -rf .git/modules/app || true
echo "=== Re-sync and init submodules ==="
git submodule sync --recursive
git submodule update --init --recursive --force
echo "=== Submodule status after clean init ==="
git submodule status --recursive
echo "=== Manual clone fallback if needed ==="
if [ ! -d "library/src/main/cpp/love" ]; then
echo "Love submodule still missing, manual clone..."
mkdir -p library/src/main/cpp
git clone https://github.com/love2d/love.git library/src/main/cpp/love --depth 1
fi
if [ ! -d "library/src/main/cpp/megasource" ]; then
echo "Megasource submodule still missing, manual clone..."
mkdir -p library/src/main/cpp
git clone https://github.com/love2d/megasource.git library/src/main/cpp/megasource --depth 1
fi
echo "=== Final verification ==="
ls -la library/src/main/cpp/
ls -la library/src/main/cpp/love/ | head -5 || echo "love directory empty/missing"
ls -la library/src/main/cpp/megasource/ | head -5 || echo "megasource directory empty/missing"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason why we have to clone the submodules manually? This breaks people who just want to compile quickly (see my above review).

Comment on lines +63 to +65
distribution: 'temurin' # adopt-hotspot is an alias for temurin
java-version: '17' # This will pick the latest 17.x
# Or be more specific like '17.0.10' if '17.0.15' is problematic
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single quotes is redundant.

As for the comment, the exact version specifier comment is also bit out of place. Always stick to just the major version. If specific version has issue then it's upstream issue and should be reported.

Suggested change
distribution: 'temurin' # adopt-hotspot is an alias for temurin
java-version: '17' # This will pick the latest 17.x
# Or be more specific like '17.0.10' if '17.0.15' is problematic
distribution: temurin
java-version: 17

Comment on lines +1 to +8
About fork:
---------
This is a fork of the original project, it moves the app into a library and publishes it into an aar for easy app integration.

https://jitpack.io/#eltonkola/love-android/Tag

if there is interest we can clean it and try to merge into the main project

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this line. Thanks.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're using Java, not Kotlin. Either convert this to Java or don't add test.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're using Java, not Kotlin. Please convert this to Java.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're using Java, not Kotlin. Please convert this to Java. (There may be more Kotlin files, please do the same. This will be my last comment on this)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason this exist?

<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Theme.LÖVEForAndroid" parent="android:Theme.Material.Light.NoActionBar" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep style name plain ASCII.

Suggested change
<style name="Theme.LÖVEForAndroid" parent="android:Theme.Material.Light.NoActionBar" />
<style name="Theme.LOVEAndroid" parent="android:Theme.Material.Light.NoActionBar" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants