-
Notifications
You must be signed in to change notification settings - Fork 1
Development environment setup #4
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # AGENTS.md | ||
|
|
||
| ## Cursor Cloud specific instructions | ||
|
|
||
| ### Project overview | ||
|
|
||
| WiTV is an Android TV IPTV player (Java, Gradle). There is no backend service, database, or Node.js tooling — it is a single-module Android app built entirely with Gradle. | ||
|
|
||
| ### Environment | ||
|
|
||
| - **JDK 17** is required (`JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64`). The VM ships with JDK 21 by default; the update script installs JDK 17 and configures `~/.bashrc`. | ||
| - **Android SDK** is installed at `/opt/android-sdk` with platform API 36 and build-tools 36.0.0. `ANDROID_HOME` and `ANDROID_SDK_ROOT` are set via `~/.bashrc`. | ||
| - The Gradle wrapper (`./gradlew`) auto-downloads Gradle 8.9; no manual Gradle install is needed. | ||
|
|
||
| ### Key commands (see README for full details) | ||
|
|
||
| | Task | Command | | ||
| |------|---------| | ||
| | Unit tests | `./gradlew testDebugUnitTest --no-daemon` | | ||
| | Debug APK build | `./gradlew assembleDebug --no-daemon` | | ||
| | Release APK build | `./gradlew assembleRelease --no-daemon` | | ||
|
|
||
| ### Gotchas | ||
|
|
||
| - `./gradlew lintDebug` currently fails due to pre-existing `NewApi` lint errors in the codebase. Lint is **not** part of CI — CI only runs `testDebugUnitTest` + `assembleDebug`. | ||
| - The app uses `compileSdk 36` which triggers a suppressible warning via `android.suppressUnsupportedCompileSdk=36` in `gradle.properties`. | ||
| - Room annotation processor produces a warning about multiple constructors on `FavoriteChannel.java` — this is harmless. | ||
| - This is an Android TV app with no web frontend build step; the files in `app/src/main/assets/web/` are plain HTML/JS served by the embedded NanoHTTPD server at runtime. | ||
| - There is no Android emulator on the cloud VM, so the APK cannot be run directly. Testing is limited to unit tests and build verification. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
app/src/test/java/com/whyun/witv/ui/SettingsCollapsibleFragmentTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| package com.whyun.witv.ui; | ||
|
|
||
| import android.view.View; | ||
| import android.widget.FrameLayout; | ||
|
|
||
| import org.junit.Test; | ||
| import org.junit.runner.RunWith; | ||
| import org.robolectric.RobolectricTestRunner; | ||
| import org.robolectric.shadows.ShadowLooper; | ||
|
|
||
| import java.lang.reflect.Field; | ||
|
|
||
| import static org.junit.Assert.assertEquals; | ||
| import static org.junit.Assert.assertNull; | ||
|
|
||
| @RunWith(RobolectricTestRunner.class) | ||
| public class SettingsCollapsibleFragmentTest { | ||
|
|
||
| @Test | ||
| public void onMainMenuItemFocusedCancelsPendingOpenWhenReturningToOpenCategory() | ||
| throws Exception { | ||
| SettingsCollapsibleFragment fragment = new SettingsCollapsibleFragment(); | ||
| FrameLayout submenuContainer = new FrameLayout( | ||
| androidx.test.core.app.ApplicationProvider.getApplicationContext()); | ||
| submenuContainer.setVisibility(View.VISIBLE); | ||
|
|
||
| setField(fragment, "submenuContainer", submenuContainer); | ||
| setField(fragment, "openCategory", SettingsCollapsibleFragment.CAT_ADDRESS); | ||
|
|
||
| fragment.onMainMenuItemFocused(SettingsCollapsibleFragment.CAT_EPG); | ||
| fragment.onMainMenuItemFocused(SettingsCollapsibleFragment.CAT_ADDRESS); | ||
|
|
||
| ShadowLooper.runUiThreadTasksIncludingDelayedTasks(); | ||
|
|
||
| assertNull(getField(fragment, "pendingSubmenuOpen")); | ||
| assertEquals(SettingsCollapsibleFragment.CAT_ADDRESS, getField(fragment, "openCategory")); | ||
| } | ||
|
|
||
| private static void setField(Object target, String fieldName, Object value) throws Exception { | ||
| Field field = target.getClass().getDeclaredField(fieldName); | ||
| field.setAccessible(true); | ||
| field.set(target, value); | ||
| } | ||
|
|
||
| private static Object getField(Object target, String fieldName) throws Exception { | ||
| Field field = target.getClass().getDeclaredField(fieldName); | ||
| field.setAccessible(true); | ||
| return field.get(target); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.