Merge 28ff68dcc9 into 80626ba4b5
290
.agents/skills/exploring_dependency_sources/SKILL.md
Normal file
@ -0,0 +1,290 @@
|
||||
---
|
||||
name: exploring_dependency_sources
|
||||
description: >
|
||||
Reads and searches source code across ALL scopes: external library dependencies, plugins (buildscript), and Gradle Build Tool internal source code;
|
||||
use whenever you need to UNDERSTAND an API — its shape, signature, parameters, overloads, or implementation — before writing any code that calls it;
|
||||
covers project dependencies (via project/configuration/source set scope), plugins (via `sourceSetPath=":buildscript"`), and Gradle internals (via `gradleSource: true`).
|
||||
Prefer this over the REPL for all API research; reading source is instantaneous and complete.
|
||||
Do NOT use for project source code (use grep/tilth), Gradle documentation (use `gradle_docs` via the `gradle` skill), or Maven Central discovery (use `managing_gradle_dependencies`).
|
||||
license: Apache-2.0
|
||||
metadata:
|
||||
author: https://github.com/rnett/gradle-mcp
|
||||
version: "2.0"
|
||||
---
|
||||
|
||||
# Authoritative Dependency, Plugin & Gradle Internal Source Exploration
|
||||
|
||||
Explores, navigates, and analyzes the internal logic, APIs, and symbol implementations of external libraries, Gradle plugins, and the Gradle Build Tool itself with absolute precision using high-performance, indexed searching.
|
||||
|
||||
## Constitution
|
||||
|
||||
- **ALWAYS** use `search_dependency_sources` as the primary discovery tool for external library, plugin, and Gradle internal code.
|
||||
- **ALWAYS** prefer reading source code over interactive REPL exploration for understanding unfamiliar library APIs.
|
||||
- **ALWAYS** provide absolute paths for `projectRoot`.
|
||||
- **ALWAYS** use the `{group}/{artifact}` prefix for reading specific files (e.g., `path="org.mongodb/mongodb-driver-sync/org/mongodb/client/MongoClient.kt"`). The `dependency` parameter should only be used to filter the search scope for
|
||||
performance when searching across libraries, not as the primary way to specify a path.
|
||||
- **ALWAYS** escape Lucene special characters (`:`, `=`, `+`, `-`, `*`, `/`) in `FULL_TEXT` searches using a backslash (e.g., `\:`) or double quotes.
|
||||
- **ALWAYS** use `read_dependency_sources` once a specific file path has been identified via search.
|
||||
- **ALWAYS** use `fresh: true` if a search returns a `SearchResponse` with an `error` indicating a missing index.
|
||||
- **BE AWARE** that indexing and extraction failures (e.g., `ZipException`) are propagated and will cause the tool to fail with a descriptive error.
|
||||
- **NOTE** that the `dependency` filter targets ONLY the specific library version matched, NOT its transitive dependencies.
|
||||
- **BE AWARE** that buildscript (plugin) dependencies are excluded from `search_dependency_sources` and `read_dependency_sources` by default to reduce noise.
|
||||
- **ALWAYS** use `sourceSetPath=":buildscript"` (root project) or `sourceSetPath=":app:buildscript"` (subproject) to search or read plugin source code. This targets the virtual `buildscript` source set which aggregates all classpath
|
||||
plugins.
|
||||
- **ALWAYS** use `gradleSource: true` in `search_dependency_sources` to target Gradle's internal engine when probing core Gradle behavior.
|
||||
- **ALWAYS** scope with a project, configuration, or source set (or use `gradleSource: true`) — unscoped search is no longer supported.
|
||||
- **ALWAYS** verify against the actual source implementation when researching Gradle internals.
|
||||
- **NEVER** use generic shell tools like `grep` or `find` to *locate* dependency sources; they reside in remote caches whose paths are not predictable in advance.
|
||||
- **MAY** use shell tools like `rg` or `ast-grep` to *operate on* a sources root path explicitly returned by `read_dependency_sources` or `search_dependency_sources` in the `Sources root: <path>` header line. Dependency directories inside
|
||||
the sources root are symlinks; always pass `--follow` to `rg` (e.g., `rg --follow <pattern> <sources-root>`).
|
||||
|
||||
## Directives
|
||||
|
||||
### Search Modes
|
||||
|
||||
- **DECLARATION**: Best for classes, methods, or interfaces. Matches against the simple name (tokenized for CamelCase) and the full path (exact literal). All declaration searches are **case-sensitive**. Do NOT include keywords like `class`,
|
||||
`interface`, or `fun`. Supports exact names, exact FQNs, glob wildcards (e.g., `*`, `**`), and regular expressions. Use `name:` (discovery) or `fqn:` (precision) prefix for field-specific searches.
|
||||
- **FULL_TEXT**: Best for literal strings, constants, and complex code patterns using Lucene. **Case-insensitive**.
|
||||
- **GLOB**: Best for finding specific files (XML, properties, etc.) by name or extension. **Case-insensitive**.
|
||||
|
||||
Glob wildcards for FQNs: `*` matches one segment, `**` matches multiple. Example: `fqn:org.gradle.*.Project` or `fqn:org.**.Project`.
|
||||
|
||||
Regex: Wrap query in `/` for a full regular expression on the `fqn` field. Example: `fqn:/.*\.internal\..*/` to find all internal declarations.
|
||||
|
||||
### Scoping
|
||||
|
||||
- **Project Dependencies**: Use `search_dependency_sources` with `projectPath`, `configurationPath`, or `sourceSetPath` to scope to project dependency code.
|
||||
- **Plugins (Buildscript)**: Use `sourceSetPath=":buildscript"` to target plugin source code.
|
||||
- **Gradle Internals**: Use `gradleSource: true` to target Gradle Build Tool source code.
|
||||
|
||||
### Performance
|
||||
|
||||
- **Target Libraries Directly**: Use the `dependency` parameter to filter searches to a single library (`group:name:version:variant`, `group:name:version`, `group:name`, or just `group`). This bypasses project-level index merging for
|
||||
instantaneous results.
|
||||
- **Troubleshoot Targeted Searches**: If a targeted search fails, use `inspect_dependencies` first to verify the exact coordinates of the dependency as resolved by Gradle.
|
||||
- **Refresh Indices**: Use `fresh: true` if project dependencies have recently changed.
|
||||
- **Use Returned Sources Root**: Every response includes a `Sources root: <absolute-path>` header. Use this path with `rg`, `ast-grep`, or other shell tools for operations not covered by the MCP tools. Always pass `--follow` to `rg` for
|
||||
symlinked dependency directories.
|
||||
|
||||
### Exploration
|
||||
|
||||
- **Explore Packages Authoritatively**: Use `read_dependency_sources` with a dot-separated package path (e.g., `org.gradle.api`) to list its direct symbols and sub-packages.
|
||||
- **Analyze Implementation**: Use `read_dependency_sources` to retrieve implementation logic. Use `pagination` for large files.
|
||||
- **Trace Symbols Authoritatively**: When encountering an unknown symbol, use `DECLARATION` search to jump directly to its definition.
|
||||
|
||||
## When to Use
|
||||
|
||||
> **Decision rule**: If the question is *"what does this API look like or how does it work?"* — use this skill. If you need to *run* code to see what it does at runtime — use `interacting_with_project_runtime` (REPL). Read before you run.
|
||||
|
||||
- **API & Symbol Discovery**: Finding implementation, signature, or documentation of a class/interface/method from a dependency, plugin, or Gradle itself.
|
||||
- **Library Usage Research**: Understanding how to use a library's API by reading its internal implementation.
|
||||
- **Internal Logic Auditing**: Researching how a dependency or Gradle engine handles specific operations.
|
||||
- **Resource File Location**: Searching for configuration files (XML, JSON, properties) or metadata packaged within library jars.
|
||||
- **Constant & Literal Research**: Searching for specific constant values, error strings, or literal keys within external code.
|
||||
- **Gradle Internal Exploration**: Probing Gradle engine classes (e.g., `org.gradle.api.Project`, `Task`, `DependencyHandler`) to understand internal behavior.
|
||||
- **Plugin Source Auditing**: Examining plugin implementations to understand how they configure the build at runtime.
|
||||
|
||||
## Workflows
|
||||
|
||||
### 1. Tracing a Symbol from Project Code
|
||||
|
||||
1. Identify the symbol name or fully qualified name from an import.
|
||||
2. Call `search_dependency_sources(query="<SymbolName>", searchType="DECLARATION", projectPath=":")`.
|
||||
3. Identify the correct file path from the results.
|
||||
4. Call `read_dependency_sources(path="<path>", projectPath=":")` to analyze the implementation.
|
||||
|
||||
### 2. Discovering API Usage through Source
|
||||
|
||||
1. Search for a known entry point (constructor, main class) using `DECLARATION` or `FULL_TEXT`.
|
||||
2. Once found, use `read_dependency_sources` to read the source.
|
||||
3. Look for internal calls, helper methods, or factory patterns to understand preferred usage.
|
||||
|
||||
### 3. Researching Gradle Internal Engine
|
||||
|
||||
1. Search for the class: `search_dependency_sources(query="<ClassName>", searchType="DECLARATION", gradleSource=true)`.
|
||||
2. Use glob wildcards for subpackage searches: `fqn:org.gradle.*.SomeApi` or `fqn:org.**.SomeApi`.
|
||||
3. Once identified, read the implementation: `read_dependency_sources(path="org/gradle/...", gradleSource=true)`.
|
||||
4. Check for breaking changes against specific versions via `gradle_docs` (see `gradle` skill).
|
||||
|
||||
### 4. Researching Plugin Source Code
|
||||
|
||||
1. Search plugins: `search_dependency_sources(query="<PluginName>", searchType="DECLARATION", sourceSetPath=":buildscript")`.
|
||||
2. Read plugin implementation: `read_dependency_sources(path="<group>/<artifact>/...", sourceSetPath=":buildscript")`.
|
||||
|
||||
### 5. Targeted Search for a Single Library
|
||||
|
||||
1. Identify dependency coordinates from `inspect_dependencies` or project files.
|
||||
2. Call `search_dependency_sources(query="<query>", dependency="<group:artifact>", projectPath=":")`.
|
||||
3. Results are scoped ONLY to that library for maximum speed and relevance.
|
||||
|
||||
### 6. Searching for Constants or Error Codes
|
||||
|
||||
1. Identify the constant name or error message snippet.
|
||||
2. Call `search_dependency_sources(query="<text>", projectPath=":")` (defaults to `FULL_TEXT`).
|
||||
3. Review matches to find where the value is defined or used.
|
||||
|
||||
### 7. Exploring Documentation (Gradle Docs)
|
||||
|
||||
For official Gradle documentation (User Guide, DSL, Release Notes), use the `gradle_docs` tool via the `gradle` skill. See [Internal Source Research](references/internal_source_research.md) for authoritative research patterns combining docs
|
||||
and source.
|
||||
|
||||
## Examples
|
||||
|
||||
### Search for a specific class definition (project deps)
|
||||
|
||||
Tool: `search_dependency_sources`
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "JsonConfiguration",
|
||||
"searchType": "DECLARATION",
|
||||
"projectPath": ":"
|
||||
}
|
||||
// Reasoning: DECLARATION search for a class name across both name and FQN fields, scoped to the root project.
|
||||
```
|
||||
|
||||
### Search Gradle internal engine source code
|
||||
|
||||
Tool: `search_dependency_sources`
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "Project",
|
||||
"searchType": "DECLARATION",
|
||||
"gradleSource": true
|
||||
}
|
||||
// Reasoning: Using gradleSource and DECLARATION search to find the ground-truth implementation of the core Project API.
|
||||
```
|
||||
|
||||
### Search for a specific class within a targeted library
|
||||
|
||||
Tool: `search_dependency_sources`
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "MongoClient",
|
||||
"searchType": "DECLARATION",
|
||||
"dependency": "org.mongodb:mongodb-driver-sync",
|
||||
"projectPath": ":"
|
||||
}
|
||||
// Reasoning: The 'dependency' parameter targets only the 'mongodb-driver-sync' library for a fast, focused search.
|
||||
```
|
||||
|
||||
### Search plugin source code
|
||||
|
||||
Tool: `search_dependency_sources`
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "KotlinPlugin",
|
||||
"searchType": "DECLARATION",
|
||||
"sourceSetPath": ":buildscript"
|
||||
}
|
||||
// Reasoning: Targeting the buildscript source set to find plugin implementation classes.
|
||||
```
|
||||
|
||||
### Search with FQN glob wildcards (Gradle internals)
|
||||
|
||||
Tool: `search_dependency_sources`
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "fqn:org.gradle.*.Project",
|
||||
"searchType": "DECLARATION",
|
||||
"gradleSource": true
|
||||
}
|
||||
// Reasoning: Glob wildcard to find Project declarations in any direct sub-package of org.gradle.
|
||||
```
|
||||
|
||||
### Use regular expressions for internal APIs
|
||||
|
||||
Tool: `search_dependency_sources`
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "fqn:/.*\\.internal\\..*/",
|
||||
"searchType": "DECLARATION",
|
||||
"gradleSource": true
|
||||
}
|
||||
// Reasoning: Regex on the 'fqn' field to find all internal Gradle declarations.
|
||||
```
|
||||
|
||||
### Search with name-specific discovery (CamelCase)
|
||||
|
||||
Tool: `search_dependency_sources`
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "name:Configuration",
|
||||
"searchType": "DECLARATION",
|
||||
"projectPath": ":"
|
||||
}
|
||||
// Reasoning: The 'name:' prefix finds classes like 'JsonConfiguration' via CamelCase tokenization.
|
||||
```
|
||||
|
||||
### Search for a constant value assignment
|
||||
|
||||
Tool: `search_dependency_sources`
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "DEFAULT_TIMEOUT_MS \\: 5000",
|
||||
"projectPath": ":"
|
||||
}
|
||||
// Reasoning: FULL_TEXT (default) with escaped colon to find a specific constant assignment.
|
||||
```
|
||||
|
||||
### Locate a specific file by its exact name
|
||||
|
||||
Tool: `search_dependency_sources`
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "**/AndroidManifest.xml",
|
||||
"searchType": "GLOB",
|
||||
"projectPath": ":"
|
||||
}
|
||||
// Reasoning: GLOB search to find a specific file by name across the dependency graph.
|
||||
```
|
||||
|
||||
### Read sources from a specific dependency
|
||||
|
||||
Tool: `read_dependency_sources`
|
||||
|
||||
```json
|
||||
{
|
||||
"path": "org.jetbrains.kotlinx/kotlinx-coroutines-core/kotlinx/coroutines/Job.kt",
|
||||
"projectPath": ":"
|
||||
}
|
||||
// Reasoning: Reading 'Job.kt' using the recommended `{group}/{artifact}` syntax.
|
||||
```
|
||||
|
||||
### Read a specific Gradle internal class
|
||||
|
||||
Tool: `read_dependency_sources`
|
||||
|
||||
```json
|
||||
{
|
||||
"path": "org/gradle/api/Project.java",
|
||||
"gradleSource": true
|
||||
}
|
||||
// Reasoning: Retrieving the source code for a fundamental Gradle class for high-resolution analysis.
|
||||
```
|
||||
|
||||
### Explore a package via its FQN
|
||||
|
||||
Tool: `read_dependency_sources`
|
||||
|
||||
```json
|
||||
{
|
||||
"path": "org.gradle.api",
|
||||
"projectPath": ":"
|
||||
}
|
||||
// Reasoning: Listing the direct symbols and sub-packages of 'org.gradle.api' using index-backed exploration.
|
||||
```
|
||||
|
||||
## Resources
|
||||
|
||||
- [Internal Source Research](references/internal_source_research.md) — Combining `gradle_docs` documentation lookup with `gradleSource: true` source searches for authoritative research.
|
||||
- **Lucene Query Syntax**: Refer to the tool description for `search_dependency_sources` for details on complex queries and escaping.
|
||||
- **Troubleshooting Targeted Searches**: If `dependency` filter fails, run `inspect_dependencies` to confirm exact coordinates.
|
||||
@ -0,0 +1,126 @@
|
||||
# Gradle Internal Source Research
|
||||
|
||||
Guidance for researching Gradle Build Tool's internal implementation and third-party plugin source code using `search_dependency_sources` and `read_dependency_sources`.
|
||||
|
||||
## Searching the Gradle Engine
|
||||
|
||||
Use `gradleSource = true` and select the appropriate `searchType`:
|
||||
|
||||
### DECLARATION: Finding Class/Interface Definitions
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "DefaultProject",
|
||||
"searchType": "DECLARATION",
|
||||
"gradleSource": true
|
||||
}
|
||||
```
|
||||
|
||||
Search by simple name, FQN, or partial package paths. All declaration searches are **case-sensitive**.
|
||||
|
||||
### DECLARATION with FQN Glob Wildcards
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "fqn:org.gradle.*.Project",
|
||||
"searchType": "DECLARATION",
|
||||
"gradleSource": true
|
||||
}
|
||||
```
|
||||
|
||||
`*` matches one segment, `**` matches multiple. Example: `fqn:org.**.AbstractTask`.
|
||||
|
||||
### Regex on FQN for Internal APIs
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "fqn:/.*\\.internal\\..*/",
|
||||
"searchType": "DECLARATION",
|
||||
"gradleSource": true
|
||||
}
|
||||
```
|
||||
|
||||
### FULL_TEXT: Searching Implementation Patterns
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "configurationCache",
|
||||
"gradleSource": true
|
||||
}
|
||||
```
|
||||
|
||||
**Case-insensitive** text search. Escape Lucene special characters (`:`, `=`, `+`, `-`, `*`, `/`) with backslash.
|
||||
|
||||
### GLOB: Finding Internal Resource Files
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "**/plugin.properties",
|
||||
"searchType": "GLOB",
|
||||
"gradleSource": true
|
||||
}
|
||||
```
|
||||
|
||||
**Case-insensitive** file name search.
|
||||
|
||||
## Reading Implementation Details
|
||||
|
||||
Once a class is identified via search, read its source:
|
||||
|
||||
```json
|
||||
{
|
||||
"path": "org/gradle/api/Project.java",
|
||||
"gradleSource": true
|
||||
}
|
||||
```
|
||||
|
||||
For large files, use `pagination`:
|
||||
|
||||
```json
|
||||
{
|
||||
"path": "org/gradle/api/Project.java",
|
||||
"gradleSource": true,
|
||||
"pagination": {
|
||||
"offset": 0,
|
||||
"limit": 100
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Researching Plugin Source Code
|
||||
|
||||
Plugin (buildscript) dependencies are excluded by default. Use `sourceSetPath=":buildscript"` to include them:
|
||||
|
||||
### Searching Plugin Classes
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "KotlinPlugin",
|
||||
"searchType": "DECLARATION",
|
||||
"sourceSetPath": ":buildscript"
|
||||
}
|
||||
```
|
||||
|
||||
### Reading Plugin Source
|
||||
|
||||
```json
|
||||
{
|
||||
"path": "org.jetbrains.kotlin/kotlin-gradle-plugin/org/jetbrains/kotlin/gradle/plugin/KotlinPlugin.kt",
|
||||
"sourceSetPath": ":buildscript"
|
||||
}
|
||||
```
|
||||
|
||||
## Tracing Symbols Across Scopes
|
||||
|
||||
When encountering an unknown Gradle API or plugin class:
|
||||
|
||||
1. Search with `gradleSource: true` for engine classes.
|
||||
2. Search with `sourceSetPath=":buildscript"` for plugin classes.
|
||||
3. Read the implementation with `read_dependency_sources`.
|
||||
4. Cross-reference with official documentation via `gradle_docs` (see `gradle` skill).
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- **Source Not Found**: Some Gradle internal modules may not be fully indexed. Try a broader `FULL_TEXT` search or browse the directory structure via `read_dependency_sources` with `gradleSource: true`.
|
||||
- **Plugin Not Found**: Ensure the plugin is resolved in the buildscript classpath. Use `inspect_dependencies(sourceSetPath=":buildscript")` to verify.
|
||||
- **Index Error**: Use `fresh: true` if searching after dependency changes.
|
||||
345
.agents/skills/gradle/SKILL.md
Normal file
@ -0,0 +1,345 @@
|
||||
---
|
||||
name: gradle
|
||||
description: >
|
||||
Provides authoritative guidance for ALL Gradle operations: executing builds, running tests with surgical filtering, introspecting project structure, creating modules, and diagnosing failures;
|
||||
ALWAYS use instead of raw shell `./gradlew` for build execution, test runs, task introspection, module creation, performance audits, and documentation research.
|
||||
Do NOT use for dependency graph auditing/updates (use `managing_gradle_dependencies`) or dependency/plugin/Gradle source exploration (use `exploring_dependency_sources`).
|
||||
license: Apache-2.0
|
||||
metadata:
|
||||
author: https://github.com/rnett/gradle-mcp
|
||||
version: "4.0"
|
||||
---
|
||||
|
||||
# Authoritative Gradle Build Execution, Testing & Project Introspection
|
||||
|
||||
Executes builds, runs tests with high-precision filtering, introspects project structure, and diagnoses failures using managed orchestration and structured diagnostics.
|
||||
|
||||
## Constitution
|
||||
|
||||
- **ALWAYS** use the `gradle` tool instead of `./gradlew` via shell.
|
||||
- **ALWAYS** provide absolute paths for `projectRoot`.
|
||||
- **ALWAYS** prefer foreground execution (default) unless the task is persistent (e.g., servers) or extremely long-running (>2 minutes), or you explicitly intend to perform independent research while it proceeds.
|
||||
- **ALWAYS** use `captureTaskOutput` when you need the isolated output of a specific task (e.g., `help`, `projects`, `tasks`, `properties`, `dependencies`).
|
||||
- **STRONGLY PREFERRED**: Use `query_build` for all diagnostics. It is more token-efficient than reading raw console logs and provides structured access to failures, problems, and per-test output.
|
||||
- **ALWAYS** use `query_build` with `kind="TESTS"` and `query="FullTestName"` to access full test output and stack traces.
|
||||
- **NEVER** use `taskPath` or `captureTaskOutput` to investigate specific test failures; these provide the overall task log which is often truncated and lacks per-test isolation. Per-test output (via `query`) is authoritative and includes
|
||||
full stack traces.
|
||||
- **NEVER** use `--rerun-tasks` unless investigating project-wide cache-specific corruption; prefer `--rerun` for individual tasks.
|
||||
- **NEVER** guess task names or options; use the `help --task <name>` command for authoritative documentation.
|
||||
- **NEVER** leave background builds running; use `stopBuildId` to release resources when finished.
|
||||
- **ALWAYS** prefer Kotlin DSL (`.kts`) unless the project explicitly uses Groovy.
|
||||
- **ALWAYS** use lazy APIs (e.g., `tasks.register<MyTask>("myTask")`) instead of eager APIs (e.g., `tasks.create<MyTask>("myTask")`) to maintain configuration performance.
|
||||
- **ALWAYS** use version catalogs (`libs.versions.toml`) for dependency management when present.
|
||||
- **ALWAYS** use `gradle_docs` for authoritative documentation lookup instead of generic web searches.
|
||||
- **ALWAYS** check for existing conventions in the current project before proposing changes.
|
||||
- **ALWAYS** use safe navigation (`?.url?.toString()`) and provide fallback values when accessing `ArtifactRepository` URLs in Gradle init scripts or plugins to prevent `NullPointerException`.
|
||||
- **ALWAYS** use `:properties --property <name>` for surgical property extraction.
|
||||
|
||||
## Directives
|
||||
|
||||
### Authoritative Task Path Syntax
|
||||
|
||||
Gradle uses two ways to identify tasks from the command line. Precision prevents running redundant tasks in multi-project builds.
|
||||
|
||||
#### Task Selectors (Recursive Execution)
|
||||
|
||||
Providing a task name **without a leading colon** (e.g., `test`, `build`) acts as a selector. Gradle executes that task in **every project** (root and all subprojects) that contains a task with that name.
|
||||
|
||||
- **Example**: `gradle(commandLine=["test"])` -> Executes `test` in **all** projects.
|
||||
|
||||
#### Absolute Task Paths (Targeted Execution)
|
||||
|
||||
Providing a task path **with a leading colon** (e.g., `:test`, `:app:test`) targets a **single specific project**.
|
||||
|
||||
- **Root Project Only**: Use a single leading colon. `gradle(commandLine=[":test"])` -> Root project ONLY.
|
||||
- **Subproject Only**: Use the subproject name(s) separated by colons. `gradle(commandLine=[":app:test"])` -> ':app' subproject ONLY.
|
||||
|
||||
### Authoritative Test Selection (`--tests`)
|
||||
|
||||
The `--tests` flag supports powerful, high-precision filtering:
|
||||
|
||||
- **Exact Class**: `--tests com.example.MyTest`
|
||||
- **Exact Method**: `--tests com.example.MyTest.myTestMethod`
|
||||
- **Wildcard Method**: `--tests com.example.MyTest.test*` (All methods starting with 'test')
|
||||
- **Package Filter**: `--tests com.example.service.*` (All tests in the 'service' package)
|
||||
- **Class Prefix**: `--tests *IntegrationTest` (All classes ending in 'IntegrationTest')
|
||||
- **Character Wildcard**: `--tests com.example.Test?` (Matches Test1, TestA, etc.)
|
||||
- **Multi-Filter**: `gradle(commandLine=["test", "--tests", "ClassA", "--tests", "ClassB"])`
|
||||
|
||||
Patterns match against the **fully qualified name** of the test class or method.
|
||||
|
||||
### Foreground vs. Background Execution
|
||||
|
||||
- **ALWAYS use foreground for authoritative runs**: If you intend to wait for a result, ALWAYS use foreground execution. It provides superior progressive disclosure and simpler control flow.
|
||||
- **Background ONLY for persistent tasks**: Use `background: true` ONLY for tasks that must remain active (e.g., `bootRun`, continuous builds) or when you intentionally intend to perform independent research while the build proceeds.
|
||||
- **Foreground is safe**: Do not fear running high-output suites in the foreground. The `gradle` tool uses progressive disclosure to provide concise summaries and structured results, keeping session history clean.
|
||||
|
||||
### `captureTaskOutput` Usage
|
||||
|
||||
Use `captureTaskOutput` when you need clean, isolated output from a specific task without Gradle's general console noise. This is ideal for introspection tasks:
|
||||
|
||||
- `captureTaskOutput: ":projects"` - Clean project list
|
||||
- `captureTaskOutput: ":app:tasks"` - Task list for a specific project
|
||||
- `captureTaskOutput: ":help"` - Documentation for a specific task
|
||||
- `captureTaskOutput: ":properties"` - Single property extraction
|
||||
- `captureTaskOutput: ":app:dependencyInsight"` - Dependency resolution path
|
||||
|
||||
### `gradle_docs` Tag Syntax
|
||||
|
||||
Use `gradle_docs` for authoritative documentation. Always scope with tags:
|
||||
|
||||
| Tag | Section |
|
||||
|----------------------|----------------------------------------------------|
|
||||
| `tag:userguide` | Official Gradle User Guide |
|
||||
| `tag:dsl` | Gradle DSL Reference (Groovy and Kotlin DSL) |
|
||||
| `tag:javadoc` | Gradle Java API Reference |
|
||||
| `tag:samples` | Official Gradle samples and examples |
|
||||
| `tag:release-notes` | Version-specific release insights |
|
||||
| `tag:best-practices` | Official best practices and performance guidelines |
|
||||
|
||||
Explore sections with `path="."`. Search scoped with `tag:<section> <term>`.
|
||||
|
||||
### Idiomatic DSL Patterns
|
||||
|
||||
- **Prefer `register` over `create` (Lazy APIs)**: Use `tasks.register<MyTask>("myTask")` to avoid eager task configuration.
|
||||
- **Use Type-Safe Accessors**: Prefer `tasks.test { ... }` or `tasks.named<Test>("test") { ... }` over `tasks.getByName("test")`.
|
||||
- **Use Lazy Properties**: Employ `Property<T>` and `Provider<T>` APIs for late binding and configuration cache compatibility.
|
||||
- **Use Version Catalogs**: Centralize dependencies in `gradle/libs.versions.toml`.
|
||||
- **Avoid `allprojects`/`subprojects`**: These blocks create tight coupling; use convention plugins and apply them selectively.
|
||||
- **Enable Configuration Cache**: Ensure build logic avoids accessing the `Project` object inside task actions.
|
||||
- **Use Specific Annotations**: Properly label task properties with `@Input`, `@OutputFiles`, `@Internal`, etc.
|
||||
- **Minimize Logic in Build Scripts**: Move complex logic into convention plugins or `build-logic`.
|
||||
|
||||
### Resource Management
|
||||
|
||||
- Use `query_build()` without arguments to view the build dashboard and ensure no orphaned background builds are consuming system resources.
|
||||
- Set `invocationArguments: { envSource: "SHELL" }` if Gradle cannot find expected env vars (e.g., `JAVA_HOME`).
|
||||
|
||||
### Diagnostic Inspection (See References)
|
||||
|
||||
For comprehensive guidance on using `query_build` and `wait_build` for diagnostics, including JSON examples for every inspection mode (DASHBOARD, SUMMARY, FAILURES, PROBLEMS, TASKS, TESTS, CONSOLE, PROGRESS), refer
|
||||
to: [query_build Diagnostics Reference](references/query_build_diagnostics.md).
|
||||
|
||||
## Workflows
|
||||
|
||||
### Running a Foreground Build
|
||||
|
||||
1. Identify the task(s) to run (e.g., `["clean", "build"]`).
|
||||
2. Call `gradle(commandLine=["...", "..."])`.
|
||||
3. If the build fails, the tool returns a high-signal failure summary. Use `query_build` with the `buildId` for deeper diagnostics via [query_build Diagnostics Reference](references/query_build_diagnostics.md).
|
||||
|
||||
### Running Specific Tests
|
||||
|
||||
1. Identify the project path (e.g., `:app`) and the test filter (e.g., `com.example.MyTestClass*`).
|
||||
2. Call `gradle(commandLine=[":app:test", "--tests", "com.example.MyTest"])`.
|
||||
3. If failures are reported, use `query_build` to get detailed test output.
|
||||
|
||||
### Orchestrating Background Jobs
|
||||
|
||||
1. Start the build with `background: true` to receive a `BuildId`.
|
||||
2. Use `wait_build(buildId=ID, timeout=..., waitFor=...)` to block until a specific state or log pattern is reached.
|
||||
3. Use `query_build()` (no arguments) to manage active jobs in the dashboard.
|
||||
4. Stop the job using `gradle(stopBuildId=ID)` when finished.
|
||||
|
||||
### Introspecting Project Structure
|
||||
|
||||
1. Run `gradle(commandLine=[":projects"], captureTaskOutput=":projects")` to map the multi-project hierarchy.
|
||||
2. Run `gradle(commandLine=[":app:tasks", "--all"], captureTaskOutput=":app:tasks")` to discover runnable tasks.
|
||||
3. Run `gradle(commandLine=[":help", "--task", "test"], captureTaskOutput=":help")` for task-specific documentation.
|
||||
4. Run `gradle(commandLine=[":properties", "--property", "version"], captureTaskOutput=":properties")` for surgical property extraction.
|
||||
5. For detailed dependency resolution paths: `gradle(commandLine=[":app:dependencyInsight", "--dependency", "slf4j-api", "--configuration", "compileClasspath"], captureTaskOutput=":app:dependencyInsight")`.
|
||||
|
||||
### Creating a New Module
|
||||
|
||||
1. Map the project structure: `gradle(commandLine=[":projects"], captureTaskOutput=":projects")` to find the correct parent path.
|
||||
2. Create directory structure: `New-Item -ItemType Directory -Force -Path "<module-name>/src/main/kotlin"`.
|
||||
3. Add to `settings.gradle.kts`: Append `include(":<module-name>")`.
|
||||
4. Create `build.gradle.kts` with idiomatic patterns (apply convention plugins, set up standard configuration).
|
||||
5. Verify: `gradle(commandLine=[":<module-name>:tasks"], captureTaskOutput=":<module-name>:tasks")`.
|
||||
|
||||
### Performance Audit
|
||||
|
||||
1. Check configuration cache status: `gradle(commandLine=[":help", "--configuration-cache"])`.
|
||||
2. Analyze task compatibility and identify violations.
|
||||
3. Propose fixes: migrate to lazy APIs (`Property<T>`, `Provider<T>`) or use `@Internal`/`@Input` annotations correctly.
|
||||
4. Verify against latest guidance: `gradle_docs(query="tag:best-practices", projectRoot="/path/to/project")`.
|
||||
|
||||
### Documentation Research
|
||||
|
||||
1. Search the user guide: `gradle_docs(query="tag:userguide <term>", projectRoot="/path/to/project")`.
|
||||
2. Navigate the DSL reference: `gradle_docs(path="dsl/org.gradle.api.Project.html", projectRoot="/path/to/project")`.
|
||||
3. Check for breaking changes: `gradle_docs(query="tag:release-notes", version="8.6")`.
|
||||
4. Find best practices: `gradle_docs(query="tag:best-practices dependency management", projectRoot="/path/to/project")`.
|
||||
5. Search for samples: `gradle_docs(query="tag:samples toolchains", projectRoot="/path/to/project")`.
|
||||
6. Search javadocs: `gradle_docs(query="tag:javadoc Project", projectRoot="/path/to/project")`.
|
||||
|
||||
### Investigating Test Failures
|
||||
|
||||
1. Identify the `BuildId` from the build result.
|
||||
2. Use `query_build(buildId=ID, kind="TESTS", outcome="FAILED")` to list all failed tests.
|
||||
3. Use `query_build(buildId=ID, kind="TESTS", query=TNAME)` to see the full output and stack trace for a specific test.
|
||||
4. **DO NOT** use `taskPath` or `captureTaskOutput` for test failure investigation.
|
||||
|
||||
## When to Use
|
||||
|
||||
- **Core Lifecycle Execution**: When you need to execute standard Gradle tasks (`build`, `assemble`, `clean`) with reliable, parseable output.
|
||||
- **Test Execution & Diagnostics**: When running tests with `--tests` filtering, isolating failures, or retrieving full stack traces.
|
||||
- **Introspection & Mapping**: When mapping multi-module project hierarchies, discovering runnable tasks, or auditing build configuration.
|
||||
- **Surgical Property Inspection**: When extracting a specific property value (artifact version, build directory) for use in a subsequent task.
|
||||
- **Persistent Development Processes**: When starting dev servers (`bootRun`) or continuous builds where background management is required.
|
||||
- **Task-Specific Information Retrieval**: When you need isolated output from a single task (`help`, `projects`, `tasks`) without build noise.
|
||||
- **Build Failure Diagnostics**: When performing deep-dive analysis of task failures, problems, or compilation errors.
|
||||
- **New Module Creation**: When adding a new project or module to a multi-project build.
|
||||
- **Build Logic Refactoring**: When cleaning up complex build scripts or creating convention plugins.
|
||||
- **Performance Troubleshooting**: When builds are slow or failing during the configuration phase.
|
||||
- **Documentation & DSL Research**: When looking up official Gradle syntax, user guide topics, or release notes.
|
||||
|
||||
## Examples
|
||||
|
||||
### Run build in all projects
|
||||
|
||||
Tool: `gradle`
|
||||
|
||||
```json
|
||||
{
|
||||
"commandLine": ["build"]
|
||||
}
|
||||
// Reasoning: Task selector (no colon) verifies build health across the entire multi-project structure.
|
||||
```
|
||||
|
||||
### Run a single test class in a specific subproject
|
||||
|
||||
Tool: `gradle`
|
||||
|
||||
```json
|
||||
{
|
||||
"commandLine": [":app:test", "--tests", "com.example.service.MyServiceTest"]
|
||||
}
|
||||
// Reasoning: Absolute task path with exact class filter for the fastest possible feedback loop.
|
||||
```
|
||||
|
||||
### Inspect help output for a specific task
|
||||
|
||||
Tool: `gradle`
|
||||
|
||||
```json
|
||||
{
|
||||
"commandLine": [":app:help", "--task", "test"],
|
||||
"captureTaskOutput": ":app:help"
|
||||
}
|
||||
// Reasoning: Using captureTaskOutput to retrieve clean, isolated documentation.
|
||||
```
|
||||
|
||||
### List all sub-projects in the build
|
||||
|
||||
Tool: `gradle`
|
||||
|
||||
```json
|
||||
{
|
||||
"commandLine": [":projects"],
|
||||
"captureTaskOutput": ":projects"
|
||||
}
|
||||
// Reasoning: Using captureTaskOutput to retrieve the project hierarchy list without startup noise.
|
||||
```
|
||||
|
||||
### Surgically inspect the 'version' property
|
||||
|
||||
Tool: `gradle`
|
||||
|
||||
```json
|
||||
{
|
||||
"commandLine": [":properties", "--property", "version"],
|
||||
"captureTaskOutput": ":properties"
|
||||
}
|
||||
// Reasoning: Using --property to isolate a single value and avoid retrieving thousands of unrelated properties.
|
||||
```
|
||||
|
||||
### Analyze a specific dependency conflict
|
||||
|
||||
Tool: `gradle`
|
||||
|
||||
```json
|
||||
{
|
||||
"commandLine": [
|
||||
":app:dependencyInsight",
|
||||
"--dependency",
|
||||
"com.google.guava:guava",
|
||||
"--configuration",
|
||||
"runtimeClasspath"
|
||||
],
|
||||
"captureTaskOutput": ":app:dependencyInsight"
|
||||
}
|
||||
// Reasoning: Using dependencyInsight to isolate the resolution path for a specific artifact.
|
||||
```
|
||||
|
||||
### Start a dev server and wait for readiness
|
||||
|
||||
Tool: `gradle`
|
||||
|
||||
```json
|
||||
// Step 1: Start the server in the background
|
||||
{
|
||||
"commandLine": [":app:bootRun"],
|
||||
"background": true
|
||||
}
|
||||
// Response: { "buildId": "build_123" }
|
||||
|
||||
// Step 2: Wait for readiness signal
|
||||
{
|
||||
"buildId": "build_123",
|
||||
"timeout": 60,
|
||||
"waitFor": "Started Application"
|
||||
}
|
||||
// Reasoning: Background orchestration allows the server to remain active while waiting for readiness.
|
||||
```
|
||||
|
||||
### Search official Gradle documentation
|
||||
|
||||
Tool: `gradle_docs`
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "tag:dsl signing plugin",
|
||||
"projectRoot": "/absolute/path/to/project"
|
||||
}
|
||||
// Reasoning: Using the DSL tag to find authoritative syntax for the signing plugin configuration.
|
||||
```
|
||||
|
||||
### Create a new sub-project module
|
||||
|
||||
Tool: `run_shell_command`
|
||||
|
||||
```json
|
||||
{
|
||||
"command": "New-Item -ItemType Directory -Force -Path subproject/src/main/kotlin"
|
||||
}
|
||||
// Reasoning: Creating the standard directory structure for a Kotlin JVM project using correct PowerShell syntax.
|
||||
```
|
||||
|
||||
### List all failed tests in a build
|
||||
|
||||
Tool: `query_build`
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "build_abc123",
|
||||
"kind": "TESTS",
|
||||
"outcome": "FAILED"
|
||||
}
|
||||
// Reasoning: Isolating only the failures from a large test suite for efficient triage.
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- **Build Not Found**: If a `BuildId` is not recognized, it may have expired from the recent history cache. Check the dashboard (`query_build()`) for valid active and historical IDs.
|
||||
- **Task Output Not Captured**: Ensure the path provided to `captureTaskOutput` matches exactly one of the tasks in the `commandLine`.
|
||||
- **Missing environment variables**: Set `invocationArguments: { envSource: "SHELL" }` if Gradle cannot find expected env vars (e.g., `JAVA_HOME`).
|
||||
|
||||
## Resources
|
||||
|
||||
- [query_build Diagnostics Reference](references/query_build_diagnostics.md) — Complete diagnostic patterns for DASHBOARD, SUMMARY, FAILURES, PROBLEMS, TASKS, TESTS, CONSOLE, and PROGRESS.
|
||||
- [Background Monitoring Patterns](references/background_monitoring.md)
|
||||
- [Authoritative Diagnostic Tasks](references/diagnostic_tasks.md) — Built-in introspection tasks.
|
||||
- [Best Practices Snapshot](references/best_practices.md) — High-level best practices; always verify with `gradle_docs`.
|
||||
- [Common Build Patterns](references/common_build_patterns.md) — Idiomatic patterns for multi-project builds, convention plugins, and task registration.
|
||||
- [Official Gradle Documentation Research](references/gradle_docs_research.md) — Guidance on using `gradle_docs` for authoritative documentation.
|
||||
105
.agents/skills/gradle/references/background_monitoring.md
Normal file
@ -0,0 +1,105 @@
|
||||
# Background Monitoring Patterns
|
||||
|
||||
This guide provides advanced patterns for monitoring and managing long-running background builds using `gradle`, `query_build`, and `wait_build`.
|
||||
|
||||
## Common Monitoring Patterns
|
||||
|
||||
### 1. Waiting for a Log Message
|
||||
|
||||
The most common pattern for background builds (like dev servers) is to wait for a specific log message that indicates the build is ready using `wait_build`.
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"timeout": 60,
|
||||
"waitFor": "Started Application"
|
||||
}
|
||||
```
|
||||
|
||||
- **`timeout`**: Max seconds to wait for the message.
|
||||
- **`waitFor`**: A regex pattern to match in the build logs.
|
||||
|
||||
### 2. Waiting for Task Completion
|
||||
|
||||
If you want to wait for a specific task to finish in a background build.
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"timeout": 120,
|
||||
"waitForTask": ":app:assemble"
|
||||
}
|
||||
```
|
||||
|
||||
- **`waitForTask`**: The path of the task to wait for.
|
||||
|
||||
### 3. Monitoring Progress Without Waiting
|
||||
|
||||
To check the current status of a background build without waiting for a specific event using `query_build`.
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID"
|
||||
}
|
||||
```
|
||||
|
||||
- This returns a summary of the current build state (e.g., `BUILD IN PROGRESS`, `SUCCESS`, `FAILURE`), failures, and problems.
|
||||
- **Example**: `query_build(buildId="ID")`
|
||||
|
||||
### 4. Inspecting Active Builds (Build Dashboard)
|
||||
|
||||
To see all currently running background builds and recent history.
|
||||
|
||||
```json
|
||||
{}
|
||||
```
|
||||
|
||||
- Call `query_build()` with **no arguments** to see the dashboard.
|
||||
- This is the easiest way to find `BuildId`s for active or recently finished builds.
|
||||
|
||||
## Advanced Management
|
||||
|
||||
### 1. Stopping a Background Build
|
||||
|
||||
Always stop background builds when they are no longer needed to free up resources.
|
||||
|
||||
```json
|
||||
{
|
||||
"stopBuildId": "BUILD_ID"
|
||||
}
|
||||
```
|
||||
|
||||
### 2. Continuous Builds
|
||||
|
||||
For continuous builds (e.g., `gradle build --continuous`), use the background pattern and wait for the "Waiting for changes" message.
|
||||
|
||||
```json
|
||||
// Start the build
|
||||
{
|
||||
"commandLine": ["build", "--continuous"],
|
||||
"background": true
|
||||
}
|
||||
|
||||
// Wait for the first build to finish
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"timeout": 120,
|
||||
"waitFor": "Waiting for changes"
|
||||
}
|
||||
```
|
||||
|
||||
### 3. Handling Timeouts
|
||||
|
||||
If a build takes longer than the `timeout` time, `wait_build` will return the current status. You can then call it again with a new `timeout` time if needed.
|
||||
|
||||
## Troubleshooting Background Builds
|
||||
|
||||
- **Build Fails Immediately**: If a background build fails quickly, check the `failures` and `console` output using `query_build`.
|
||||
- **Log Message Not Found**: Ensure the `waitFor` regex is correct and that the message is actually being printed to the console.
|
||||
- **Resource Exhaustion**: If you have too many background builds running, stop the ones you don't need using `stopBuildId`.
|
||||
|
||||
## Functional Identity with Foreground Execution
|
||||
|
||||
Monitoring a background build using `query_build` or `wait_build` provides exactly the same rich diagnostic data as a foreground build. The primary difference is control flow: background execution allows you to yield control and perform
|
||||
other tasks,
|
||||
whereas foreground execution blocks until completion. Both methods utilize progressive disclosure to ensure session history remains clean and focused.
|
||||
109
.agents/skills/gradle/references/best_practices.md
Normal file
@ -0,0 +1,109 @@
|
||||
# Gradle Build Logic Best Practices
|
||||
|
||||
**IMPORTANT**: This document provides a high-level snapshot of common best practices. However, Gradle is a rapidly evolving tool. **You MUST use the `gradle_docs` tool to retrieve the most up-to-date and comprehensive best practices
|
||||
directly from the official documentation.**
|
||||
|
||||
## 1. Authoritative Research Workflow
|
||||
|
||||
Before implementing significant build logic, always perform a search for the latest recommendations using scoped queries and project context.
|
||||
|
||||
### Example: Getting an Index of Best Practices
|
||||
|
||||
To find the authoritative index of best practices within the User Guide, first explore the `userguide/` directory to identify the correct files.
|
||||
|
||||
Tool: `gradle_docs`
|
||||
|
||||
```json
|
||||
{
|
||||
"path": "userguide/",
|
||||
"projectRoot": "/absolute/path/to/project"
|
||||
}
|
||||
```
|
||||
|
||||
**Reasoning**: This call lists the contents of the `userguide` directory. Look for files starting with `best_practices` (e.g., `best_practices.md`, `best_practices_dependency_management.md`). Once identified, read the main index:
|
||||
|
||||
Tool: `gradle_docs`
|
||||
|
||||
```json
|
||||
{
|
||||
"path": "userguide/best_practices.md",
|
||||
"projectRoot": "/absolute/path/to/project"
|
||||
}
|
||||
```
|
||||
|
||||
### Example: Searching for Best Practices
|
||||
|
||||
Tool: `gradle_docs`
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "tag:best-practices dependency management",
|
||||
"projectRoot": "/absolute/path/to/project"
|
||||
}
|
||||
```
|
||||
|
||||
**Reasoning**: Using the authoritative `best-practices` tag ensures the returned content is filtered for high-signal architectural recommendations.
|
||||
|
||||
### Example: Searching for Specific Guidance
|
||||
|
||||
Tool: `gradle_docs`
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "tag:userguide performance best practices",
|
||||
"projectRoot": "/absolute/path/to/project"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 2. Engine-Level Discovery (The "Source of Truth")
|
||||
|
||||
To understand the core architectural principles behind best practices, you can explore Gradle's own source documentation.
|
||||
|
||||
### Example: Listing Core Concepts and Documentation
|
||||
|
||||
Use `gradle_docs` with `path="."` to explore the root documentation tree.
|
||||
|
||||
Tool: `gradle_docs`
|
||||
|
||||
```json
|
||||
{
|
||||
"path": ".",
|
||||
"projectRoot": "/absolute/path/to/project"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 3. High-Level Snapshot (Current Guidelines)
|
||||
|
||||
The following sections summarize established idiomatic patterns. Use these as a starting point, but verify against the official docs.
|
||||
|
||||
### Kotlin DSL Idiomatic Patterns
|
||||
|
||||
- **Use Type-Safe Accessors**: Prefer `tasks.test { ... }` or `tasks.named<Test>("test") { ... }` over `tasks.getByName("test")`.
|
||||
- **Prefer `register` over `create` (Lazy APIs)**: Use `tasks.register<MyTask>("myTask")` to avoid eager task configuration.
|
||||
- **Use Lazy Properties**: Employ the `Property<T>` and `Provider<T>` APIs for late binding and better configuration cache compatibility.
|
||||
|
||||
### Performance & Configuration Cache
|
||||
|
||||
- **Enable Configuration Cache**: Ensure build logic avoids accessing the `Project` object inside task actions.
|
||||
- **Use Specific Annotations**: Properly label task properties with `@Input`, `@OutputFiles`, `@Internal`, etc.
|
||||
- **Minimize Logic in Build Scripts**: Move complex logic into convention plugins or `buildSrc`.
|
||||
|
||||
### Dependency Management
|
||||
|
||||
- **Use Version Catalogs**: Centralize dependencies in `gradle/libs.versions.toml`.
|
||||
- **Avoid `allprojects` and `subprojects`**: These blocks create tight coupling; use convention plugins and apply them selectively instead.
|
||||
|
||||
### Project Integrity
|
||||
|
||||
- **Reproducible Builds**: Use fixed versions and commit the Gradle wrapper.
|
||||
- **Surgical Updates**: Only update what is necessary and verify with `check`.
|
||||
|
||||
## Resources (Official Source of Truth)
|
||||
|
||||
- [Official Gradle Best Practices](https://docs.gradle.org/current/userguide/best_practices.html)
|
||||
- [Gradle Performance Guide](https://docs.gradle.org/current/userguide/performance.html)
|
||||
- [Kotlin DSL Primer](https://docs.gradle.org/current/userguide/kotlin_dsl.html)
|
||||
142
.agents/skills/gradle/references/common_build_patterns.md
Normal file
@ -0,0 +1,142 @@
|
||||
# Common Gradle Build Patterns & Conventions
|
||||
|
||||
A collection of idiomatic patterns for common Gradle build scenarios, including multi-project setups, convention plugins, and task registration.
|
||||
|
||||
## 1. Multi-Project Build Structure
|
||||
|
||||
Standard project structure with a root project and multiple subprojects.
|
||||
|
||||
### Directory Structure
|
||||
|
||||
```
|
||||
root/
|
||||
├── build.gradle.kts
|
||||
├── settings.gradle.kts
|
||||
├── libs.versions.toml
|
||||
├── app/
|
||||
│ └── build.gradle.kts
|
||||
├── core/
|
||||
│ └── build.gradle.kts
|
||||
└── build-logic/
|
||||
├── build.gradle.kts
|
||||
└── settings.gradle.kts
|
||||
```
|
||||
|
||||
### `settings.gradle.kts`
|
||||
|
||||
```kotlin
|
||||
pluginManagement {
|
||||
includeBuild("build-logic")
|
||||
}
|
||||
|
||||
rootProject.name = "my-project"
|
||||
include(":app", ":core")
|
||||
|
||||
dependencyResolutionManagement {
|
||||
versionCatalogs {
|
||||
create("libs") {
|
||||
from(files("gradle/libs.versions.toml"))
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 2. Convention Plugins (The `build-logic` Pattern)
|
||||
|
||||
Move common project configuration logic into separate plugins to reduce duplication in `build.gradle.kts` files.
|
||||
|
||||
### `build-logic/build.gradle.kts`
|
||||
|
||||
```kotlin
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
|
||||
}
|
||||
```
|
||||
|
||||
### `build-logic/src/main/kotlin/my-convention.gradle.kts`
|
||||
|
||||
```kotlin
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile>().configureEach {
|
||||
compilerOptions {
|
||||
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Usage in Subprojects
|
||||
|
||||
```kotlin
|
||||
plugins {
|
||||
id("my-convention")
|
||||
}
|
||||
```
|
||||
|
||||
## 3. Registering Custom Tasks
|
||||
|
||||
Use lazy task registration and configure properties with the `Property` and `Provider` APIs.
|
||||
|
||||
```kotlin
|
||||
abstract class MyCustomTask : DefaultTask() {
|
||||
@get:Input
|
||||
abstract val message: Property<String>
|
||||
|
||||
@TaskAction
|
||||
fun action() {
|
||||
println("Message: ${message.get()}")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<MyCustomTask>("myTask") {
|
||||
message.set("Hello from custom task!")
|
||||
}
|
||||
```
|
||||
|
||||
## 4. Configuring Standard Plugins
|
||||
|
||||
### Java/Kotlin Library
|
||||
|
||||
```kotlin
|
||||
plugins {
|
||||
`java-library`
|
||||
kotlin("jvm")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api("com.example:some-api:1.0")
|
||||
implementation("com.example:some-impl:1.0")
|
||||
testImplementation(kotlin("test"))
|
||||
}
|
||||
```
|
||||
|
||||
### Application Plugin
|
||||
|
||||
```kotlin
|
||||
plugins {
|
||||
application
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("com.example.Main")
|
||||
}
|
||||
```
|
||||
|
||||
## Resources
|
||||
|
||||
- [Multi-project builds](https://docs.gradle.org/current/userguide/multi_project_builds.html)
|
||||
- [Developing Custom Gradle Plugins](https://docs.gradle.org/current/userguide/custom_plugins.html)
|
||||
- [Authoring maintainable builds](https://docs.gradle.org/current/userguide/authoring_maintainable_builds.html)
|
||||
27
.agents/skills/gradle/references/diagnostic_tasks.md
Normal file
@ -0,0 +1,27 @@
|
||||
# Authoritative Diagnostic Tasks
|
||||
|
||||
Gradle provides built-in tasks for deep introspection. Always use `captureTaskOutput` with these for the best experience.
|
||||
|
||||
### 1. Project & Task Discovery
|
||||
|
||||
- **`projects`**: Lists the sub-projects in the build.
|
||||
- `gradle(commandLine=[":projects"], captureTaskOutput=":projects")`
|
||||
- **`tasks`**: Lists runnable tasks. Use `--all` for a full list (including ungrouped tasks).
|
||||
- `gradle(commandLine=[":app:tasks", "--all"], captureTaskOutput=":app:tasks")`
|
||||
- **`help`**: Displays global or task-specific help.
|
||||
- `gradle(commandLine=[":help", "--task", "test"], captureTaskOutput=":help")`
|
||||
|
||||
### 2. Property & Environment Auditing
|
||||
|
||||
- **`properties`**: Lists all project properties. Use `--property <name>` for surgical extraction.
|
||||
- `gradle(commandLine=[":properties", "--property", "version"], captureTaskOutput=":properties")`
|
||||
- **`javaToolchains`**: Displays detected JVM toolchains and their properties.
|
||||
- `gradle(commandLine=[":javaToolchains"], captureTaskOutput=":javaToolchains")`
|
||||
|
||||
### 3. Low-Level Dependency & Variant Analysis
|
||||
|
||||
- **`dependencyInsight`**: Investigates why a specific dependency version was chosen.
|
||||
- `gradle(commandLine=[":app:dependencyInsight", "--dependency", "slf4j-api", "--configuration", "compileClasspath"], captureTaskOutput=":app:dependencyInsight")`
|
||||
- **`outgoingVariants`**: Displays the variants the project provides to consumers.
|
||||
- `gradle(commandLine=[":app:outgoingVariants"], captureTaskOutput=":app:outgoingVariants")`
|
||||
- **`resolvableConfigurations`**: Displays the configurations available for resolution.
|
||||
100
.agents/skills/gradle/references/gradle_docs_research.md
Normal file
@ -0,0 +1,100 @@
|
||||
# Official Gradle Documentation Research
|
||||
|
||||
Guidance on using the `gradle_docs` tool for authoritative documentation lookup, including the User Guide, DSL Reference, Release Notes, samples, and API reference.
|
||||
|
||||
## Searching the User Guide
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "tag:userguide working with files",
|
||||
"projectRoot": "/absolute/path/to/project"
|
||||
}
|
||||
```
|
||||
|
||||
## Navigating the DSL Reference
|
||||
|
||||
```json
|
||||
{
|
||||
"path": "dsl/org.gradle.api.Project.html",
|
||||
"projectRoot": "/absolute/path/to/project"
|
||||
}
|
||||
```
|
||||
|
||||
## Searching for Samples
|
||||
|
||||
Official code samples are indexed with the `tag:samples` metadata:
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "tag:samples toolchains",
|
||||
"projectRoot": "/absolute/path/to/project"
|
||||
}
|
||||
```
|
||||
|
||||
## Searching Javadocs
|
||||
|
||||
Technical API documentation is indexed with the `tag:javadoc` metadata:
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "tag:javadoc Project",
|
||||
"projectRoot": "/absolute/path/to/project"
|
||||
}
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Getting an Index of Best Practices
|
||||
|
||||
First, explore the `userguide/` directory to identify the correct files:
|
||||
|
||||
```json
|
||||
{
|
||||
"path": "userguide/",
|
||||
"projectRoot": "/absolute/path/to/project"
|
||||
}
|
||||
```
|
||||
|
||||
This lists the contents of the `userguide` directory. Look for files starting with `best_practices` (e.g., `best_practices.md`, `best_practices_dependency_management.md`). Once identified, read the main index:
|
||||
|
||||
```json
|
||||
{
|
||||
"path": "userguide/best_practices.md",
|
||||
"projectRoot": "/absolute/path/to/project"
|
||||
}
|
||||
```
|
||||
|
||||
### Searching for Best Practices
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "tag:best-practices dependency management",
|
||||
"projectRoot": "/absolute/path/to/project"
|
||||
}
|
||||
```
|
||||
|
||||
### Searching for Specific Guidance
|
||||
|
||||
```json
|
||||
{
|
||||
"query": "tag:userguide performance best practices",
|
||||
"projectRoot": "/absolute/path/to/project"
|
||||
}
|
||||
```
|
||||
|
||||
## Exploring the Documentation Tree
|
||||
|
||||
Use `gradle_docs` with `path="."` to explore the root documentation tree:
|
||||
|
||||
```json
|
||||
{
|
||||
"path": ".",
|
||||
"projectRoot": "/absolute/path/to/project"
|
||||
}
|
||||
```
|
||||
|
||||
## External Resources
|
||||
|
||||
- [Official Gradle Best Practices](https://docs.gradle.org/current/userguide/best_practices.html)
|
||||
- [Gradle Performance Guide](https://docs.gradle.org/current/userguide/performance.html)
|
||||
- [Kotlin DSL Primer](https://docs.gradle.org/current/userguide/kotlin_dsl.html)
|
||||
380
.agents/skills/gradle/references/query_build_diagnostics.md
Normal file
@ -0,0 +1,380 @@
|
||||
# query_build Diagnostics Reference
|
||||
|
||||
Comprehensive guide to inspecting build results, diagnosing failures, and monitoring progress with `query_build` and `wait_build`.
|
||||
|
||||
## Quick Reference
|
||||
|
||||
| Goal | Tool Call |
|
||||
|--------------------------|--------------------------------------------------------------------------------|
|
||||
| See recent/active builds | `query_build()` |
|
||||
| Build-level summary | `query_build(buildId="ID")` |
|
||||
| Specific failure | `query_build(buildId="ID", kind="FAILURES", query="F0")` |
|
||||
| Specific problem | `query_build(buildId="ID", kind="PROBLEMS", query="P1")` |
|
||||
| Task output | `query_build(buildId="ID", kind="TASKS", query=":app:compileJava")` |
|
||||
| List failed tests | `query_build(buildId="ID", kind="TESTS", outcome="FAILED")` |
|
||||
| Per-test stack trace | `query_build(buildId="ID", kind="TESTS", query="com.example.MyTest.myMethod")` |
|
||||
| Console logs (regex) | `query_build(buildId="ID", kind="CONSOLE", query="ERROR")` |
|
||||
| Full export to file | `query_build(buildId="ID", kind="CONSOLE", outputFile="path/to/logs.txt")` |
|
||||
| Wait for log pattern | `wait_build(buildId="ID", timeout=60, waitFor="Started")` |
|
||||
| Wait for task | `wait_build(buildId="ID", timeout=120, waitForTask=":app:assemble")` |
|
||||
| Wait for finish | `wait_build(buildId="ID", timeout=600)` |
|
||||
|
||||
---
|
||||
|
||||
## 1. Build Dashboard (`query_build()`)
|
||||
|
||||
Call `query_build()` with no arguments to see the **Build Dashboard** — a list of active background builds and recently completed builds with `BuildId`, status, and failure counts. Use this to discover valid `BuildId`s and ensure no
|
||||
orphaned background builds are consuming resources.
|
||||
|
||||
```json
|
||||
{}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 2. Build Summary (`query_build(buildId="ID")`)
|
||||
|
||||
Provide a `buildId` to get a structured summary of that specific build, including:
|
||||
|
||||
- Overall build status (SUCCESS, FAILED, etc.)
|
||||
- Failure IDs and descriptions
|
||||
- Problem IDs and descriptions
|
||||
- Test result counts (passed, failed, skipped, etc.)
|
||||
|
||||
The summary includes a guide on how to inspect specific details using the appropriate `kind`.
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 3. Failure Inspection (`kind="FAILURES"`)
|
||||
|
||||
Inspect a specific build failure to see the full error message and stack trace. Find failure IDs (`F0`, `F1`, etc.) in the build summary. If you provide a unique prefix instead of the exact ID, the tool auto-resolves it.
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"kind": "FAILURES",
|
||||
"query": "F0"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 4. Problem Inspection (`kind="PROBLEMS"`)
|
||||
|
||||
Inspect a specific compilation or configuration problem. Find problem IDs (`P0`, `P1`, etc.) in the build summary. Provides file locations, error messages, and suggestions where available.
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"kind": "PROBLEMS",
|
||||
"query": "P1"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. Task Output Inspection (`kind="TASKS"`)
|
||||
|
||||
If the failure is task-related, check the isolated output of a specific task. Supports prefix matching on the task path.
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"kind": "TASKS",
|
||||
"query": ":app:compileJava"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 6. Test Inspection (`kind="TESTS"`)
|
||||
|
||||
### Listing Failed Tests (Summary Mode)
|
||||
|
||||
Quickly see which tests failed without being overwhelmed by logs:
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"kind": "TESTS",
|
||||
"outcome": "FAILED"
|
||||
}
|
||||
```
|
||||
|
||||
### Getting Detailed Test Output (Details Mode)
|
||||
|
||||
**CRITICAL**: Always use `kind="TESTS"` and `query` to see the complete stdout, stderr, and stack trace for a specific test. Supports unique prefix matching on the test name.
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"kind": "TESTS",
|
||||
"query": "com.example.MyTest.testMethod"
|
||||
}
|
||||
```
|
||||
|
||||
### Individual Test Case vs. Task Output
|
||||
|
||||
**DO NOT** use `taskPath` or `captureTaskOutput` for investigating specific test failures:
|
||||
|
||||
- **Task output** is the aggregated log of the entire test process. It is often truncated, interleaved, and lacks the full stack traces and per-test isolation needed for debugging.
|
||||
- **Individual test output** (retrieved via `query`) is authoritative, includes full stdout/stderr for just that test case, and provides the complete stack trace for any failure.
|
||||
|
||||
### Filtering by Name
|
||||
|
||||
Use `query` with summary mode to see all executions of a test across different projects or iterations:
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"kind": "TESTS",
|
||||
"query": "MyTest"
|
||||
}
|
||||
```
|
||||
|
||||
### Monitoring Test Progress
|
||||
|
||||
While a build is running, progress notifications provide real-time counts of passed, failed, and skipped tests. Call `query_build(buildId="ID")` repeatedly to see updated test counts: `(5 passed, 1 failed)`.
|
||||
|
||||
### Pagination for Large Test Suites
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"kind": "TESTS",
|
||||
"pagination": {
|
||||
"limit": 50,
|
||||
"offset": 0
|
||||
},
|
||||
"query": "com.example.service"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 7. Console Log Inspection (`kind="CONSOLE"`)
|
||||
|
||||
If structured reports are insufficient, examine the raw console output. Use `query` as a regex filter.
|
||||
|
||||
### Head (first N lines)
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"kind": "CONSOLE",
|
||||
"pagination": {
|
||||
"limit": 100,
|
||||
"offset": 0
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Tail (last N lines)
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"kind": "CONSOLE",
|
||||
"pagination": {
|
||||
"limit": 100
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Filtered by Regex
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"kind": "CONSOLE",
|
||||
"query": "ERROR|FAILURE"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 8. Progress Monitoring (`wait_build`)
|
||||
|
||||
Use `wait_build` with `timeout`, `waitFor`, or `waitForTask` to block until a condition is met in a background build.
|
||||
|
||||
### Waiting for a Log Message
|
||||
|
||||
The most common pattern for background builds (dev servers) is waiting for a specific readiness message:
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"timeout": 60,
|
||||
"waitFor": "Started Application"
|
||||
}
|
||||
```
|
||||
|
||||
### Waiting for Task Completion
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"timeout": 120,
|
||||
"waitForTask": ":app:assemble"
|
||||
}
|
||||
```
|
||||
|
||||
### Waiting for Build Completion
|
||||
|
||||
If `timeout` is set without a wait condition, the tool waits for the build to finish:
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"timeout": 600
|
||||
}
|
||||
```
|
||||
|
||||
### Handling Timeouts
|
||||
|
||||
If a build takes longer than the `timeout` value, `wait_build` returns the current status. You can call it again with a new timeout.
|
||||
|
||||
### Continuous Builds
|
||||
|
||||
For continuous builds, wait for the "Waiting for changes" message after the first build completes:
|
||||
|
||||
```json
|
||||
// Start
|
||||
{ "commandLine": ["build", "--continuous"], "background": true }
|
||||
|
||||
// Wait
|
||||
{ "buildId": "BUILD_ID", "timeout": 120, "waitFor": "Waiting for changes" }
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 9. Full Export (`outputFile`)
|
||||
|
||||
Use `outputFile="path/to/file.txt"` to write the entire result to a file. This bypasses pagination limits and reduces token usage. Works with all `kind` values.
|
||||
|
||||
```json
|
||||
{
|
||||
"buildId": "BUILD_ID",
|
||||
"kind": "CONSOLE",
|
||||
"outputFile": "C:/temp/build_output.txt"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 10. Diagnostic Workflow
|
||||
|
||||
When a build fails, follow this structured approach:
|
||||
|
||||
### Step 1: Get the Build Summary
|
||||
|
||||
```json
|
||||
{ "buildId": "BUILD_ID" }
|
||||
```
|
||||
|
||||
Provides the high-level overview: failures, problems, and failed tests.
|
||||
|
||||
### Step 2: Inspect Failures
|
||||
|
||||
```json
|
||||
{ "buildId": "BUILD_ID", "kind": "FAILURES", "query": "F0" }
|
||||
```
|
||||
|
||||
### Step 3: Inspect Problems
|
||||
|
||||
```json
|
||||
{ "buildId": "BUILD_ID", "kind": "PROBLEMS", "query": "P1" }
|
||||
```
|
||||
|
||||
### Step 4: Check Task Outputs
|
||||
|
||||
```json
|
||||
{ "buildId": "BUILD_ID", "kind": "TASKS", "query": ":app:compileJava" }
|
||||
```
|
||||
|
||||
### Step 5: Check Test Failures
|
||||
|
||||
```json
|
||||
{ "buildId": "BUILD_ID", "kind": "TESTS", "outcome": "FAILED" }
|
||||
```
|
||||
|
||||
Then drill into each failed test:
|
||||
|
||||
```json
|
||||
{ "buildId": "BUILD_ID", "kind": "TESTS", "query": "com.example.MyTest.shouldWork" }
|
||||
```
|
||||
|
||||
### Step 6: Fall Back to Console Logs
|
||||
|
||||
```json
|
||||
{ "buildId": "BUILD_ID", "kind": "CONSOLE", "pagination": { "limit": 100 } }
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 11. Build Failures vs. Test Failures
|
||||
|
||||
Sometimes a test run fails because the build itself failed (compilation error, configuration error, task dependency failure), not because a test failed.
|
||||
|
||||
1. Check the build summary: `query_build(buildId="ID")`.
|
||||
2. If failures or problems are listed, inspect them directly via `kind="FAILURES"` or `kind="PROBLEMS"`.
|
||||
3. If the build failed but no tests are reported, focus on build-level failures and problems.
|
||||
|
||||
---
|
||||
|
||||
## 12. Common Failure Scenarios
|
||||
|
||||
### Compilation Errors
|
||||
|
||||
- Look for problems with the specific `severity: ERROR` in the build summary.
|
||||
- Check `kind="PROBLEMS"` for file location and error details.
|
||||
|
||||
### Dependency Resolution Issues
|
||||
|
||||
- Check `kind="FAILURES"` for messages like "Could not resolve all dependencies".
|
||||
- Use `inspect_dependencies` to investigate the dependency graph.
|
||||
|
||||
### Task Execution Failures
|
||||
|
||||
- Check `kind="TASKS"` to see which task failed and its output.
|
||||
|
||||
### Build Script Errors
|
||||
|
||||
- Usually appear in the `kind="FAILURES"` section with a stack trace and line reference.
|
||||
|
||||
### Assertion Failures
|
||||
|
||||
- Check `kind="TESTS"` with the specific test `query` for expected vs. actual values.
|
||||
|
||||
### Timeouts
|
||||
|
||||
- Tests that time out may be marked as ERROR or FAILED. Check console output for "Timeout" messages.
|
||||
|
||||
### Infrastructure Issues
|
||||
|
||||
- If many tests fail with similar errors (`NoClassDefFoundError`, `DatabaseConnectionException`), check build-level failures and problems.
|
||||
|
||||
---
|
||||
|
||||
## 13. Stopping Background Builds
|
||||
|
||||
Always stop background builds when they are no longer needed:
|
||||
|
||||
```json
|
||||
{
|
||||
"stopBuildId": "BUILD_ID"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 14. Foreground vs. Background Identity
|
||||
|
||||
Monitoring a background build using `query_build` or `wait_build` provides exactly the same rich diagnostic data as a foreground build, including progressive disclosure. The difference is control flow: background allows non-blocking work
|
||||
while the build proceeds; foreground blocks until completion.
|
||||
119
.agents/skills/interacting_with_project_runtime/SKILL.md
Normal file
@ -0,0 +1,119 @@
|
||||
---
|
||||
name: interacting_with_project_runtime
|
||||
description: >
|
||||
Executes Kotlin code interactively within the project's full JVM classpath.
|
||||
Use when you need to RUN code: verify runtime behavior, experiment with logic, or render Compose UI previews.
|
||||
Do NOT use to understand an API's shape or signature — read its source with `exploring_dependency_sources` instead.
|
||||
license: Apache-2.0
|
||||
metadata:
|
||||
author: https://github.com/rnett/gradle-mcp
|
||||
version: "2.3"
|
||||
---
|
||||
|
||||
# Authoritative Project Runtime Interaction
|
||||
|
||||
Runs Kotlin code interactively within the project's exact JVM classpath — for when you need to execute, not just read.
|
||||
|
||||
## Constitution
|
||||
|
||||
- **The core decision rule**: If the question is *"what does this API look like or how does it work?"* → use `search_dependency_sources` / `read_dependency_sources` (read the source). If the question is *"what happens when I run this?"* →
|
||||
use `kotlin_repl`.
|
||||
- **NEVER** start a REPL session to learn about an API. Reading indexed sources is instantaneous, shows the full implementation with all overloads, and requires no JVM process.
|
||||
- **ALWAYS** use `kotlin_repl` instead of a standalone Kotlin REPL for project-aware interaction.
|
||||
- **ALWAYS** provide absolute paths for `projectRoot`.
|
||||
- **ALWAYS** start a REPL session with the correct `projectPath` and `sourceSet` (e.g., `main`, `test`).
|
||||
- **ALWAYS** restart the REPL (`stop` then `start`) after modifying project source code to pick up changes in the classpath.
|
||||
- **ALWAYS** use the `responder` API for rich output (images, markdown) to improve diagnostic visibility.
|
||||
- **NEVER** leave a REPL session running indefinitely; use `stop` when finished.
|
||||
- **REPL Session Management**: Explicitly terminate previous REPL sessions in `ReplTools` before starting new ones when session IDs are regenerated. This prevents leaking worker processes and ensures stable session management during
|
||||
concurrent or sequential tool calls.
|
||||
|
||||
## Directives
|
||||
|
||||
- **Read to understand, run to verify**: If you need to understand what an API does — its signature, parameters, overloads, or implementation — read its source via `search_dependency_sources` / `read_dependency_sources`. Only reach for the
|
||||
REPL once you know what you want to call and need to observe actual runtime output.
|
||||
- **ALWAYS use project-aware REPL**: Only the `kotlin_repl` tool provides full access to the project's exact classpath, dependencies, and source sets. NEVER attempt to use standalone runners for project-internal logic.
|
||||
- **Identify the environment**: When starting a session, ALWAYS ensure you select the appropriate `projectPath` (e.g., `:app`) and `sourceSet` (e.g., `main` for application code, `test` for test utility access).
|
||||
- **Pick up source changes**: The REPL uses a static snapshot of the classpath. If you change project code, you MUST `stop` and then `start` the session again to pick up the updated classes.
|
||||
- **Utilize the `responder`**: ALWAYS use `responder.render()` or specialized methods (`markdown`, `image`, `html`) to return rich content.
|
||||
- **Import necessary classes**: ALWAYS provide explicit imports for project-specific and library classes.
|
||||
- **Use `envSource: SHELL` if environment variables are missing**: If the REPL fails to find expected environment variables (e.g., `JAVA_HOME` or specific JDKs), it may be because the host process started before the shell environment was
|
||||
fully loaded. Set `env: { envSource: "SHELL" }` when calling `start` to force a new shell process to query the environment.
|
||||
- **Resolve `{baseDir}` manually**: If your environment does not automatically resolve the `{baseDir}` placeholder in reference links, treat it as the absolute path to the directory containing this `SKILL.md` file.
|
||||
|
||||
## When to Use (you need to RUN code)
|
||||
|
||||
- **Behavior Verification**: You know the API, you've written the call, and you need to observe the actual runtime output or side-effects.
|
||||
- **Logic Prototyping**: Experimenting with an algorithm or snippet of your own code before committing it to source.
|
||||
- **Visual Component Auditing**: Rendering Compose UI components to images for visual review.
|
||||
- **Dynamic Data Probing**: One-off data transformations using your project's existing utilities where the output depends on runtime state.
|
||||
|
||||
## When NOT to Use (you need to READ source instead)
|
||||
|
||||
Ask yourself: *"Am I trying to understand this API, or run it?"*
|
||||
|
||||
If you're trying to understand it — what methods it has, what its parameters are, how it's implemented — **stop and use `exploring_dependency_sources` first**. The REPL cannot tell you what you don't already know to ask; source reading can.
|
||||
Examples of what belongs in source reading, not the REPL:
|
||||
|
||||
- "What methods does `SomeClass` have?" → `search_dependency_sources` DECLARATION search
|
||||
- "What does this function do internally?" → `read_dependency_sources`
|
||||
- "What are the parameters / overloads of this function?" → `read_dependency_sources`
|
||||
- "Does this library have a class for X?" → `search_dependency_sources` FULL_TEXT or DECLARATION search
|
||||
|
||||
## Workflows
|
||||
|
||||
### Starting an Authoritative Session
|
||||
|
||||
1. Identify the project module (e.g., `:app`) and source set (e.g., `main`).
|
||||
2. Call `kotlin_repl(command="start")`.
|
||||
3. Optionally provide `env` for environment variables or `additionalDependencies` if you need external libraries not currently in the project.
|
||||
|
||||
### Probing Code & State
|
||||
|
||||
1. Use `kotlin_repl(command="run")` with your Kotlin code.
|
||||
2. Use `responder.render()` for rich diagnostics.
|
||||
3. Review the returned text or image content.
|
||||
|
||||
### Lifecycle Management
|
||||
|
||||
1. Use `kotlin_repl(command="stop")` once your investigation is complete to release system resources.
|
||||
|
||||
## Examples
|
||||
|
||||
### Probing a project utility function
|
||||
|
||||
```json
|
||||
// Start the session
|
||||
{
|
||||
"command": "start",
|
||||
"projectPath": ":my-project",
|
||||
"sourceSet": "main"
|
||||
}
|
||||
|
||||
// Execute the probe
|
||||
{
|
||||
"command": "run",
|
||||
"code": "import com.example.utils.MyHelper\nMyHelper.calculateSum(1, 2)"
|
||||
}
|
||||
// Reasoning: Using kotlin_repl to verify a utility function in the context of the main source set.
|
||||
```
|
||||
|
||||
### Visualizing a UI Component
|
||||
|
||||
```kotlin
|
||||
import androidx.compose.ui.test.*
|
||||
import com.example.ui.MyComposable
|
||||
|
||||
runComposeUiTest {
|
||||
setContent { MyComposable() }
|
||||
val bitmap = onRoot().captureToImage()
|
||||
responder.render(bitmap)
|
||||
}
|
||||
// Reasoning: Using the responder API to retrieve a high-resolution image of a Compose component.
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- **REPL Not Started**: You must call `start` successfully before calling `run`.
|
||||
- **ClassNotFoundException**: Ensure the project has been built at least once and that you have selected the correct `sourceSet` (e.g., `test` if the class is in `src/test/kotlin`).
|
||||
- **Changes Not Reflected**: If your code changes aren't appearing, `stop` and `start` the REPL to refresh the classpath.
|
||||
166
.agents/skills/managing_gradle_dependencies/SKILL.md
Normal file
@ -0,0 +1,166 @@
|
||||
---
|
||||
name: managing_gradle_dependencies
|
||||
description: >
|
||||
Audits and manages Gradle dependency graphs with high-resolution update checks, transitive tree analysis, and Maven Central discovery;
|
||||
use for dependency auditing, finding stable updates, and resolving GAV coordinates.
|
||||
Do NOT use for exploring dependency source code (use `exploring_dependency_sources`) or running builds/tests (use `gradle`).
|
||||
license: Apache-2.0
|
||||
metadata:
|
||||
author: https://github.com/rnett/gradle-mcp
|
||||
version: "3.4"
|
||||
---
|
||||
|
||||
# Authoritative Dependency Intelligence & Maven Central Search
|
||||
|
||||
Audits project dependencies, performs high-resolution update checks, and discovers new libraries on Maven Central with powerful, integrated search tools.
|
||||
|
||||
## Constitution
|
||||
|
||||
- **ALWAYS** use `inspect_dependencies` for querying project dependency information instead of raw Gradle tasks.
|
||||
- **ALWAYS** provide absolute paths for `projectRoot`.
|
||||
- **ALWAYS** use `updatesOnly: true` to quickly identify available library updates.
|
||||
- **ALWAYS** use `lookup_maven_versions` to find exact GAV coordinates for new libraries.
|
||||
- **NEVER** add a dependency to a project without verifying its authoritative version and existence on Maven Central.
|
||||
- **ALWAYS** use the `projectPath` argument to target specific modules in multi-project builds.
|
||||
|
||||
## Directives
|
||||
|
||||
- **Identify authoritative paths**: ALWAYS use the Gradle project path (e.g., `:app`) when querying dependencies.
|
||||
- **Inspect plugins and build scripts**: Build script dependencies (like plugins) are automatically included in `inspect_dependencies` output under configurations prefixed with `buildscript:` (e.g. `buildscript:classpath`).
|
||||
- **Monitor for updates**: ALWAYS use `updatesOnly: true` in `inspect_dependencies` to retrieve a flat, high-signal report of available library updates: `group:artifact: current → latest` with the project paths where each dep is used.
|
||||
Configuration and source-set detail is intentionally omitted; use `inspect_dependencies` with a specific `dependency` filter if that detail is needed.
|
||||
- **Target dependencies surgically**: Use the `dependency` parameter in `inspect_dependencies` to target a single library with a full-string Kotlin regex over `group:name:version[:variant]` coordinates.
|
||||
- **Efficient Transitive Isolation**: When isolating a single library, filter the flattened list of resolved components using the dependency filter rather than traversing the dependency graph. This naturally and efficiently excludes
|
||||
transitive dependencies that do not match the targeted filter.
|
||||
- **Discover libraries surgically**: ALWAYS use `lookup_maven_versions` to check the version history of an existing artifact.
|
||||
- **Use `gradle` for diagnostics**: For built-in tasks like `dependencyInsight`, ALWAYS use the `gradle` tool with `captureTaskOutput`.
|
||||
- **Audit full trees**: ALWAYS use `onlyDirect: false` in `inspect_dependencies` when you need to visualize the complete transitive dependency graph.
|
||||
|
||||
## When to Use
|
||||
|
||||
- **Dependency Tree Auditing**: When you need to visualize the full dependency graph for a specific project, configuration, or source set.
|
||||
- **Automated Update Detection**: When performing maintenance and you want a concise report on available stable or pre-release updates.
|
||||
- **Precision Artifact Discovery**: When looking for new libraries on Maven Central and you need to find exact GAV coordinates or explore an artifact's full version history.
|
||||
- **Version Conflict Resolution**: When you need to identify why a specific version of a library is being resolved and look for compatible alternatives.
|
||||
- **Targeted Audit**: When you only care about a specific library and want to bypass the cost of a full project resolution.
|
||||
|
||||
## Workflows
|
||||
|
||||
### 1. Auditing Dependencies
|
||||
|
||||
1. Identify the project module (e.g., `:app`).
|
||||
2. Call `inspect_dependencies(projectPath=":app")`.
|
||||
3. Optionally filter by `configuration` (e.g., `runtimeClasspath`) or `sourceSet` (e.g., `test`).
|
||||
|
||||
### 2. Checking for Stable Updates
|
||||
|
||||
1. Call `inspect_dependencies(updatesOnly=true, stableOnly=true)`.
|
||||
2. Review the flat list of upgradeable dependencies. Each entry shows `group:artifact: current → latest` and the project paths where it is used.
|
||||
|
||||
### 3. Discovering New Libraries
|
||||
|
||||
1. Use `lookup_maven_versions(coordinates="group:artifact")` to see all available versions for a specific library.
|
||||
|
||||
### 4. Targeted Dependency Inspection
|
||||
|
||||
1. Identify the dependency you want to check (e.g., `org.mongodb:mongodb-driver-sync`).
|
||||
2. Call `inspect_dependencies(dependency="^org\\.mongodb:mongodb-driver-sync(:.*)?$")`.
|
||||
3. The report will be focused ONLY on that library across all matched configurations.
|
||||
|
||||
### 5. Adding a New Dependency
|
||||
|
||||
1. **Search Maven Central**: Use `lookup_maven_versions(coordinates="group:artifact")` to find the artifact and its latest version.
|
||||
2. **Update Version Catalog**: Add the dependency coordinates to `gradle/libs.versions.toml`:
|
||||
```toml
|
||||
[versions]
|
||||
my-lib = "X.Y.Z"
|
||||
|
||||
[libraries]
|
||||
my-lib = { group = "com.example", name = "my-lib", version.ref = "my-lib" }
|
||||
```
|
||||
3. **Apply to `build.gradle.kts`**: Use the type-safe catalog accessor (e.g., `implementation(libs.my.lib)`) in the appropriate dependency configuration.
|
||||
4. **Verify Resolution**: Run `inspect_dependencies(fresh: true)` to confirm the dependency resolves correctly.
|
||||
|
||||
#### Example: Adding a dependency to a subproject
|
||||
|
||||
```json
|
||||
// Step 1: Discover the library
|
||||
{
|
||||
"coordinates": "com.squareup.retrofit2:retrofit"
|
||||
}
|
||||
// Step 2: Update libs.versions.toml with the version and library entry
|
||||
// Step 3: Add `implementation(libs.retrofit)` to the subproject's build.gradle.kts
|
||||
// Step 4: Verify
|
||||
{
|
||||
"projectPath": ":app",
|
||||
"dependency": "^com\\.squareup\\.retrofit2:retrofit(:.*)?$"
|
||||
}
|
||||
// Reasoning: Adding the Retrofit library to the 'app' module with full resolution verification.
|
||||
```
|
||||
|
||||
### 6. Verifying Plugin Dependencies
|
||||
|
||||
Build script dependencies (plugins) are automatically reported under `buildscript:` configurations. To specifically verify plugin resolution:
|
||||
|
||||
1. Call `inspect_dependencies(sourceSetPath=":buildscript")` for the root project, or `sourceSetPath=":app:buildscript"` for a subproject.
|
||||
2. Review the `buildscript:classpath` configuration for plugin dependencies.
|
||||
3. Use `fresh: true` if plugins were recently added or updated.
|
||||
|
||||
#### Example: Verifying a specific plugin
|
||||
|
||||
```json
|
||||
{
|
||||
"sourceSetPath": ":buildscript",
|
||||
"dependency": "^org\\.jetbrains\\.kotlin:kotlin-gradle-plugin(:.*)?$"
|
||||
}
|
||||
// Reasoning: Verifying the Kotlin plugin is properly resolved in the buildscript classpath.
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### List dependencies for a specific module
|
||||
|
||||
```json
|
||||
{
|
||||
"projectPath": ":app"
|
||||
}
|
||||
// Reasoning: Auditing the direct and transitive dependencies of the 'app' module to understand its runtime footprint.
|
||||
```
|
||||
|
||||
### Check for updates for a specific library
|
||||
|
||||
```json
|
||||
{
|
||||
"dependency": "^org\\.jetbrains\\.kotlinx:kotlinx-coroutines-core(:.*)?$",
|
||||
"updatesOnly": true
|
||||
}
|
||||
// Reasoning: Surgically checking if a specific library has available updates.
|
||||
```
|
||||
|
||||
### Check for stable updates across the project
|
||||
|
||||
```json
|
||||
{
|
||||
"updatesOnly": true,
|
||||
"stableOnly": true
|
||||
}
|
||||
// Reasoning: Performing a high-signal update audit that ignores unstable pre-release versions.
|
||||
```
|
||||
|
||||
### List all versions of a specific library
|
||||
|
||||
```json
|
||||
{
|
||||
"coordinates": "org.jetbrains.kotlinx:kotlinx-serialization-json"
|
||||
}
|
||||
// Reasoning: Retrieving the full version history of an artifact to identify the latest stable or specific version required.
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- **Dependency Not Found**: Verify the `projectPath` using the `projects` task in the `gradle` skill.
|
||||
- **Update Not Showing**: If a known update is missing, ensure `stableOnly` is set correctly and check if a `versionFilter` is active.
|
||||
- **[UPDATE CHECK SKIPPED]**: This annotation means the dep was in scope for update checking but its resolution genuinely failed — it does NOT appear for dependencies intentionally excluded from the update-check scope (e.g., transitive deps
|
||||
when `onlyDirect=true`, or deps excluded by a `dependency` filter).
|
||||
- **Maven Search No Results**: Use broader search terms or verify the `group:artifact` format for version searches.
|
||||
- **Missing environment variables**: Set `invocationArguments: { envSource: "SHELL" }` if Gradle cannot find expected env vars (e.g., `JAVA_HOME`).
|
||||
165
.agents/skills/verifying_compose_ui/SKILL.md
Normal file
@ -0,0 +1,165 @@
|
||||
---
|
||||
name: verifying_compose_ui
|
||||
description: >
|
||||
Visually verifies Compose UI components by rendering @Composable/@Preview functions to images from the project's JVM runtime;
|
||||
STRONGLY PREFERRED for rapid UI iteration and visual feedback on any composable.
|
||||
Do NOT use for build lifecycle tasks or dependency auditing.
|
||||
license: Apache-2.0
|
||||
metadata:
|
||||
author: https://github.com/rnett/gradle-mcp
|
||||
version: "2.2"
|
||||
---
|
||||
|
||||
## ⚠️ FUNDAMENTAL ANDROID LIMITATION
|
||||
|
||||
**IMPORTANT: `runComposeUiTest` and image capture methods (`node.captureToImage()`) are NOT supported on Android and CANNOT work.**
|
||||
|
||||
### Why This Cannot Work
|
||||
|
||||
The `runComposeUiTest` function requires a JVM-based test runtime with desktop Compose rendering (via Skiko on JVM/Desktop). Android's ART (Android Runtime) does not support the desktop Compose testing APIs, and image capture via
|
||||
`captureToImage()` relies on desktop-specific rendering pipelines that are fundamentally incompatible with Android.
|
||||
|
||||
### The Solution: Use a JVM Target
|
||||
|
||||
**For visual verification of Composables, you MUST use a JVM or Desktop target source set.** This is not a workaround—it is the only supported method.
|
||||
|
||||
Recommended approach:
|
||||
|
||||
1. **Put your Composables in a common source set** (`commonMain`) that is shared across all targets
|
||||
2. **Create or use a JVM target** (e.g., `jvmMain`, `desktopMain`) that depends on `commonMain`
|
||||
3. **Run the REPL on the JVM target** (`sourceSet: "jvmMain"` or `sourceSet: "jvmTest"`)
|
||||
|
||||
This is the standard KMP pattern and allows you to verify your UI code without needing an Android device or emulator.
|
||||
|
||||
### What WILL NOT Work
|
||||
|
||||
- ❌ Running the REPL with `sourceSet: "androidMain"`
|
||||
- ❌ Running the REPL with `sourceSet: "androidTest"`
|
||||
- ❌ Any attempt to use `runComposeUiTest` on Android
|
||||
- ❌ Any attempt to use `captureToImage()` on Android
|
||||
|
||||
### What WILL Work
|
||||
|
||||
- ✅ Running the REPL with `sourceSet: "jvmMain"` or `sourceSet: "jvmTest"`
|
||||
- ✅ Running the REPL with `sourceSet: "desktopMain"` or `sourceSet: "desktopTest"`
|
||||
- ✅ Using `runComposeUiTest` with `captureToImage()` on JVM/Desktop targets
|
||||
|
||||
---
|
||||
|
||||
# Authoritative Compose UI Preview & Visual Verification
|
||||
|
||||
Visually verifies and renders any @Composable or @Preview directly to high-quality images from the project-aware REPL for instant, authoritative visual feedback.
|
||||
|
||||
## Constitution
|
||||
|
||||
- **ALWAYS** use `kotlin_repl` to render Compose components instead of running the full application for visual checks.
|
||||
- **ALWAYS** provide absolute paths for `projectRoot`.
|
||||
- **ALWAYS** use `node.captureToImage()` and `responder.render(bitmap)` to return the visual output.
|
||||
- **ALWAYS** ensure the correct Compose UI testing dependencies are on the classpath, using `additionalDependencies` if necessary.
|
||||
- **NEVER** assume a UI component renders correctly without visual verification.
|
||||
- **ALWAYS** search for existing `@Preview` functions in the project source code before creating new ones.
|
||||
|
||||
## Directives
|
||||
|
||||
- **ALWAYS provide absolute `projectRoot`**: Ensure `projectRoot` is an **absolute file system path** for all `kotlin_repl` calls.
|
||||
- **Ensure dependencies**: ALWAYS ensure Compose UI testing dependencies (e.g., `androidx.compose.ui:ui-test-junit4`) are on the classpath.
|
||||
- **Note on versions**: ALWAYS check your project's version catalog and existing tests for the correct imports for `runComposeUiTest`.
|
||||
- **Render as image**: ALWAYS use `node.captureToImage()` and `responder.render(bitmap)` to return the visual output.
|
||||
- **Kotlin Multiplatform (KMP) Note**: The `kotlin_repl` currently only supports **JVM-based** source sets. ALWAYS select a JVM or Desktop target source set for visual checks.
|
||||
- **Use `envSource: SHELL` if environment variables are missing**: Set `env: { envSource: "SHELL" }` (REPL start) or `invocationArguments: { envSource: "SHELL" }` (Gradle tasks) if expected env vars (e.g., `JAVA_HOME`) are not found.
|
||||
|
||||
## When to Use
|
||||
|
||||
- **Rapid UI Prototyping & Iteration**: When you need to see the visual result of a Composable change instantly without the latency of a full application launch.
|
||||
- **Authoritative @Preview Verification**: When you want to verify the visual correctness of existing `@Preview` functions.
|
||||
- **Complex UI State & Interaction Testing**: When you need to capture visual state before and after interactions (like clicks or state changes).
|
||||
- **Multi-Configuration Visual Auditing**: When checking how a component renders across different data states or configurations (e.g., different view models or mock data).
|
||||
|
||||
## Workflows
|
||||
|
||||
### 1. Identifying the Component
|
||||
|
||||
1. Find the fully qualified name of the `@Composable` or `@Preview` function.
|
||||
2. Search for existing previews in the source code via `grep_search(pattern="@Preview")`.
|
||||
|
||||
### 2. Orchestrating the Session
|
||||
|
||||
1. Start the REPL with the `test` source set (preferred) or `main` with `additionalDependencies`.
|
||||
2. Use `kotlin_repl(command="start")`.
|
||||
3. Use `kotlin_repl(command="run")` to execute the rendering script.
|
||||
|
||||
### 3. Rendering & Verifying
|
||||
|
||||
1. Execute a script that uses `runComposeUiTest` to render and capture the component.
|
||||
2. Inspect the returned image for visual correctness.
|
||||
|
||||
## Examples
|
||||
|
||||
### Viewing a simple Composable
|
||||
|
||||
```kotlin
|
||||
import androidx.compose.ui.test.*
|
||||
import com.example.ui.MyButton
|
||||
|
||||
runComposeUiTest {
|
||||
setContent {
|
||||
MyButton(text = "Click Me")
|
||||
}
|
||||
val node = onRoot()
|
||||
responder.render(node.captureToImage())
|
||||
}
|
||||
// Reasoning: Using kotlin_repl to render a specific component and retrieve its visual representation via the responder API.
|
||||
```
|
||||
|
||||
### Viewing an existing @Preview
|
||||
|
||||
```kotlin
|
||||
import androidx.compose.ui.test.*
|
||||
import com.example.ui.MyButtonPreview // Top-level preview function
|
||||
|
||||
runComposeUiTest {
|
||||
setContent {
|
||||
MyButtonPreview()
|
||||
}
|
||||
val node = onRoot()
|
||||
responder.render(node.captureToImage())
|
||||
}
|
||||
// Reasoning: Reusing an existing authoritative preview function to verify its visual correctness.
|
||||
```
|
||||
|
||||
### Capturing State Transitions
|
||||
|
||||
```kotlin
|
||||
import androidx.compose.ui.test.*
|
||||
import com.example.ui.MyCounter
|
||||
import com.example.viewmodel.MyViewModel
|
||||
|
||||
runComposeUiTest {
|
||||
val viewModel = MyViewModel()
|
||||
setContent {
|
||||
MyCounter(viewModel)
|
||||
}
|
||||
|
||||
// Capture state before interaction
|
||||
responder.render("State before: ${viewModel.count}")
|
||||
responder.render(onRoot().captureToImage())
|
||||
|
||||
// Perform interaction
|
||||
onNodeWithText("Increment").performClick()
|
||||
|
||||
// Capture state after interaction
|
||||
responder.render("State after: ${viewModel.count}")
|
||||
responder.render(onRoot().captureToImage())
|
||||
}
|
||||
// Reasoning: Capturing visual snapshots before and after an interaction to verify state-dependent UI changes.
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- **No Image Returned**: Ensure you are calling `responder.render(bitmap)`.
|
||||
- **ClassNotFoundException**: Check if you have the correct imports and that the required testing dependencies are on the classpath.
|
||||
- **Empty Image**: If the Composable is empty or has zero size, the image will be empty. Verify your Composable's modifiers.
|
||||
|
||||
## Resources
|
||||
|
||||
- [Troubleshooting]({baseDir}/references/troubleshooting.md)
|
||||
@ -0,0 +1,87 @@
|
||||
# Troubleshooting Compose in REPL
|
||||
|
||||
Common issues when rendering Compose components in the REPL and how to resolve them.
|
||||
|
||||
## Kotlin Multiplatform (KMP) Issues
|
||||
|
||||
The Gradle REPL only supports JVM-based source sets.
|
||||
|
||||
- **Issue**: Attempting to start the REPL on a common, iOS, or Android source set fails.
|
||||
- **Solution**: Select a JVM or Desktop target source set. Recommended names: `jvmMain`, `jvmTest`, `desktopMain`, `desktopTest`.
|
||||
- **Issue**: Dependencies from `commonMain` are not resolving.
|
||||
- **Solution**: Starting the REPL on a JVM-specific source set that *depends* on `commonMain` (which is standard KMP structure) will include all inherited dependencies. Ensure the project is built before starting.
|
||||
|
||||
## Android Limitation (FUNDAMENTAL)
|
||||
|
||||
**IMPORTANT: `runComposeUiTest` and `captureToImage()` CANNOT work on Android.**
|
||||
|
||||
This is not a bug or limitation that can be fixed—it is a fundamental architectural incompatibility:
|
||||
|
||||
- `runComposeUiTest` requires desktop Compose runtime with Skiko rendering
|
||||
- Android's ART does not support desktop Compose testing APIs
|
||||
- `captureToImage()` relies on desktop-specific rendering pipelines
|
||||
|
||||
**Solution**: Put your Composables in `commonMain` and run the REPL on a JVM target (`jvmMain`, `jvmTest`, `desktopMain`, or `desktopTest`).
|
||||
|
||||
## `ClassNotFoundException: androidx.compose.ui.test.junit4.DesktopComposeTestRule`
|
||||
|
||||
This occurs when the Compose UI Test dependencies are not on the REPL's classpath.
|
||||
The REPL uses the runtime classpath of the selected `sourceSet`.
|
||||
If you are using `sourceSet: "main"`, but the test dependencies are in `testImplementation`, they won't be included.
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **(Preferred)** Start the REPL with `sourceSet: "test"`. This usually includes the required test dependencies.
|
||||
2. Add the dependency manually using `additionalDependencies` if using `sourceSet: "main"`:
|
||||
```json
|
||||
{
|
||||
"command": "start",
|
||||
"projectPath": ":my-app",
|
||||
"sourceSet": "main",
|
||||
"additionalDependencies": ["org.jetbrains.compose.ui:ui-test-junit4-desktop:1.7.0"]
|
||||
}
|
||||
```
|
||||
|
||||
## `java.lang.NoClassDefFoundError: org/jetbrains/skiko/SkiaLayer`
|
||||
|
||||
Skiko is the rendering engine for Compose Desktop. It might be missing if the project is not correctly configured for Compose Desktop or if dependencies are incomplete.
|
||||
|
||||
**Solution:**
|
||||
Ensure `compose.desktop.currentOs` is in the project's dependencies or add it to `additionalDependencies`.
|
||||
|
||||
## Composable Renders but No Image is Shown
|
||||
|
||||
The `project_repl` tool only returns content that is explicitly rendered via `responder.render(value)` or the result of the last expression in the script.
|
||||
|
||||
**Solution:**
|
||||
Ensure you call `responder.render(bitmap)` inside your `runComposeUiTest` block.
|
||||
|
||||
```kotlin
|
||||
runComposeUiTest {
|
||||
setContent { MyComposable() }
|
||||
responder.render(onRoot().captureToImage()) // <--- Important!
|
||||
}
|
||||
```
|
||||
|
||||
## `Unresolved reference: runComposeUiTest`
|
||||
|
||||
The `runComposeUiTest` function may be located in different packages depending on your version of Compose or whether you are using JetBrains Compose.
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. Check the correct import for your project. Common ones:
|
||||
- `androidx.compose.ui.test.runComposeUiTest`
|
||||
- `org.jetbrains.compose.ui.test.runComposeUiTest` (for older or specific JetBrains Compose versions)
|
||||
2. Ensure you are using a compatible version of the `ui-test` library. Some older versions used `runDesktopComposeUiTest` or similar.
|
||||
|
||||
## `Unresolved reference: responder`
|
||||
|
||||
The `responder` property is automatically injected into the REPL session by the worker.
|
||||
If it is unresolved, check if you have a custom `providedProperties` in your script configuration (usually not an issue for users).
|
||||
Ensure you are using the `project_repl` tool which uses the custom REPL worker.
|
||||
|
||||
## `java.lang.IllegalStateException: runComposeUiTest { ... } needs to be called from the main thread`
|
||||
|
||||
On some platforms, Compose UI tests might require being run on the main/UI thread.
|
||||
The REPL evaluates snippets on a background thread. `runComposeUiTest` usually handles its own thread management, but if you encounter this, try wrapping your code in a `SwingUtilities.invokeLater` (for Desktop) if applicable, though
|
||||
`runComposeUiTest` should be sufficient.
|
||||
12
.env.example
@ -1,12 +0,0 @@
|
||||
# 0 or 1
|
||||
# 0 = disable
|
||||
# 1 = enable
|
||||
ENABLE_UPDATE_CHECK=$ENABLE_UPDATE_CHECK
|
||||
|
||||
LASTFM_API_KEY=$LASTFM_API_KEY
|
||||
LASTFM_API_SECRET=$LASTFM_API_SECRET
|
||||
|
||||
# Release channel. Can be: nightly, stable
|
||||
RELEASE_CHANNEL=$RELEASE_CHANNEL
|
||||
|
||||
HIDE_DONATIONS=$HIDE_DONATIONS
|
||||
@ -1,3 +0,0 @@
|
||||
{
|
||||
"flutterSdkVersion": "3.35.2"
|
||||
}
|
||||
14
.github/agpl_header.txt
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
Copyright (C) 2026 Kingkor Roy Tirtho and Spotube Contributors
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
13
.github/apache_header.txt
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
Copyright (C) 2026 Kingkor Roy Tirtho and Spotube Contributors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
307
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,307 @@
|
||||
name: Build All Platforms
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
COMPOSE_WEBVIEW_REPO: kdroidFilter/ComposeNativeWebview
|
||||
COMPOSE_WEBVIEW_COMMIT: 5aeb268a2c37ff4dbfb76924573344a7c4f763ce
|
||||
GRADLE_PLUGIN_REPO: team-spotube/gradle-plugin
|
||||
|
||||
jobs:
|
||||
prepare-deps:
|
||||
name: Prepare Dependencies
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout ComposeNativeWebview
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ env.COMPOSE_WEBVIEW_REPO }}
|
||||
ref: ${{ env.COMPOSE_WEBVIEW_COMMIT }}
|
||||
path: compose-webview
|
||||
|
||||
- name: Checkout gradle-plugin
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ env.GRADLE_PLUGIN_REPO }}
|
||||
token: ${{ secrets.GH_PAT }}
|
||||
path: gradle-plugin
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
|
||||
- name: Set up Android SDK
|
||||
uses: android-actions/setup-android@v3
|
||||
|
||||
- name: Set up Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Publish compose-webview to mavenLocal
|
||||
working-directory: compose-webview
|
||||
run: |
|
||||
chmod +x gradlew
|
||||
./gradlew publishToMavenLocal
|
||||
|
||||
- name: Publish gradle-plugin to mavenLocal
|
||||
working-directory: gradle-plugin
|
||||
run: |
|
||||
chmod +x gradlew
|
||||
./gradlew publishToMavenLocal
|
||||
|
||||
- name: Upload compose-webview artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: maven-local-composewebview
|
||||
path: ~/.m2/repository/io/github/kdroidfilter/
|
||||
|
||||
- name: Upload gradle-plugin artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: maven-local-gradle-plugin
|
||||
path: ~/.m2/repository/dev/krtirtho/spotube/
|
||||
|
||||
build-android:
|
||||
name: Android
|
||||
needs: prepare-deps
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download compose-webview artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: maven-local-composewebview
|
||||
path: ~/.m2/repository/io/github/kdroidfilter/
|
||||
|
||||
- name: Download gradle-plugin artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: maven-local-gradle-plugin
|
||||
path: ~/.m2/repository/dev/krtirtho/spotube/
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
- name: Assemble Release
|
||||
run: ./gradlew :composeApp:assembleRelease
|
||||
|
||||
- name: Upload APK
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: android-apk
|
||||
path: composeApp/build/outputs/apk/release/*.apk
|
||||
|
||||
- name: Upload AAB
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: android-aab
|
||||
path: composeApp/build/outputs/bundle/release/*.aab
|
||||
|
||||
build-linux:
|
||||
name: Linux Desktop
|
||||
needs: prepare-deps
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download compose-webview artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: maven-local-composewebview
|
||||
path: ~/.m2/repository/io/github/kdroidfilter/
|
||||
|
||||
- name: Download gradle-plugin artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: maven-local-gradle-plugin
|
||||
path: ~/.m2/repository/dev/krtirtho/spotube/
|
||||
|
||||
- name: Install packaging tools
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y rpm fuse
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Package DEB
|
||||
run: ./gradlew :composeApp:packageReleaseDeb
|
||||
|
||||
- name: Package RPM
|
||||
run: ./gradlew :composeApp:packageReleaseRpm
|
||||
|
||||
- name: Package AppImage
|
||||
run: ./gradlew :composeApp:packageReleaseAppImage
|
||||
|
||||
- name: Upload DEB
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-deb
|
||||
path: composeApp/build/compose/binaries/main-release/**/*.deb
|
||||
|
||||
- name: Upload RPM
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-rpm
|
||||
path: composeApp/build/compose/binaries/main-release/**/*.rpm
|
||||
|
||||
- name: Upload AppImage
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-appimage
|
||||
path: composeApp/build/compose/binaries/main-release/**/*.AppImage
|
||||
|
||||
build-windows:
|
||||
name: Windows Desktop
|
||||
needs: prepare-deps
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download compose-webview artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: maven-local-composewebview
|
||||
path: ~/.m2/repository/io/github/kdroidfilter/
|
||||
|
||||
- name: Download gradle-plugin artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: maven-local-gradle-plugin
|
||||
path: ~/.m2/repository/dev/krtirtho/spotube/
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Package MSI
|
||||
run: ./gradlew :composeApp:packageReleaseMsi
|
||||
|
||||
- name: Package EXE
|
||||
run: ./gradlew :composeApp:packageReleaseExe
|
||||
|
||||
- name: Upload MSI
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows-msi
|
||||
path: composeApp/build/compose/binaries/main-release/**/*.msi
|
||||
|
||||
- name: Upload EXE
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows-exe
|
||||
path: composeApp/build/compose/binaries/main-release/**/*.exe
|
||||
|
||||
build-macos:
|
||||
name: macOS Desktop
|
||||
needs: prepare-deps
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download compose-webview artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: maven-local-composewebview
|
||||
path: ~/.m2/repository/io/github/kdroidfilter/
|
||||
|
||||
- name: Download gradle-plugin artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: maven-local-gradle-plugin
|
||||
path: ~/.m2/repository/dev/krtirtho/spotube/
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Package DMG
|
||||
run: ./gradlew :composeApp:packageReleaseDmg
|
||||
|
||||
- name: Upload DMG
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: macos-dmg
|
||||
path: composeApp/build/compose/binaries/main-release/**/*.dmg
|
||||
|
||||
build-ios:
|
||||
name: iOS
|
||||
needs: prepare-deps
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download compose-webview artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: maven-local-composewebview
|
||||
path: ~/.m2/repository/io/github/kdroidfilter/
|
||||
|
||||
- name: Download gradle-plugin artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: maven-local-gradle-plugin
|
||||
path: ~/.m2/repository/dev/krtirtho/spotube/
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Build Kotlin framework
|
||||
run: ./gradlew :composeApp:linkReleaseFrameworkIosArm64
|
||||
|
||||
- name: Build iOS app
|
||||
run: |
|
||||
xcodebuild \
|
||||
-project iosApp/iosApp.xcodeproj \
|
||||
-scheme iosApp \
|
||||
-sdk iphoneos \
|
||||
-configuration Release \
|
||||
-destination 'generic/platform=iOS' \
|
||||
CODE_SIGN_IDENTITY="" \
|
||||
CODE_SIGNING_REQUIRED=NO \
|
||||
CODE_SIGNING_ALLOWED=NO \
|
||||
CONFIGURATION_BUILD_DIR="${{ github.workspace }}/build/ios" \
|
||||
build
|
||||
|
||||
- name: Upload .app
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ios-app
|
||||
path: build/ios/*.app
|
||||
33
.github/workflows/potential-duplicates.yml
vendored
@ -1,33 +0,0 @@
|
||||
name: Detect Potential Duplicates Issues
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
- edited
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/potential-duplicates@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Issue title filter work with anymatch https://www.npmjs.com/package/anymatch.
|
||||
# Any matched issue will stop detection immediately.
|
||||
# You can specify multi filters in each line.
|
||||
filter: ''
|
||||
# Exclude keywords in title before detecting.
|
||||
exclude: ''
|
||||
# Label to set, when potential duplicates are detected.
|
||||
label: potential-duplicate
|
||||
# Get issues with state to compare. Supported state: 'all', 'closed', 'open'.
|
||||
state: all
|
||||
# If similarity is higher than this threshold([0,1]), issue will be marked as duplicate.
|
||||
threshold: 0.6
|
||||
# Reactions to be add to comment when potential duplicates are detected.
|
||||
# Available reactions: "-1", "+1", "confused", "laugh", "heart", "hooray", "rocket", "eyes"
|
||||
reactions: eyes
|
||||
# Comment to post when potential duplicates are detected.
|
||||
comment: >
|
||||
Potential duplicates: {{#issues}}
|
||||
- [#{{ number }}] {{ title }} ({{ accuracy }}%)
|
||||
{{/issues}}
|
||||
37
.github/workflows/pr-lint.yml
vendored
@ -1,37 +0,0 @@
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
FLUTTER_VERSION: 3.35.2
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
|
||||
- name: Dummy Envs
|
||||
run: |
|
||||
envsubst < .env.example > .env
|
||||
env:
|
||||
ENABLE_UPDATE_CHECK: true
|
||||
LASTFM_API_KEY: xxx
|
||||
LASTFM_API_SECRET: xxx
|
||||
RELEASE_CHANNEL: nightly
|
||||
HIDE_DONATIONS: 0
|
||||
|
||||
- name: Configure repo
|
||||
run: |
|
||||
flutter pub get
|
||||
dart run build_runner build --delete-conflicting-outputs
|
||||
|
||||
- name: Lint Dart files
|
||||
run: |
|
||||
dart analyze --no-fatal-warnings
|
||||
137
.github/workflows/spotube-publish-binary.yml
vendored
@ -1,137 +0,0 @@
|
||||
name: Spotube Publish Binary
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: Version to publish (x.x.x)
|
||||
default: 4.0.0
|
||||
required: true
|
||||
dry_run:
|
||||
description: Dry run
|
||||
required: true
|
||||
type: boolean
|
||||
default: true
|
||||
jobs:
|
||||
description: Jobs to run (flathub,aur,winget,chocolatey)
|
||||
required: true
|
||||
type: string
|
||||
default: "flathub,aur,winget,chocolatey"
|
||||
|
||||
jobs:
|
||||
flathub:
|
||||
runs-on: ubuntu-22.04
|
||||
if: contains(inputs.jobs, 'flathub')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: KRTirtho/com.github.KRTirtho.Spotube
|
||||
token: ${{ secrets.FLATHUB_TOKEN }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: spotube
|
||||
|
||||
- name: Update flathub version
|
||||
run: |
|
||||
python3 spotube/scripts/update_flathub_version.py ${{ inputs.version }}
|
||||
rm -rf spotube
|
||||
git config --global user.email "krtirtho@gmail.com"
|
||||
git config --global user.name "Kingkor Roy Tirtho"
|
||||
git add .
|
||||
git commit -m "v${{ inputs.version }} Update"
|
||||
git branch update-${{ inputs.version }}
|
||||
git switch update-${{ inputs.version }}
|
||||
|
||||
- name: Push to flathub
|
||||
if: ${{ !inputs.dry_run }}
|
||||
run: git push -u origin update-${{ inputs.version }}
|
||||
|
||||
aur:
|
||||
runs-on: ubuntu-22.04
|
||||
if: contains(inputs.jobs, 'aur')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: dsaltares/fetch-gh-release-asset@master
|
||||
with:
|
||||
version: tags/v${{ inputs.version }} # mind the "v" prefix
|
||||
file: spotube-linux-${{inputs.version}}-x86_64.tar.xz
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Update PKGBUILD versions
|
||||
run: |
|
||||
sed -i "s/%{{SPOTUBE_VERSION}}%/${{ inputs.version }}/" aur-struct/PKGBUILD
|
||||
sed -i "s/%{{PKGREL}}%/1/" aur-struct/PKGBUILD
|
||||
sed -i "s/%{{LINUX_MD5}}%/`md5sum spotube-linux-${{inputs.version}}-x86_64.tar.xz | awk '{print $1}'`/" aur-struct/PKGBUILD
|
||||
|
||||
- name: Release to AUR
|
||||
if: ${{ !inputs.dry_run }}
|
||||
uses: KSXGitHub/github-actions-deploy-aur@v2.7.2
|
||||
with:
|
||||
pkgname: spotube-bin
|
||||
pkgbuild: aur-struct/PKGBUILD
|
||||
commit_username: ${{ secrets.AUR_USERNAME }}
|
||||
commit_email: ${{ secrets.AUR_EMAIL }}
|
||||
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
||||
commit_message: Updated to v${{ inputs.version }}
|
||||
|
||||
winget:
|
||||
runs-on: ubuntu-latest
|
||||
if: contains(inputs.jobs, 'winget')
|
||||
steps:
|
||||
- name: Release winget package
|
||||
if: ${{ !inputs.dry_run }}
|
||||
uses: vedantmgoyal9/winget-releaser@main
|
||||
with:
|
||||
version: ${{ inputs.version }}
|
||||
release-tag: v${{ inputs.version }}
|
||||
identifier: KRTirtho.Spotube
|
||||
token: ${{ secrets.WINGET_TOKEN }}
|
||||
|
||||
chocolatey:
|
||||
runs-on: windows-latest
|
||||
if: contains(inputs.jobs, 'chocolatey')
|
||||
steps:
|
||||
- uses: dsaltares/fetch-gh-release-asset@master
|
||||
with:
|
||||
version: tags/v${{ inputs.version }} # mind the "v" prefix
|
||||
file: Spotube-windows-x86_64.nupkg
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Chocolatey
|
||||
run: choco apikey -k ${{ secrets.CHOCO_API_KEY }} --source https://push.chocolatey.org/
|
||||
|
||||
- name: Publish to Chocolatey Repository
|
||||
if: ${{ !inputs.dry_run }}
|
||||
run: choco push Spotube-windows-x86_64.nupkg --source https://push.chocolatey.org/
|
||||
|
||||
playstore:
|
||||
runs-on: ubuntu-latest
|
||||
if: contains(inputs.jobs, 'playstore')
|
||||
steps:
|
||||
- name: Tagname (workflow dispatch)
|
||||
run: echo 'TAG_NAME=${{inputs.version}}' >> $GITHUB_ENV
|
||||
|
||||
# - uses: robinraju/release-downloader@main
|
||||
# with:
|
||||
# repository: KRTirtho/spotube
|
||||
# tag: v${{ env.TAG_NAME }}
|
||||
# tarBall: false
|
||||
# zipBall: false
|
||||
# out-file-path: dist
|
||||
# fileName: "Spotube-playstore-all-arch.aab"
|
||||
|
||||
# - name: Create service-account.json
|
||||
# run: |
|
||||
# echo "${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_BASE64 }}" | base64 -d > service-account.json
|
||||
|
||||
# - name: Upload Android Release to Play Store
|
||||
# if: ${{!inputs.dry_run}}
|
||||
# uses: r0adkll/upload-google-play@v1
|
||||
# with:
|
||||
# serviceAccountJson: ./service-account.json
|
||||
# releaseFiles: ./dist/Spotube-playstore-all-arch.aab
|
||||
# packageName: oss.krtirtho.spotube
|
||||
# track: production
|
||||
# status: draft
|
||||
# releaseName: ${{ env.TAG_NAME }}
|
||||
204
.github/workflows/spotube-release-binary.yml
vendored
@ -1,204 +0,0 @@
|
||||
name: Spotube Release Binary
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
channel:
|
||||
type: choice
|
||||
options:
|
||||
- stable
|
||||
- nightly
|
||||
default: nightly
|
||||
description: The release channel
|
||||
debug:
|
||||
type: boolean
|
||||
default: false
|
||||
description: Debug with SSH toggle
|
||||
required: false
|
||||
dry_run:
|
||||
type: boolean
|
||||
default: false
|
||||
description: Dry run without uploading to release
|
||||
|
||||
env:
|
||||
FLUTTER_VERSION: 3.35.2
|
||||
FLUTTER_CHANNEL: master
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build_platform:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-22.04
|
||||
platform: linux
|
||||
arch: x86
|
||||
files: |
|
||||
dist/Spotube-linux-x86_64.deb
|
||||
dist/Spotube-linux-x86_64.rpm
|
||||
dist/Spotube-linux-x86_64.AppImage
|
||||
dist/spotube-linux-*-x86_64.tar.xz
|
||||
- os: ubuntu-22.04-arm
|
||||
platform: linux
|
||||
arch: arm64
|
||||
files: |
|
||||
dist/Spotube-linux-aarch64.deb
|
||||
dist/Spotube-linux-aarch64.AppImage
|
||||
dist/spotube-linux-*-aarch64.tar.xz
|
||||
- os: ubuntu-22.04
|
||||
platform: android
|
||||
arch: all
|
||||
files: |
|
||||
build/Spotube-android-all-arch.apk
|
||||
- os: windows-latest
|
||||
platform: windows
|
||||
arch: x86
|
||||
files: |
|
||||
dist/Spotube-windows-x86_64.nupkg
|
||||
dist/Spotube-windows-x86_64-setup.exe
|
||||
- os: macos-14
|
||||
platform: ios
|
||||
arch: all
|
||||
files: |
|
||||
Spotube-iOS.ipa
|
||||
- os: macos-14
|
||||
platform: macos
|
||||
arch: all
|
||||
files: |
|
||||
build/Spotube-macos-universal.dmg
|
||||
build/Spotube-macos-universal.pkg
|
||||
runs-on: ${{matrix.os}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: subosito/flutter-action@v2.18.0
|
||||
with:
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
channel: ${{ env.FLUTTER_CHANNEL }}
|
||||
cache: true
|
||||
git-source: https://github.com/flutter/flutter.git
|
||||
|
||||
# - name: free disk space
|
||||
# if: ${{ matrix.platform == 'android' }}
|
||||
# run: |
|
||||
# sudo swapoff -a
|
||||
# sudo rm -f /swapfile
|
||||
# sudo apt clean
|
||||
# docker rmi $(docker image ls -aq)
|
||||
# df -h
|
||||
- name: Setup Java
|
||||
if: ${{matrix.platform == 'android'}}
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: "zulu"
|
||||
java-version: "17"
|
||||
cache: "gradle"
|
||||
check-latest: true
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: Install Xcode
|
||||
if: ${{matrix.platform == 'ios'}}
|
||||
uses: maxim-lobanov/setup-xcode@v1
|
||||
with:
|
||||
xcode-version: "16.2"
|
||||
|
||||
- name: Install ${{matrix.platform}} dependencies
|
||||
run: |
|
||||
flutter pub get
|
||||
dart cli/cli.dart install-dependencies --platform=${{matrix.platform}} --arch=${{matrix.arch}}
|
||||
|
||||
- name: Sign Apk
|
||||
if: ${{matrix.platform == 'android'}}
|
||||
run: |
|
||||
echo '${{ secrets.KEYSTORE }}' | base64 --decode > android/app/upload-keystore.jks
|
||||
echo '${{ secrets.KEY_PROPERTIES }}' > android/key.properties
|
||||
|
||||
- name: Build ${{matrix.platform}} binaries
|
||||
run: dart cli/cli.dart build --arch=${{matrix.arch}} ${{matrix.platform}}
|
||||
env:
|
||||
CHANNEL: ${{inputs.channel}}
|
||||
DOTENV: ${{secrets.DOTENV_RELEASE}}
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
if-no-files-found: error
|
||||
name: ${{matrix.platform}}-${{matrix.arch}}
|
||||
path: ${{matrix.files}}
|
||||
|
||||
- name: Debug With SSH When fails
|
||||
if: ${{ failure() && inputs.debug && inputs.channel == 'nightly' }}
|
||||
uses: mxschmitt/action-tmate@v3
|
||||
with:
|
||||
limit-access-to-actor: true
|
||||
|
||||
upload:
|
||||
runs-on: ubuntu-22.04
|
||||
needs:
|
||||
- build_platform
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ./Spotube-Release-Binaries
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install tree -y
|
||||
|
||||
- name: Generate Checksums
|
||||
run: |
|
||||
tree .
|
||||
find Spotube-Release-Binaries -type f -exec md5sum {} \; >> RELEASE.md5sum
|
||||
find Spotube-Release-Binaries -type f -exec sha256sum {} \; >> RELEASE.sha256sum
|
||||
sed -i 's|Spotube-Release-Binaries/.*/\([^/]*\)$|\1|' RELEASE.sha256sum RELEASE.md5sum
|
||||
sed -i 's|Spotube-Release-Binaries/||' RELEASE.sha256sum RELEASE.md5sum
|
||||
|
||||
- name: Extract pubspec version
|
||||
run: |
|
||||
echo "PUBSPEC_VERSION=$(grep -oP 'version:\s*\K[^+]+(?=\+)' pubspec.yaml)" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
if-no-files-found: error
|
||||
name: sums
|
||||
path: |
|
||||
RELEASE.md5sum
|
||||
RELEASE.sha256sum
|
||||
|
||||
- name: Upload Release Binaries (stable)
|
||||
if: ${{ !inputs.dry_run && inputs.channel == 'stable' }}
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
tag: v${{ env.PUBSPEC_VERSION }} # mind the "v" prefix
|
||||
omitBodyDuringUpdate: true
|
||||
omitNameDuringUpdate: true
|
||||
omitPrereleaseDuringUpdate: true
|
||||
allowUpdates: true
|
||||
artifacts: Spotube-Release-Binaries/**/*,RELEASE.sha256sum,RELEASE.md5sum
|
||||
|
||||
- name: Upload Release Binaries (nightly)
|
||||
if: ${{ !inputs.dry_run && inputs.channel == 'nightly' }}
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
tag: nightly
|
||||
omitBodyDuringUpdate: true
|
||||
omitNameDuringUpdate: true
|
||||
omitPrereleaseDuringUpdate: true
|
||||
allowUpdates: true
|
||||
artifacts: Spotube-Release-Binaries/**/*,RELEASE.sha256sum,RELEASE.md5sum
|
||||
body: |
|
||||
Build Number: ${{github.run_number}}
|
||||
|
||||
Nightly release includes newest features but may contain bugs
|
||||
It is preferred to use the stable version unless you know what you're doing
|
||||
|
||||
- name: Debug With SSH When fails
|
||||
if: ${{ failure() && inputs.debug && inputs.channel == 'nightly' }}
|
||||
uses: mxschmitt/action-tmate@v3
|
||||
with:
|
||||
limit-access-to-actor: true
|
||||
28
.gitignore
vendored
@ -1,9 +1,34 @@
|
||||
*.iml
|
||||
.kotlin
|
||||
.gradle
|
||||
**/build/
|
||||
xcuserdata
|
||||
!src/**/build/
|
||||
local.properties
|
||||
.idea
|
||||
.DS_Store
|
||||
captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
*.xcodeproj/*
|
||||
!*.xcodeproj/project.pbxproj
|
||||
!*.xcodeproj/xcshareddata/
|
||||
!*.xcodeproj/project.xcworkspace/
|
||||
!*.xcworkspace/contents.xcworkspacedata
|
||||
**/xcshareddata/WorkspaceSettings.xcsettings
|
||||
node_modules/
|
||||
composeApp/release/
|
||||
|
||||
**/*.log
|
||||
|
||||
/composeApp/vlc-natives/
|
||||
|
||||
|
||||
# Miscellaneous
|
||||
*.class
|
||||
*.log
|
||||
*.pyc
|
||||
*.swp
|
||||
.DS_Store
|
||||
.atom/
|
||||
.buildlog/
|
||||
.history
|
||||
@ -11,7 +36,6 @@
|
||||
|
||||
|
||||
# IntelliJ related
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
0
.gitmodules
vendored
Normal file
30
.metadata
@ -1,30 +0,0 @@
|
||||
# This file tracks properties of this Flutter project.
|
||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||
#
|
||||
# This file should be version controlled and should not be manually edited.
|
||||
|
||||
version:
|
||||
revision: "d7b523b356d15fb81e7d340bbe52b47f93937323"
|
||||
channel: "stable"
|
||||
|
||||
project_type: app
|
||||
|
||||
# Tracks metadata for the flutter migrate command
|
||||
migration:
|
||||
platforms:
|
||||
- platform: root
|
||||
create_revision: d7b523b356d15fb81e7d340bbe52b47f93937323
|
||||
base_revision: d7b523b356d15fb81e7d340bbe52b47f93937323
|
||||
- platform: windows
|
||||
create_revision: d7b523b356d15fb81e7d340bbe52b47f93937323
|
||||
base_revision: d7b523b356d15fb81e7d340bbe52b47f93937323
|
||||
|
||||
# User provided section
|
||||
|
||||
# List of Local paths (relative to this file) that should be
|
||||
# ignored by the migrate tool.
|
||||
#
|
||||
# Files that are not part of the templates will be ignored by default.
|
||||
unmanaged_files:
|
||||
- 'lib/main.dart'
|
||||
- 'ios/Runner.xcodeproj/project.pbxproj'
|
||||
17
.opencode/opencode.jsonc
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"mcp": {
|
||||
"gradle": {
|
||||
"type": "local",
|
||||
"command": [
|
||||
"jbang",
|
||||
"run",
|
||||
"--java",
|
||||
"25",
|
||||
"--quiet",
|
||||
"--fresh",
|
||||
"gradle-mcp@rnett"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
22
.vscode/c_cpp_properties.json
vendored
@ -1,22 +0,0 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Win32",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"defines": [
|
||||
"_DEBUG",
|
||||
"UNICODE",
|
||||
"_UNICODE"
|
||||
],
|
||||
"windowsSdkVersion": "10.0.19041.0",
|
||||
"compilerPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\Hostx64\\x64\\cl.exe",
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "c++17",
|
||||
"intelliSenseMode": "windows-msvc-x64",
|
||||
"configurationProvider": "ms-vscode.makefile-tools"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
58
.vscode/launch.json
vendored
@ -1,58 +0,0 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "spotube",
|
||||
"type": "dart",
|
||||
"request": "launch",
|
||||
"program": "lib/main.dart",
|
||||
},
|
||||
{
|
||||
"name": "spotube (mobile)",
|
||||
"type": "dart",
|
||||
"request": "launch",
|
||||
"program": "lib/main.dart",
|
||||
"args": [
|
||||
"--flavor",
|
||||
"dev"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "spotube (mobile-skia)",
|
||||
"type": "dart",
|
||||
"request": "launch",
|
||||
"program": "lib/main.dart",
|
||||
"args": [
|
||||
"--flavor",
|
||||
"dev",
|
||||
"--no-enable-impeller"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "spotube (profile)",
|
||||
"type": "dart",
|
||||
"request": "launch",
|
||||
"program": "lib/main.dart",
|
||||
"flutterMode": "profile"
|
||||
},
|
||||
{
|
||||
"name": "spotube (release)",
|
||||
"type": "dart",
|
||||
"request": "launch",
|
||||
"program": "lib/main.dart",
|
||||
"flutterMode": "release"
|
||||
},
|
||||
{
|
||||
"name": "spotube (mobile) (release)",
|
||||
"type": "dart",
|
||||
"request": "launch",
|
||||
"program": "lib/main.dart",
|
||||
"flutterMode": "release",
|
||||
"args": [
|
||||
"--flavor",
|
||||
"dev"
|
||||
]
|
||||
}
|
||||
],
|
||||
"compounds": []
|
||||
}
|
||||
35
.vscode/settings.json
vendored
@ -1,35 +0,0 @@
|
||||
{
|
||||
"cmake.configureOnOpen": false,
|
||||
"cSpell.words": [
|
||||
"acousticness",
|
||||
"ambiguate",
|
||||
"Amoled",
|
||||
"Buildless",
|
||||
"configurators",
|
||||
"danceability",
|
||||
"fuzzywuzzy",
|
||||
"gapless",
|
||||
"instrumentalness",
|
||||
"isrc",
|
||||
"Mpris",
|
||||
"RGBO",
|
||||
"riverpod",
|
||||
"Scrobblenaut",
|
||||
"shadcn",
|
||||
"skeletonizer",
|
||||
"songlink",
|
||||
"speechiness",
|
||||
"Spotube",
|
||||
"titlebar",
|
||||
"winget"
|
||||
],
|
||||
"editor.formatOnSave": true,
|
||||
"explorer.fileNesting.enabled": true,
|
||||
"explorer.fileNesting.patterns": {
|
||||
"pubspec.yaml": "pubspec.lock,analysis_options.yaml,.packages,.flutter-plugins,.flutter-plugins-dependencies,flutter_launcher_icons*.yaml,flutter_native_splash*.yaml",
|
||||
"README.md": "LICENSE,CODE_OF_CONDUCT.md,CONTRIBUTING.md,SECURITY.md,CONTRIBUTION.md,CHANGELOG.md,PRIVACY_POLICY.md",
|
||||
"*.dart": "${capture}.g.dart,${capture}.freezed.dart"
|
||||
},
|
||||
"dart.flutterSdkPath": ".fvm/versions/3.35.2",
|
||||
"makefile.configureOnOpen": false
|
||||
}
|
||||
170
.vscode/snippets.code-snippets
vendored
@ -1,170 +0,0 @@
|
||||
{
|
||||
"PaginatedState": {
|
||||
"scope": "dart",
|
||||
"prefix": "paginatedState",
|
||||
"description": "Generate a PaginatedState",
|
||||
"body": [
|
||||
"class ${1:Model}State extends PaginatedState<${2:Model}> {",
|
||||
" ${1:Model}State({",
|
||||
" required super.items,",
|
||||
" required super.offset,",
|
||||
" required super.limit,",
|
||||
" required super.hasMore,",
|
||||
" });",
|
||||
" ",
|
||||
" @override",
|
||||
" ${1:Model}State copyWith({",
|
||||
" List<${2:Model}>? items,",
|
||||
" int? offset,",
|
||||
" int? limit,",
|
||||
" bool? hasMore,",
|
||||
" }) {",
|
||||
" return ${1:Model}State(",
|
||||
" items: items ?? this.items,",
|
||||
" offset: offset ?? this.offset,",
|
||||
" limit: limit ?? this.limit,",
|
||||
" hasMore: hasMore ?? this.hasMore,",
|
||||
" );",
|
||||
" }",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"PaginatedAsyncNotifier": {
|
||||
"scope": "dart",
|
||||
"prefix": "paginatedAsyncNotifier",
|
||||
"description": "Generate a PaginatedAsyncNotifier",
|
||||
"body": [
|
||||
"class ${1:NotifierName}Notifier extends PaginatedAsyncNotifier<${3:Item}, ${2:Model}State> {",
|
||||
" ${1:NotifierName}Notifier() : super();",
|
||||
" ",
|
||||
" @override",
|
||||
" fetch(int offset, int limit) async {",
|
||||
" throw UnimplementedError();",
|
||||
" }",
|
||||
" ",
|
||||
" @override",
|
||||
" build() async {",
|
||||
" throw UnimplementedError();",
|
||||
" }",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"PaginaitedNotifierWithState": {
|
||||
"scope": "dart",
|
||||
"prefix": "paginatedNotifierWithState",
|
||||
"description": "Generate a PaginatedNotifier with PaginatedState",
|
||||
"body": [
|
||||
"class $1State extends PaginatedState<$2> {",
|
||||
" $1State({",
|
||||
" required super.items,",
|
||||
" required super.offset,",
|
||||
" required super.limit,",
|
||||
" required super.hasMore,",
|
||||
" });",
|
||||
" ",
|
||||
" @override",
|
||||
" $1State copyWith({",
|
||||
" List<$2>? items,",
|
||||
" int? offset,",
|
||||
" int? limit,",
|
||||
" bool? hasMore,",
|
||||
" }) {",
|
||||
" return $1State(",
|
||||
" items: items ?? this.items,",
|
||||
" offset: offset ?? this.offset,",
|
||||
" limit: limit ?? this.limit,",
|
||||
" hasMore: hasMore ?? this.hasMore,",
|
||||
" );",
|
||||
" }",
|
||||
"}",
|
||||
" ",
|
||||
"class $1Notifier",
|
||||
" extends PaginatedAsyncNotifier<$2, $1State> {",
|
||||
" $1Notifier() : super();",
|
||||
" ",
|
||||
" @override",
|
||||
" fetch(int offset, int limit) async {",
|
||||
" throw UnimplementedError();",
|
||||
" }",
|
||||
" ",
|
||||
" @override",
|
||||
" build() async {",
|
||||
" throw UnimplementedError();",
|
||||
" }",
|
||||
"}",
|
||||
" ",
|
||||
"final ${1/(.*)/${1:/camelcase}/}Provider = AsyncNotifierProvider<$1Notifier, $1State>(",
|
||||
" ()=> $1Notifier(),",
|
||||
");"
|
||||
]
|
||||
},
|
||||
"FamilyPaginatedAsyncNotifier": {
|
||||
"scope": "dart",
|
||||
"prefix": "familyPaginatedAsyncNotifier",
|
||||
"description": "Generate a FamilyPaginatedAsyncNotifier",
|
||||
"body": [
|
||||
"class ${1:NotifierName}Notifier extends FamilyPaginatedAsyncNotifier<${3:Item}, ${2:Model}State, {$4:Arg}> {",
|
||||
" ${1:NotifierName}Notifier() : super();",
|
||||
" ",
|
||||
" @override",
|
||||
" fetch(arg, offset, limit) async {",
|
||||
" throw UnimplementedError();",
|
||||
" }",
|
||||
" ",
|
||||
" @override",
|
||||
" build(arg) async {",
|
||||
" throw UnimplementedError();",
|
||||
" }",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"FamilyPaginaitedNotifierWithState": {
|
||||
"scope": "dart",
|
||||
"prefix": "familyPaginatedNotifierWithState",
|
||||
"description": "Generate a FamilyPaginatedAsyncNotifier with PaginatedState",
|
||||
"body": [
|
||||
"class $1State extends PaginatedState<$2> {",
|
||||
" $1State({",
|
||||
" required super.items,",
|
||||
" required super.offset,",
|
||||
" required super.limit,",
|
||||
" required super.hasMore,",
|
||||
" });",
|
||||
" ",
|
||||
" @override",
|
||||
" $1State copyWith({",
|
||||
" List<$2>? items,",
|
||||
" int? offset,",
|
||||
" int? limit,",
|
||||
" bool? hasMore,",
|
||||
" }) {",
|
||||
" return $1State(",
|
||||
" items: items ?? this.items,",
|
||||
" offset: offset ?? this.offset,",
|
||||
" limit: limit ?? this.limit,",
|
||||
" hasMore: hasMore ?? this.hasMore,",
|
||||
" );",
|
||||
" }",
|
||||
"}",
|
||||
" ",
|
||||
"class $1Notifier",
|
||||
" extends FamilyPaginatedAsyncNotifier<$2, $1State, $3> {",
|
||||
" $1Notifier() : super();",
|
||||
" ",
|
||||
" @override",
|
||||
" fetch(arg, offset, limit) async {",
|
||||
" throw UnimplementedError();",
|
||||
" }",
|
||||
" ",
|
||||
" @override",
|
||||
" build(arg) async {",
|
||||
" throw UnimplementedError();",
|
||||
" }",
|
||||
"}",
|
||||
" ",
|
||||
"final ${1/(.*)/${1:/camelcase}/}Provider = AsyncNotifierProviderFamily<$1Notifier, $1State, $3>(",
|
||||
" ()=> $1Notifier(),",
|
||||
");"
|
||||
]
|
||||
},
|
||||
}
|
||||
4
.vscode/tasks.json
vendored
@ -1,4 +0,0 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": []
|
||||
}
|
||||
43
AGENTS.md
Normal file
@ -0,0 +1,43 @@
|
||||
# AGENTS
|
||||
|
||||
## Repo shape (KMP + modules)
|
||||
- Gradle multi-module: `:composeApp` (main app), `:plugin_interfaces` (plugin API contracts), `:js_plugin_example` (Zipline JS plugin template).
|
||||
- `:composeApp` uses custom KMP source sets (`mobileMain`, `androidJvmMain`) with explicit `dependsOn`; Gradle prints "Default Kotlin Hierarchy Template Not Applied Correctly" warning. Treat as known/expected.
|
||||
|
||||
## Real app entrypoints
|
||||
- Desktop/JVM: `composeApp/src/jvmMain/kotlin/dev/krtirtho/spotube/main.kt` (`mainClass = dev.krtirtho.spotube.MainKt`).
|
||||
- Android: `composeApp/src/androidMain/kotlin/dev/krtirtho/spotube/MainActivity.kt`.
|
||||
- iOS bridge: `composeApp/src/iosMain/kotlin/dev/krtirtho/spotube/MainViewController.kt` and `iosApp/iosApp/ContentView.swift`.
|
||||
|
||||
## High-value commands
|
||||
- Use Gradle wrapper (`./gradlew` or `./gradlew.bat`) only.
|
||||
- Run desktop: `:composeApp:run`
|
||||
- Build Android debug: `:composeApp:assembleDebug`
|
||||
- Module checks: `:composeApp:check`, `:plugin_interfaces:check`, `:js_plugin_example:check`
|
||||
- Focused tests: `:composeApp:jvmTest`, `:composeApp:iosSimulatorArm64Test`, `:plugin_interfaces:jvmTest`, `:plugin_interfaces:jsTest`, `:js_plugin_example:jsTest`
|
||||
- No lint/typecheck/formatter tasks are configured; `:composeApp:check` is the only aggregated check.
|
||||
|
||||
## Dependencies
|
||||
- `gradle/libs.versions.toml` is the single source of truth for all version pins and library declarations.
|
||||
- Kotlin: `2.3.0`, JVM target: `11` (compile/target compatibility in both `composeApp/build.gradle.kts` and `plugin_interfaces/build.gradle.kts`).
|
||||
|
||||
## Codegen and plugin packaging
|
||||
- JS plugin bundles: `:js_plugin_example:packageDevelopmentPlugin` and `:js_plugin_example:packageProductionPlugin`. Output is `.smplug` files in `js_plugin_example/build/distributions/`.
|
||||
- Zipline plugin entrypoint: `mainFunction = "dev.krtirtho.js_plugin_example.main"` in `js_plugin_example/build.gradle.kts`. Plugin metadata from `js_plugin_example/plugin.json`.
|
||||
|
||||
## Plugin architecture
|
||||
- `plugin_interfaces` exports `zipline.core` and `semver` as API. `composeApp` depends on it for the plugin system.
|
||||
- `plugin_interfaces` also has a JS target (`browser()`), used by the plugin system.
|
||||
|
||||
## Desktop JVM specifics
|
||||
- JavaFX is required; `--add-opens` flags in `compose.desktop.application.jvmArgs` must be preserved: `javafx.graphics/javafx.scene`, `javafx.graphics/com.sun.javafx.sg.prism`, `javafx.graphics/com.sun.javafx.scene`, `javafx.web/com.sun.webkit`, `javafx.media/com.sun.media.jfxmedia`, `javafx.media/com.sun.media.jfxmedia.events`.
|
||||
- JavaFX dependencies are loaded from OpenJFX with platform classifiers (win/mac/linux) resolved at configuration time via `System.getProperty("os.name")`.
|
||||
|
||||
## Tooling
|
||||
- Gradle config cache enabled (`gradle.properties`); prefer module-scoped tasks.
|
||||
- Gradle daemon JVM pinned to JetBrains JDK 21 via `gradle/gradle-daemon-jvm.properties`.
|
||||
- Gradle 8.14.3 (from `gradle/wrapper/gradle-wrapper.properties`).
|
||||
- Foojay toolchain resolver in use (`plugins { id("org.gradle.toolchains.foojay-resolver-convention") }`).
|
||||
|
||||
## Current testing reality
|
||||
- No committed `*Test*.kt` files; test tasks may run zero tests unless new tests are added.
|
||||
667
LICENSE
@ -1,12 +1,661 @@
|
||||
BSD-4-Clause License
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (c) 2025 Kingkor Roy Tirtho. All rights reserved.
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
Preamble
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
3. All advertising materials mentioning features or use of this software must display the following acknowledgement:
|
||||
This product includes software developed by Kingkor Roy Tirtho.
|
||||
4. Neither the name of the Software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY KINGKOR ROY TIRTHO AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KINGKOR ROY TIRTHO AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
58
Makefile
@ -1,58 +0,0 @@
|
||||
INNO_VERSION=6.2.0
|
||||
TEMP_DIR=/tmp/spotube-tar
|
||||
USR_SHARE=deb-struct/usr/share
|
||||
BUNDLE_DIR=build/linux/${ARCH}/release/bundle
|
||||
MIRRORLIST=${PWD}/build/mirrorlist
|
||||
|
||||
tar:
|
||||
mkdir -p $(TEMP_DIR)\
|
||||
&& cp -r $(BUNDLE_DIR)/* $(TEMP_DIR)\
|
||||
&& cp linux/spotube.desktop $(TEMP_DIR)\
|
||||
&& cp assets/branding/spotube-logo.png $(TEMP_DIR)\
|
||||
&& cp linux/com.github.KRTirtho.Spotube.appdata.xml $(TEMP_DIR)\
|
||||
&& tar -cJf build/spotube-linux-${VERSION}-${PKG_ARCH}.tar.xz -C $(TEMP_DIR) .\
|
||||
&& rm -rf $(TEMP_DIR)
|
||||
|
||||
aursrcinfo:
|
||||
docker run -e EXPORT_SRC=1 -v ${PWD}/aur-struct:/pkg -v ${MIRRORLIST}:/etc/pacman.d/mirrorlist:ro whynothugo/makepkg
|
||||
|
||||
publishaur:
|
||||
echo '[Warning!]: you need SSH paired with AUR'\
|
||||
&& rm -rf build/spotube\
|
||||
&& git clone ssh://aur@aur.archlinux.org/spotube-bin.git build/spotube\
|
||||
&& cp aur-struct/PKGBUILD aur-struct/.SRCINFO build/spotube\
|
||||
&& cd build/spotube\
|
||||
&& git add .\
|
||||
&& git commit -m "${MSG}"\
|
||||
&& git push
|
||||
|
||||
innoinstall:
|
||||
powershell curl -o build\installer.exe http://files.jrsoftware.org/is/6/innosetup-${INNO_VERSION}.exe
|
||||
powershell git clone https://github.com/DomGries/InnoDependencyInstaller.git build\inno-depend
|
||||
powershell build\installer.exe /verysilent /allusers /dir=build\iscc
|
||||
|
||||
inno:
|
||||
powershell .\build\iscc\iscc.exe scripts\windows-setup-creator.iss
|
||||
|
||||
choco:
|
||||
powershell cp dist\Spotube-windows-x86_64-setup.exe choco-struct\tools
|
||||
powershell choco pack .\choco-struct\spotube.nuspec --outputdirectory dist
|
||||
|
||||
apk:
|
||||
mv build/app/outputs/apk/release/app-release.apk build/Spotube-android-all-arch.apk
|
||||
|
||||
gensums:
|
||||
sh -c scripts/gensums.sh
|
||||
|
||||
migrate:
|
||||
dart run drift_dev make-migrations
|
||||
|
||||
dmg:
|
||||
flutter build macos &&\
|
||||
if [ -f dist/Spotube-macos-universal.dmg ];\
|
||||
then rm dist/Spotube-macos-universal.dmg;\
|
||||
fi &&\
|
||||
appdmg appdmg.json dist/Spotube-macos-universal.dmg
|
||||
|
||||
changelog:
|
||||
git-cliff --unreleased
|
||||
364
README.md
@ -1,334 +1,48 @@
|
||||
<div align="center">
|
||||
<img width="600" src="assets/branding/spotube_banner.png" alt="Spotube Logo">
|
||||
This is a Kotlin Multiplatform project targeting Android, iOS, Desktop (JVM).
|
||||
|
||||
A cross-platform extensible open-source music streaming platform.<br>
|
||||
Bring your own music metadata/playlist/audio-source with plugins created by community or by yourself. A small step towards the decentralized music streaming era!
|
||||
* [/composeApp](./composeApp/src) is for code that will be shared across your Compose Multiplatform applications.
|
||||
It contains several subfolders:
|
||||
- [commonMain](./composeApp/src/commonMain/kotlin) is for code that’s common for all targets.
|
||||
- Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name.
|
||||
For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app,
|
||||
the [iosMain](./composeApp/src/iosMain/kotlin) folder would be the right place for such calls.
|
||||
Similarly, if you want to edit the Desktop (JVM) specific part, the [jvmMain](./composeApp/src/jvmMain/kotlin)
|
||||
folder is the appropriate location.
|
||||
|
||||
Btw it's not just another Electron app 😉
|
||||
* [/iosApp](./iosApp/iosApp) contains iOS applications. Even if you’re sharing your UI with Compose Multiplatform,
|
||||
you need this entry point for your iOS app. This is also where you should add SwiftUI code for your project.
|
||||
|
||||
<a href="https://spotube.krtirtho.dev"><img alt="Visit the website" height="56" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/documentation/website_vector.svg"></a>
|
||||
<a href="https://discord.gg/uJ94vxB6vg"><img alt="Discord Server" height="56" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/social/discord-plural_vector.svg"></a>
|
||||
### Build and Run Android Application
|
||||
|
||||
<a href="https://patreon.com/krtirtho"><img alt="Support me on Patron" height="56" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/donate/patreon-singular_vector.svg"></a>
|
||||
<a href="https://www.buymeacoffee.com/krtirtho"><img alt="Buy me a Coffee" height="56" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/donate/buymeacoffee-singular_vector.svg"></a>
|
||||
To build and run the development version of the Android app, use the run configuration from the run widget
|
||||
in your IDE’s toolbar or build it directly from the terminal:
|
||||
- on macOS/Linux
|
||||
```shell
|
||||
./gradlew :composeApp:assembleDebug
|
||||
```
|
||||
- on Windows
|
||||
```shell
|
||||
.\gradlew.bat :composeApp:assembleDebug
|
||||
```
|
||||
|
||||
[](https://news.ycombinator.com/item?id=39066136)
|
||||
### Build and Run Desktop (JVM) Application
|
||||
|
||||
<a href="https://opencollective.com/spotube"><img src="https://opencollective.com/spotube/donate/button.png?color=blue" alt="Donate to our Open Collective" height="45"></a>
|
||||
To build and run the development version of the desktop app, use the run configuration from the run widget
|
||||
in your IDE’s toolbar or run it directly from the terminal:
|
||||
- on macOS/Linux
|
||||
```shell
|
||||
./gradlew :composeApp:run
|
||||
```
|
||||
- on Windows
|
||||
```shell
|
||||
.\gradlew.bat :composeApp:run
|
||||
```
|
||||
|
||||
### Build and Run iOS Application
|
||||
|
||||
To build and run the development version of the iOS app, use the run configuration from the run widget
|
||||
in your IDE’s toolbar or open the [/iosApp](./iosApp) directory in Xcode and run it from there.
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
</div>
|
||||
|
||||
## 🌃 Features
|
||||
|
||||
- 🧩 Plugin powered, supports any platform or custom music service through plugins.
|
||||
- 🗺️ Community driven plugins for popular platforms or create your own.
|
||||
- ⬇️ Freely downloadable tracks with tagged metadata.
|
||||
- 🖥️ 📱 Cross-platform support.
|
||||
- 🪶 Small size & less data usage.
|
||||
- 🕒 Time synced lyrics regardless of the plugin support.
|
||||
- ✋ No telemetry, diagnostics or user data collection.
|
||||
- 🚀 Native performance.
|
||||
- 📖 Open source/libre software.
|
||||
- 🔉 Playback control is done locally, not on the server.
|
||||
|
||||
## 📜 ⬇️ Installation guide
|
||||
|
||||
New versions usually release every 3-4 months.<br />
|
||||
This handy table lists all the methods you can use to install Spotube:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Platform</th>
|
||||
<th>Package/Installation Method</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Windows</td>
|
||||
<td>
|
||||
<a href="https://github.com/KRTirtho/spotube/releases/latest/download/Spotube-windows-x86_64-setup.exe">
|
||||
<img width="220" alt="Windows Download" src="https://get.todoist.help/hc/article_attachments/4403191721234/WindowsButton.svg">
|
||||
</a>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MacOS</td>
|
||||
<td>
|
||||
<a href="https://github.com/KRTirtho/spotube/releases/latest/download/Spotube-macos-universal.dmg">
|
||||
<img width="220" alt="MacOS Download" src="https://memory-map.com/wp-content/uploads/download-mac-OS-01.svg">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Android</td>
|
||||
<td>
|
||||
<a href="https://github.com/KRTirtho/spotube/releases/latest/download/Spotube-android-all-arch.apk">
|
||||
<img width="220" alt="APK download" src="https://user-images.githubusercontent.com/114044633/223920025-83687de0-e463-4c5d-8122-e06e4bb7d40c.png">
|
||||
</a>
|
||||
<br/>
|
||||
<a href="https://f-droid.org/packages/oss.krtirtho.spotube">
|
||||
<img width="220" alt="Download from F-Droid" src="https://user-images.githubusercontent.com/61944859/174589876-bace24c0-b3fd-4c4a-bdb4-6fa82b5853ec.png">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr>
|
||||
<td>iOS</td>
|
||||
<td>
|
||||
<a href="https://github.com/KRTirtho/spotube/releases/latest/download/Spotube-iOS.ipa">
|
||||
<img width="220" alt="Download iOS IPA" src="https://github.com/user-attachments/assets/3e50d93d-fb39-435c-be6b-337745f7c423">
|
||||
</a>
|
||||
<br/>
|
||||
<blockquote style="color:red">
|
||||
*iPA file only. Requires sideloading with <a href="https://altstore.io/">AltStore</a> or similar tools.
|
||||
</blockquote>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Flatpak</td>
|
||||
<td>
|
||||
<p><code>flatpak install com.github.KRTirtho.Spotube</code></p>
|
||||
<a href="https://flathub.org/apps/details/com.github.KRTirtho.Spotube">
|
||||
<img width="220" alt="Download on Flathub" src="https://flathub.org/assets/badges/flathub-badge-en.png">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AppImage</td>
|
||||
<td>AppImage's lacking stability led to it's temporary removal. More information at https://github.com/KRTirtho/spotube/issues/1082</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Debian/Ubuntu</td>
|
||||
<td>
|
||||
<a href="https://github.com/KRTirtho/spotube/releases/latest/download/Spotube-linux-x86_64.deb">
|
||||
<img width="220" alt="Debian/Ubuntu Download" src="https://user-images.githubusercontent.com/61944859/169097994-e92aff78-fd75-4c93-b6e4-f072a4b5a7ed.png">
|
||||
</a>
|
||||
<p>Then run: <code>sudo apt install ./Spotube-linux-x86_64.deb</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Arch/Manjaro</td>
|
||||
<td>
|
||||
<p>With pamac: <code>sudo pamac install spotube-bin</code></p>
|
||||
<p>With yay: <code>yay -Sy spotube-bin</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fedora/OpenSuse</td>
|
||||
<td>
|
||||
<a href="https://github.com/KRTirtho/spotube/releases/latest/download/Spotube-linux-x86_64.rpm">
|
||||
<img width="220" alt="Fedora/OpenSuse Download" src="https://user-images.githubusercontent.com/61944859/223638350-5926b9da-04d6-4edd-931d-ad533e4ff058.png">
|
||||
</a>
|
||||
<p>For Fedora: <code>sudo dnf install ./Spotube-linux-x86_64.rpm</code></p>
|
||||
<p>For OpenSuse: <code>sudo zypper in ./Spotube-linux-x86_64.rpm</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Linux (tarball)</td>
|
||||
<td>
|
||||
<a href="https://github.com/KRTirtho/spotube/releases/latest">
|
||||
<img width="220" alt="Tarball Download" src="https://user-images.githubusercontent.com/61944859/169456985-e0ba1fd4-10e8-4cc0-ab94-337acc6e0295.png">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Macos - <a href="https://brew.sh">Homebrew</a></td>
|
||||
<td>
|
||||
<pre lang="bash">
|
||||
brew tap krtirtho/apps
|
||||
brew install --cask spotube
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Windows - <a href="https://chocolatey.org">Chocolatey</a></td>
|
||||
<td>
|
||||
<p><code>choco install spotube</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Windows - <a href="https://scoop.sh">Scoop</a></td>
|
||||
<td>
|
||||
<p><code>scoop bucket add extras</code></p>
|
||||
<p><code>scoop install spotube</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Windows - <a href="https://github.com/microsoft/winget-cli">WinGet</a></td>
|
||||
<td>
|
||||
<p><code>winget install --id KRTirtho.Spotube</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### 🔄 Nightly Builds
|
||||
|
||||
Grab the latest nightly builds of Spotube [from the GitHub Releases](https://github.com/KRTirtho/spotube/releases/tag/nightly).
|
||||
|
||||
## 🕳️ Building from source
|
||||
|
||||
<a href="https://github.com/KRTirtho/spotube/actions"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/KRTirtho/spotube/spotube-release-binary.yml?+label=Build%20Status"></a>
|
||||
|
||||
You can compile Spotube's source code by [following these instructions](CONTRIBUTION.md#your-first-code-contribution).
|
||||
|
||||
## 👥 The Spotube team
|
||||
|
||||
- [Kingkor Roy Tirtho](https://github.com/KRTirtho) - The Founder, Maintainer and Lead Developer
|
||||
- [Owen Connor](https://github.com/owencz1998) - The Cool Discord Moderator
|
||||
- [Piotr Rogowski](https://github.com/karniv00l) - The MacOS Developer
|
||||
- [Rusty Apple](https://github.com/RustyApple) - The Mysterious Unknown Guy
|
||||
|
||||
## 💼 License
|
||||
|
||||
Spotube is open source and licensed under the [BSD-4-Clause](/LICENSE) License.
|
||||
|
||||
If you are curious, you can [read the reason of choosing this license](https://dev.to/krtirtho/choosing-open-source-license-wisely-1m3p).
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
<h2><code>[Click to show]</code> 🙏 Services/Package/Plugin Credits</h2>
|
||||
</summary>
|
||||
|
||||
### Services
|
||||
|
||||
1. [Flutter](https://flutter.dev) - Flutter transforms the app development process. Build, test, and deploy beautiful mobile, web, desktop, and embedded apps from a single codebase
|
||||
1. [MPV](https://mpv.io) - mpv is a free (as in freedom) media player for the command line. It supports a wide variety of media file formats, audio and video codecs, and subtitle types.
|
||||
1. [Musicbrainz](https://musicbrainz.org) - MusicBrainz is a MetaBrainz project that aims to create a collaborative music database that is similar to the freedb project.
|
||||
1. [Listenbrainz](https://listenbrainz.org) - ListenBrainz is a open-source project by the MetaBrainz Foundation that allows users to crowdsource and publicly store their digital music listening data.
|
||||
1. [Piped](https://piped-docs.kavin.rocks/) - Piped is a privacy friendly alternative YouTube frontend, which is efficient and scalable by design.
|
||||
1. [Invidious](https://invidious.io/) - Invidious is an open source alternative front-end to YouTube.
|
||||
1. [yt-dlp](https://github.com/yt-dlp/yt-dlp) - A feature-rich command-line audio/video downloader.
|
||||
1. [NewPipeExtractor](https://github.com/TeamNewPipe/NewPipeExtractor) - NewPipe's core library for extracting data from streaming sites.
|
||||
1. [YouTubeExplodeDart](https://github.com/Hexer10/youtube_explode_dart) - A port in dart of the youtube explode library. Supports several API functions without the need of Youtube API Key.
|
||||
1. [LRCLib](https://lrclib.net/) - A public synced lyric API.
|
||||
1. [Linux](https://www.linux.org) - Linux is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged in a Linux distribution
|
||||
1. [AUR](https://aur.archlinux.org) - AUR stands for Arch User Repository. It is a community-driven repository for Arch-based Linux distributions users
|
||||
1. [Flatpak](https://flatpak.org) - Flatpak is a utility for software deployment and package management for Linux
|
||||
1. [SponsorBlock](https://sponsor.ajay.app) - SponsorBlock is an open-source crowdsourced browser extension and open API for skipping sponsor segments in YouTube videos.
|
||||
1. [Inno Setup](https://jrsoftware.org/isinfo.php) - Inno Setup is a free installer for Windows programs by Jordan Russell and Martijn Laan
|
||||
1. [F-Droid](https://f-droid.org) - F-Droid is an installable catalogue of FOSS (Free and Open Source Software) applications for the Android platform. The client makes it easy to browse, install, and keep track of updates on your device
|
||||
1. [LastFM](https://last.fm) - Last.fm is a music streaming and discovery platform that helps users discover and share new music. It tracks users' music listening habits across many devices and platforms.
|
||||
|
||||
### Dependencies
|
||||
|
||||
1. [app_links](https://github.com/llfbandit/app_links) - Android App Links, Deep Links, iOs Universal Links and Custom URL schemes handler for Flutter (desktop included).
|
||||
1. [args](https://pub.dev/packages/args) - Library for defining parsers for parsing raw command-line arguments into a set of options and values using GNU and POSIX style options.
|
||||
1. [audio_service](https://pub.dev/packages/audio_service) - Flutter plugin to play audio in the background while the screen is off.
|
||||
1. [audio_service_mpris](https://github.com/bdrazhzhov/audio-service-mpris) - audio_service platform interface supporting Media Player Remote Interfacing Specification.
|
||||
1. [audio_session](https://github.com/ryanheise/audio_session) - Sets the iOS audio session category and Android audio attributes for your app, and manages your app's audio focus, mixing and ducking behaviour.
|
||||
1. [auto_route](https://github.com/Milad-Akarie/auto_route_library) - AutoRoute is a declarative routing solution, where everything needed for navigation is automatically generated for you.
|
||||
1. [auto_size_text](https://github.com/leisim/auto_size_text) - Flutter widget that automatically resizes text to fit perfectly within its bounds.
|
||||
1. [bonsoir](https://bonsoir.skyost.eu) - A Zeroconf library that allows you to discover network services and to broadcast your own. Based on Apple Bonjour and Android NSD.
|
||||
1. [cached_network_image](https://github.com/Baseflow/flutter_cached_network_image) - Flutter library to load and cache network images. Can also be used with placeholder and error widgets.
|
||||
1. [connectivity_plus](https://github.com/fluttercommunity/plus_plugins) - Flutter plugin for discovering the state of the network (WiFi & mobile/cellular) connectivity on Android and iOS.
|
||||
1. [device_info_plus](https://github.com/fluttercommunity/plus_plugins) - Flutter plugin providing detailed information about the device (make, model, etc.), and Android or iOS version the app is running on.
|
||||
1. [dio](https://github.com/cfug/dio) - A powerful HTTP networking package,supports Interceptors,Aborting and canceling a request,Custom adapters, Transformers, etc.
|
||||
1. [drift](https://drift.simonbinder.eu/) - Drift is a reactive library to store relational data in Dart and Flutter applications.
|
||||
1. [duration](https://github.com/desktop-dart/duration) - Utilities to make working with 'Duration's easier. Formats duration in human readable form and also parses duration in human readable form to Dart's Duration.
|
||||
1. [encrypt](https://pub.dev/packages/encrypt) - A set of high-level APIs over PointyCastle for two-way cryptography.
|
||||
1. [envied](https://github.com/petercinibulk/envied) - Explicitly reads environment variables into a dart file from a .env file for more security and faster start up times.
|
||||
1. [file_picker](https://github.com/miguelpruivo/plugins_flutter_file_picker) - A package that allows you to use a native file explorer to pick single or multiple absolute file paths, with extension filtering support.
|
||||
1. [file_selector](https://pub.dev/packages/file_selector) - Flutter plugin for opening and saving files, or selecting directories, using native file selection UI.
|
||||
1. [fluentui_system_icons](https://github.com/microsoft/fluentui-system-icons/tree/main) - Fluent UI System Icons are a collection of familiar, friendly and modern icons from Microsoft.
|
||||
1. [flutter_cache_manager](https://github.com/Baseflow/flutter_cache_manager/tree/develop/flutter_cache_manager) - Generic cache manager for flutter. Saves web files on the storages of the device and saves the cache info using sqflite.
|
||||
1. [flutter_discord_rpc](https://pub.dev/packages/flutter_discord_rpc) - Discord RPC support for Flutter desktop platforms
|
||||
1. [flutter_displaymode](https://github.com/ajinasokan/flutter_displaymode) - A Flutter plugin to set display mode (resolution, refresh rate) on Android platform. Allows to enable high refresh rate on supported devices.
|
||||
1. [flutter_feather_icons](https://github.com/muj-programmer/flutter_feather_icons) - Feather is a collection of simply beautiful open source icons. Each icon is designed on a 24x24 grid with an emphasis on simplicity, consistency and usability.
|
||||
1. [flutter_form_builder](https://github.com/flutter-form-builder-ecosystem) - This package helps in creation of forms in Flutter by removing the boilerplate code, reusing validation, react to changes, and collect final user input.
|
||||
1. [flutter_hooks](https://github.com/rrousselGit/flutter_hooks) - A flutter implementation of React hooks. It adds a new kind of widget with enhanced code reuse.
|
||||
1. [flutter_inappwebview](https://inappwebview.dev/) - A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window.
|
||||
1. [flutter_native_splash](https://pub.dev/packages/flutter_native_splash) - Customize Flutter's default white native splash screen with background color and splash image. Supports dark mode, full screen, and more.
|
||||
1. [flutter_riverpod](https://riverpod.dev) - A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
|
||||
1. [flutter_sharing_intent](https://github.com/bhagat-techind/flutter_sharing_intent.git) - A flutter plugin that allow flutter apps to receive photos, videos, text, urls or any other file types from another app.
|
||||
1. [flutter_undraw](https://github.com/KRTirtho/flutter_undraw) - Undraw.co Illustrations for Flutter with customization options
|
||||
1. [form_builder_validators](https://github.com/flutter-form-builder-ecosystem) - Form Builder Validators set of validators for FlutterFormBuilder. Provides common validators and a way to make your own.
|
||||
1. [freezed_annotation](https://pub.dev/packages/freezed_annotation) - Annotations for the freezed code-generator. This package does nothing without freezed too.
|
||||
1. [fuzzywuzzy](https://github.com/sphericalkat/dart-fuzzywuzzy) - An implementation of the popular fuzzywuzzy package in Dart, to suit all your fuzzy string matching/searching needs!
|
||||
1. [home_widget](https://pub.dev/packages/home_widget) - A plugin to provide a common interface for creating HomeScreen Widgets for Android and iOS.
|
||||
1. [hooks_riverpod](https://riverpod.dev) - A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
|
||||
1. [html](https://pub.dev/packages/html) - APIs for parsing and manipulating HTML content outside the browser.
|
||||
1. [html_unescape](https://github.com/filiph/html_unescape) - A small library for un-escaping HTML. Supports all Named Character References, Decimal Character References and Hexadecimal Character References.
|
||||
1. [http](https://pub.dev/packages/http) - A composable, multi-platform, Future-based API for HTTP requests.
|
||||
1. [image_picker](https://pub.dev/packages/image_picker) - Flutter plugin for selecting images from the Android and iOS image library, and taking new pictures with the camera.
|
||||
1. [intl](https://pub.dev/packages/intl) - Contains code to deal with internationalized/localized messages, date and number formatting and parsing, bi-directional text, and other internationalization issues.
|
||||
1. [local_notifier](https://github.com/leanflutter/local_notifier) - This plugin allows Flutter desktop apps to displaying local notifications.
|
||||
1. [logger](https://pub.dev/packages/logger) - Small, easy to use and extensible logger which prints beautiful logs.
|
||||
1. [logging](https://pub.dev/packages/logging) - Provides APIs for debugging and error logging, similar to loggers in other languages, such as the Closure JS Logger and java.util.logging.Logger.
|
||||
1. [lrc](https://pub.dev/packages/lrc) - A Dart-only package that creates, parses, and handles LRC, which is a format that stores song lyrics.
|
||||
1. [metadata_god](https://pub.dev/packages/metadata_god) - Plugin for retrieving and writing audio tags/metadata from audio files
|
||||
1. [mime](https://pub.dev/packages/mime) - Utilities for handling media (MIME) types, including determining a type from a file extension and file contents.
|
||||
1. [open_file](https://pub.dev/packages/open_file) - A plug-in that can call native APP to open files with string result in flutter, support iOS(UTI) / android(intent) / PC(ffi) / web(dart:html)
|
||||
1. [package_info_plus](https://github.com/fluttercommunity/plus_plugins) - Flutter plugin for querying information about the application package, such as CFBundleVersion on iOS or versionCode on Android.
|
||||
1. [palette_generator](https://pub.dev/packages/palette_generator) - Flutter package for generating palette colors from a source image.
|
||||
1. [path](https://pub.dev/packages/path) - A string-based path manipulation library. All of the path operations you know and love, with solid support for Windows, POSIX (Linux and Mac OS X), and the web.
|
||||
1. [path_provider](https://pub.dev/packages/path_provider) - Flutter plugin for getting commonly used locations on host platform file systems, such as the temp and app data directories.
|
||||
1. [permission_handler](https://pub.dev/packages/permission_handler) - Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.
|
||||
1. [riverpod](https://riverpod.dev) - A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
|
||||
1. [scroll_to_index](https://github.com/quire-io/scroll-to-index) - Scroll to a specific child of any scrollable widget in Flutter
|
||||
1. [shadcn_flutter](https://github.com/sunarya-thito/shadcn_flutter) - Beautifully designed components from Shadcn/UI is now available for Flutter
|
||||
1. [shared_preferences](https://pub.dev/packages/shared_preferences) - Flutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.
|
||||
1. [shelf](https://pub.dev/packages/shelf) - A model for web server middleware that encourages composition and easy reuse.
|
||||
1. [shelf_router](https://pub.dev/packages/shelf_router) - A convenient request router for the shelf web-framework, with support for URL-parameters, nested routers and routers generated from source annotations.
|
||||
1. [shelf_web_socket](https://pub.dev/packages/shelf_web_socket) - A shelf handler that wires up a listener for every connection.
|
||||
1. [simple_icons](https://teavelopment.com/) - The Simple Icon pack available as Flutter Icons. Provides over 1500 Free SVG icons for popular brands.
|
||||
1. [skeletonizer](https://github.com/Milad-Akarie/skeletonizer) - Converts already built widgets into skeleton loaders with no extra effort.
|
||||
1. [sliding_up_panel](https://github.com/akshathjain/sliding_up_panel) - A draggable Flutter widget that makes implementing a SlidingUpPanel much easier!
|
||||
1. [sliver_tools](https://github.com/Kavantix) - A set of useful sliver tools that are missing from the flutter framework
|
||||
1. [smtc_windows](https://pub.dev/packages/smtc_windows) - Windows `SystemMediaTransportControls` implementation for Flutter giving access to Windows OS Media Control applet.
|
||||
1. [sqlite3](https://github.com/simolus3/sqlite3.dart/tree/main/sqlite3) - Provides lightweight yet convenient bindings to SQLite by using dart:ffi
|
||||
1. [sqlite3_flutter_libs](https://github.com/simolus3/sqlite3.dart/tree/main/sqlite3_flutter_libs) - Flutter plugin to include native sqlite3 libraries with your app
|
||||
1. [timezone](https://pub.dev/packages/timezone) - Time zone database and time zone aware DateTime.
|
||||
1. [titlebar_buttons](https://github.com/gtk-flutter/titlebar_buttons) - A package which provides most of the titlebar buttons from windows, linux and macos.
|
||||
1. [tray_manager](https://github.com/leanflutter/tray_manager) - This plugin allows Flutter desktop apps to defines system tray.
|
||||
1. [url_launcher](https://pub.dev/packages/url_launcher) - Flutter plugin for launching a URL. Supports web, phone, SMS, and email schemes.
|
||||
1. [uuid](https://pub.dev/packages/uuid) - RFC4122 (v1, v4, v5, v6, v7, v8) UUID Generator and Parser for Dart
|
||||
1. [version](https://github.com/dartninja/version) - Provides a simple class for parsing and comparing semantic versions as defined by http://semver.org/
|
||||
1. [very_good_infinite_list](https://github.com/VeryGoodOpenSource/very_good_infinite_list) - A library for easily displaying paginated data, created by Very Good Ventures. Great for activity feeds, news feeds, and more.
|
||||
1. [visibility_detector](https://pub.dev/packages/visibility_detector) - A widget that detects the visibility of its child and notifies a callback.
|
||||
1. [web_socket_channel](https://pub.dev/packages/web_socket_channel) - StreamChannel wrappers for WebSockets. Provides a cross-platform WebSocketChannel API, a cross-platform implementation of that API that communicates over an underlying StreamChannel.
|
||||
1. [wikipedia_api](https://github.com/KRTirtho/wikipedia_api) - Wikipedia API for dart and flutter
|
||||
1. [win32_registry](https://pub.dev/packages/win32_registry) - A package that provides a friendly Dart API for accessing the Windows Registry.
|
||||
1. [window_manager](https://leanflutter.dev) - This plugin allows Flutter desktop apps to resizing and repositioning the window.
|
||||
1. [youtube_explode_dart](https://github.com/Hexer10/youtube_explode_dart) - A port in dart of the youtube explode library. Supports several API functions without the need of Youtube API Key.
|
||||
1. [http_parser](https://pub.dev/packages/http_parser) - A platform-independent package for parsing and serializing HTTP formats.
|
||||
1. [collection](https://pub.dev/packages/collection) - Collections and utilities functions and classes related to collections.
|
||||
1. [archive](https://pub.dev/packages/archive) - Provides encoders and decoders for various archive and compression formats such as zip, tar, bzip2, gzip, and zlib.
|
||||
1. [hetu_script](https://github.com/hetu-script/hetu-script) - Hetu is a lightweight scripting language for embedding in Flutter apps.
|
||||
1. [get_it](https://github.com/flutter-it/get_it) - Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App"
|
||||
1. [flutter_markdown_plus](https://pub.dev/packages/flutter_markdown_plus) - A Markdown renderer for Flutter. Create rich text output, including text styles, tables, links, and more, from plain text data formatted with simple Markdown tags.
|
||||
1. [pub_semver](https://pub.dev/packages/pub_semver) - Versions and version constraints implementing pub's versioning policy. This is very similar to vanilla semver, with a few corner cases.
|
||||
1. [change_case](https://github.com/mrgnhnt96/change_case) - An extension on String for the missing methods for camelCase, PascalCase, Capital Case, snake_case, param-case, CONSTANT_CASE and others.
|
||||
1. [flutter_secure_storage](https://pub.dev/packages/flutter_secure_storage) - Flutter Secure Storage provides API to store data in secure storage. Keychain is used in iOS, KeyStore based solution is used in Android.
|
||||
1. [build_runner](https://pub.dev/packages/build_runner) - A build system for Dart code generation and modular compilation.
|
||||
1. [envied_generator](https://github.com/petercinibulk/envied) - Generator for the Envied package. See https://pub.dev/packages/envied.
|
||||
1. [flutter_gen_runner](https://github.com/FlutterGen/flutter_gen) - The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.
|
||||
1. [flutter_launcher_icons](https://github.com/fluttercommunity/flutter_launcher_icons) - A package which simplifies the task of updating your Flutter app's launcher icon.
|
||||
1. [flutter_lints](https://pub.dev/packages/flutter_lints) - Recommended lints for Flutter apps, packages, and plugins to encourage good coding practices.
|
||||
1. [json_serializable](https://pub.dev/packages/json_serializable) - Automatically generate code for converting to and from JSON by annotating Dart classes.
|
||||
1. [freezed](https://pub.dev/packages/freezed) - Code generation for immutable classes that has a simple syntax/API without compromising on the features.
|
||||
1. [process_run](https://github.com/tekartik/process_run.dart/blob/master/packages/process_run) - Process run helpers for Linux/Win/Mac and which like feature for finding executables.
|
||||
1. [pubspec_parse](https://pub.dev/packages/pubspec_parse) - Simple package for parsing pubspec.yaml files with a type-safe API and rich error reporting.
|
||||
1. [pub_api_client](https://github.com/leoafarias/pub_api_client) - An API Client for Pub to interact with public package information.
|
||||
1. [io](https://pub.dev/packages/io) - Utilities for the Dart VM Runtime including support for ANSI colors, file copying, and standard exit code values.
|
||||
1. [drift_dev](https://drift.simonbinder.eu/) - Dev-dependency for users of drift. Contains the generator and development tools.
|
||||
1. [test](https://pub.dev/packages/test) - A full featured library for writing and running Dart tests across platforms.
|
||||
1. [auto_route_generator](https://github.com/Milad-Akarie/auto_route_library) - AutoRoute is a declarative routing solution, where everything needed for navigation is automatically generated for you.
|
||||
1. [desktop_webview_window](https://github.com/MixinNetwork/flutter-plugins/tree/main/packages/desktop_webview_window) - Show a webview window on your flutter desktop application.
|
||||
1. [disable_battery_optimization](https://github.com/pvsvamsi/Disable-Battery-Optimizations) - Flutter plugin to check and disable battery optimizations. Also shows custom steps to disable the optimizations in devices like mi, xiaomi, samsung, oppo, huawei, oneplus etc
|
||||
1. [draggable_scrollbar](https://github.com/fluttercommunity/flutter-draggable-scrollbar) - A scrollbar that can be dragged for quickly navigation through a vertical list. Additional option is showing label next to scrollthumb with information about current item.
|
||||
1. [flutter_broadcasts](https://github.com/KRTirtho/flutter_broadcasts.git) - A plugin for sending and receiving broadcasts with Android intents and iOS notifications.
|
||||
1. [scrobblenaut](https://github.com/Nebulino/Scrobblenaut) - A deadly simple LastFM API Wrapper for Dart. So deadly simple that it's gonna hit the mark.
|
||||
1. [yt_dlp_dart](https://github.com/KRTirtho/yt_dlp_dart.git) - A starting point for Dart libraries or applications.
|
||||
1. [flutter_new_pipe_extractor](https://github.com/KRTirtho/flutter_new_pipe_extractor) - NewPipeExtractor binding for Flutter (Android only)
|
||||
1. [hetu_std](https://github.com/hetu-community/hetu_std.git) - A sample command-line application.
|
||||
1. [hetu_otp_util](https://github.com/hetu-community/hetu_otp_util.git) - A sample command-line application.
|
||||
1. [hetu_spotube_plugin](https://github.com/KRTirtho/hetu_spotube_plugin) - A new Flutter package project.
|
||||
1. [media_kit](https://github.com/media-kit/media-kit) - A cross-platform video player & audio player for Flutter & Dart. Performant, stable, feature-proof & modular.
|
||||
1. [media_kit_libs_audio](https://github.com/media-kit/media-kit.git) - package:media_kit audio (only) playback native libraries for all platforms.
|
||||
|
||||
</details>
|
||||
|
||||
<div align="center"><h4>© Copyright Spotube 2025</h4></div>
|
||||
Learn more about [Kotlin Multiplatform](https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html)…
|
||||
@ -1,40 +0,0 @@
|
||||
# This file configures the analyzer, which statically analyzes Dart code to
|
||||
# check for errors, warnings, and lints.
|
||||
#
|
||||
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
|
||||
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
|
||||
# invoked from the command line by running `flutter analyze`.
|
||||
|
||||
# The following line activates a set of recommended lints for Flutter apps,
|
||||
# packages, and plugins designed to encourage good coding practices.
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
|
||||
linter:
|
||||
# The lint rules applied to this project can be customized in the
|
||||
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
||||
# included above or to enable additional rules. A list of all available lints
|
||||
# and their documentation is published at
|
||||
# https://dart-lang.github.io/linter/lints/index.html.
|
||||
#
|
||||
# Instead of disabling a lint rule for the entire project in the
|
||||
# section below, it can also be suppressed for a single line of code
|
||||
# or a specific dart file by using the `// ignore: name_of_lint` and
|
||||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
|
||||
# producing the lint.
|
||||
rules:
|
||||
# avoid_print: false # Uncomment to disable the `avoid_print` rule
|
||||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
||||
file_names: false
|
||||
avoid_renaming_method_parameters: false
|
||||
|
||||
# Additional information about this file can be found at
|
||||
# https://dart.dev/guides/language/analysis-options
|
||||
analyzer:
|
||||
errors:
|
||||
invalid_annotation_target: ignore
|
||||
exclude:
|
||||
- "**.freezed.dart"
|
||||
- "**.g.dart"
|
||||
- "**.gr.dart"
|
||||
- "**/generated_plugin_registrant.dart"
|
||||
- test/**/*.dart
|
||||
14
android/.gitignore
vendored
@ -1,14 +0,0 @@
|
||||
gradle-wrapper.jar
|
||||
/.gradle
|
||||
/captures/
|
||||
/gradlew
|
||||
/gradlew.bat
|
||||
/local.properties
|
||||
GeneratedPluginRegistrant.java
|
||||
|
||||
# Remember to never publicly share your keystore.
|
||||
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
|
||||
key.properties
|
||||
**/*.keystore
|
||||
**/*.jks
|
||||
.kotlin
|
||||
@ -1,140 +0,0 @@
|
||||
plugins {
|
||||
id "com.android.application"
|
||||
id "kotlin-android"
|
||||
id "dev.flutter.flutter-gradle-plugin"
|
||||
id "org.jetbrains.kotlin.plugin.compose"
|
||||
}
|
||||
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
def keystoreProperties = new Properties()
|
||||
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||
}
|
||||
|
||||
def composeVersion = "1.4.8"
|
||||
|
||||
android {
|
||||
namespace "oss.krtirtho.spotube"
|
||||
|
||||
compileSdkVersion 36
|
||||
|
||||
ndkVersion = "29.0.14206865"
|
||||
|
||||
compileOptions {
|
||||
coreLibraryDesugaringEnabled true
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
compose true
|
||||
}
|
||||
|
||||
composeOptions {
|
||||
kotlinCompilerExtensionVersion "$composeVersion" // Correlates with org.jetbrains.kotlin.android plugin in settings.gradle
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId "oss.krtirtho.spotube"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 35
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
multiDexEnabled true
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
keyAlias keystoreProperties['keyAlias']
|
||||
keyPassword keystoreProperties['keyPassword']
|
||||
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
||||
storePassword keystoreProperties['storePassword']
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
debug {
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions "default"
|
||||
|
||||
productFlavors {
|
||||
nightly {
|
||||
dimension "default"
|
||||
resValue "string", "app_name_en", "Spotube Nightly"
|
||||
applicationIdSuffix ".nightly"
|
||||
versionNameSuffix "-nightly"
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
dev {
|
||||
dimension "default"
|
||||
resValue "string", "app_name_en", "Spotube Dev"
|
||||
applicationIdSuffix ".dev"
|
||||
versionNameSuffix "-dev"
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
stable {
|
||||
dimension "default"
|
||||
resValue "string", "app_name_en", "Spotube"
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
resources.excludes += "DebugProbesKt.bin"
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
def glanceVersion = "1.1.1"
|
||||
dependencies {
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4'
|
||||
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
|
||||
// other deps so just ignore
|
||||
implementation 'com.android.support:multidex:2.0.1'
|
||||
|
||||
implementation "androidx.glance:glance-appwidget:$glanceVersion"
|
||||
implementation "androidx.glance:glance-appwidget-preview:$glanceVersion"
|
||||
implementation "androidx.glance:glance-preview:$glanceVersion"
|
||||
implementation "androidx.glance:glance-material3:$glanceVersion"
|
||||
implementation "androidx.glance:glance-material:$glanceVersion"
|
||||
implementation "androidx.work:work-runtime-ktx:2.8.1"
|
||||
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3"
|
||||
implementation 'com.google.code.gson:gson:2.11.0'
|
||||
}
|
||||
60
android/app/proguard-rules.pro
vendored
@ -1,60 +0,0 @@
|
||||
#Flutter Wrapper
|
||||
# -keep class io.flutter.app.** { *; }
|
||||
-keep class io.flutter.plugin.** { *; }
|
||||
-keep class io.flutter.util.** { *; }
|
||||
-keep class io.flutter.view.** { *; }
|
||||
# -keep class io.flutter.** { *; }
|
||||
-keep class io.flutter.plugins.** { *; }
|
||||
-keep class de.prosiebensat1digital.** { *; }
|
||||
|
||||
-keep class androidx.lifecycle.DefaultLifecycleObserver
|
||||
|
||||
-keepnames class kotlinx.serialization.** { *; }
|
||||
-keepnames class oss.krtirtho.spotube.glance.models.** { *; }
|
||||
-keep @kotlinx.serialization.Serializable class *
|
||||
-keepclassmembers class ** {
|
||||
@kotlinx.serialization.* <fields>;
|
||||
}
|
||||
|
||||
## We don't need beans
|
||||
-dontwarn java.beans.BeanDescriptor
|
||||
-dontwarn java.beans.BeanInfo
|
||||
-dontwarn java.beans.IntrospectionException
|
||||
-dontwarn java.beans.Introspector
|
||||
-dontwarn java.beans.PropertyDescriptor
|
||||
|
||||
## Rules for NewPipeExtractor
|
||||
-keep class org.schabi.newpipe.extractor.timeago.patterns.** { *; }
|
||||
-keep class org.mozilla.javascript.** { *; }
|
||||
-keep class org.mozilla.classfile.ClassFileWriter
|
||||
-dontwarn com.google.re2j.**
|
||||
-dontwarn org.mozilla.javascript.tools.**
|
||||
|
||||
-dontwarn javax.script.AbstractScriptEngine
|
||||
-dontwarn javax.script.Bindings
|
||||
-dontwarn javax.script.Compilable
|
||||
-dontwarn javax.script.CompiledScript
|
||||
-dontwarn javax.script.Invocable
|
||||
-dontwarn javax.script.ScriptContext
|
||||
-dontwarn javax.script.ScriptEngine
|
||||
-dontwarn javax.script.ScriptEngineFactory
|
||||
-dontwarn javax.script.ScriptException
|
||||
-dontwarn javax.script.SimpleBindings
|
||||
-dontwarn jdk.dynalink.CallSiteDescriptor
|
||||
-dontwarn jdk.dynalink.DynamicLinker
|
||||
-dontwarn jdk.dynalink.DynamicLinkerFactory
|
||||
-dontwarn jdk.dynalink.NamedOperation
|
||||
-dontwarn jdk.dynalink.Namespace
|
||||
-dontwarn jdk.dynalink.NamespaceOperation
|
||||
-dontwarn jdk.dynalink.Operation
|
||||
-dontwarn jdk.dynalink.RelinkableCallSite
|
||||
-dontwarn jdk.dynalink.StandardNamespace
|
||||
-dontwarn jdk.dynalink.StandardOperation
|
||||
-dontwarn jdk.dynalink.linker.GuardedInvocation
|
||||
-dontwarn jdk.dynalink.linker.GuardingDynamicLinker
|
||||
-dontwarn jdk.dynalink.linker.LinkRequest
|
||||
-dontwarn jdk.dynalink.linker.LinkerServices
|
||||
-dontwarn jdk.dynalink.linker.TypeBasedGuardingDynamicLinker
|
||||
-dontwarn jdk.dynalink.linker.support.CompositeTypeBasedGuardingDynamicLinker
|
||||
-dontwarn jdk.dynalink.linker.support.Guards
|
||||
-dontwarn jdk.dynalink.support.ChainedCallSite
|
||||
@ -1,19 +0,0 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- Flutter needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<application
|
||||
android:name="${applicationName}"
|
||||
android:allowBackup="false"
|
||||
android:fullBackupContent="false"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name_en"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:usesCleartextTraffic="true">
|
||||
<!-- Disable Impeller -->
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.EnableImpeller"
|
||||
android:value="false" />
|
||||
</application>
|
||||
</manifest>
|
||||
@ -1,135 +0,0 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
||||
|
||||
<queries>
|
||||
<!-- If your app opens https URLs -->
|
||||
<intent>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<data android:scheme="https" />
|
||||
</intent>
|
||||
</queries>
|
||||
|
||||
<application
|
||||
android:name="${applicationName}"
|
||||
android:allowBackup="false"
|
||||
android:fullBackupContent="false"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name_en"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:usesCleartextTraffic="true">
|
||||
<!-- Enable Impeller -->
|
||||
<!-- <meta-data
|
||||
android:name="io.flutter.embedding.android.EnableImpeller"
|
||||
android:value="false" /> -->
|
||||
|
||||
<activity
|
||||
android:name="com.ryanheise.audioservice.AudioServiceActivity"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleInstance"
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!--
|
||||
Specifies an Android theme to apply to this Activity as soon as
|
||||
the Android process has started. This theme is visible to the user
|
||||
while the Flutter UI initializes. After that, this theme continues
|
||||
to determine the Window background behind the Flutter UI.
|
||||
-->
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme" />
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="text/*" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="spotube" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="es.antonborri.home_widget.action.LAUNCH" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- AudioService Config -->
|
||||
<service
|
||||
android:name="com.ryanheise.audioservice.AudioService"
|
||||
android:exported="true"
|
||||
android:foregroundServiceType="mediaPlayback">
|
||||
<intent-filter>
|
||||
<action android:name="android.media.browse.MediaBrowserService" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<receiver
|
||||
android:name="com.ryanheise.audioservice.MediaButtonReceiver"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<!-- =================== -->
|
||||
|
||||
<meta-data
|
||||
android:name="com.google.android.gms.car.application"
|
||||
android:resource="@xml/automotive_app_desc" />
|
||||
|
||||
<!-- Home Widget config -->
|
||||
<receiver
|
||||
android:name=".glance.HomePlayerWidgetReceiver"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="android.appwidget.provider"
|
||||
android:resource="@xml/home_player_widget_config" />
|
||||
</receiver>
|
||||
|
||||
<receiver
|
||||
android:name="es.antonborri.home_widget.HomeWidgetBackgroundReceiver"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="es.antonborri.home_widget.action.BACKGROUND" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<service
|
||||
android:name="es.antonborri.home_widget.HomeWidgetBackgroundService"
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BIND_JOB_SERVICE" />
|
||||
<!-- =================== -->
|
||||
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
</application>
|
||||
</manifest>
|
||||
@ -1,25 +0,0 @@
|
||||
// Generated file.
|
||||
//
|
||||
// If you wish to remove Flutter's multidex support, delete this entire file.
|
||||
//
|
||||
// Modifications to this file should be done in a copy under a different name
|
||||
// as this file may be regenerated.
|
||||
|
||||
package io.flutter.app;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import androidx.annotation.CallSuper;
|
||||
import androidx.multidex.MultiDex;
|
||||
|
||||
/**
|
||||
* Extension of {@link android.app.Application}, adding multidex support.
|
||||
*/
|
||||
public class FlutterMultiDexApplication extends Application {
|
||||
@Override
|
||||
@CallSuper
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(base);
|
||||
MultiDex.install(this);
|
||||
}
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
package oss.krtirtho.spotube
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
class MainActivity: FlutterActivity() {
|
||||
}
|
||||
@ -1,207 +0,0 @@
|
||||
package oss.krtirtho.spotube.glance
|
||||
|
||||
import HomeWidgetGlanceState
|
||||
import HomeWidgetGlanceStateDefinition
|
||||
import android.R
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Icon
|
||||
import android.net.Uri
|
||||
import android.util.Log
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.unit.DpSize
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.glance.GlanceId
|
||||
import androidx.glance.GlanceModifier
|
||||
import androidx.glance.GlanceTheme
|
||||
import androidx.glance.Image
|
||||
import androidx.glance.ImageProvider
|
||||
import androidx.glance.LocalSize
|
||||
import androidx.glance.action.ActionParameters
|
||||
import androidx.glance.action.actionParametersOf
|
||||
import androidx.glance.action.clickable
|
||||
import androidx.glance.background
|
||||
import androidx.glance.appwidget.GlanceAppWidget
|
||||
import androidx.glance.appwidget.SizeMode
|
||||
import androidx.glance.appwidget.action.ActionCallback
|
||||
import androidx.glance.appwidget.action.actionRunCallback
|
||||
import androidx.glance.appwidget.background
|
||||
import androidx.glance.appwidget.components.CircleIconButton
|
||||
import androidx.glance.appwidget.components.Scaffold
|
||||
import androidx.glance.appwidget.cornerRadius
|
||||
import androidx.glance.appwidget.provideContent
|
||||
import androidx.glance.background
|
||||
import androidx.glance.currentState
|
||||
import androidx.glance.layout.Alignment
|
||||
import androidx.glance.layout.Box
|
||||
import androidx.glance.layout.Column
|
||||
import androidx.glance.layout.ContentScale
|
||||
import androidx.glance.layout.Row
|
||||
import androidx.glance.layout.Spacer
|
||||
import androidx.glance.layout.fillMaxSize
|
||||
import androidx.glance.layout.fillMaxWidth
|
||||
import androidx.glance.layout.padding
|
||||
import androidx.glance.layout.size
|
||||
import androidx.glance.preview.ExperimentalGlancePreviewApi
|
||||
import androidx.glance.preview.Preview
|
||||
import androidx.glance.state.GlanceStateDefinition
|
||||
import com.google.gson.Gson
|
||||
import es.antonborri.home_widget.HomeWidgetBackgroundIntent
|
||||
import es.antonborri.home_widget.actionStartActivity
|
||||
import oss.krtirtho.spotube.MainActivity
|
||||
import oss.krtirtho.spotube.glance.models.Track
|
||||
import oss.krtirtho.spotube.glance.widgets.FlutterAssetImageProvider
|
||||
import oss.krtirtho.spotube.glance.widgets.TrackDetailsView
|
||||
import oss.krtirtho.spotube.glance.widgets.TrackProgress
|
||||
|
||||
val gson = Gson()
|
||||
val serverAddressKey = ActionParameters.Key<String>("serverAddress")
|
||||
|
||||
class Breakpoints {
|
||||
companion object {
|
||||
val SMALL_SQUARE = DpSize(100.dp, 100.dp)
|
||||
val HORIZONTAL_RECTANGLE = DpSize(250.dp, 100.dp)
|
||||
val BIG_SQUARE = DpSize(250.dp, 250.dp)
|
||||
}
|
||||
}
|
||||
|
||||
class HomePlayerWidget : GlanceAppWidget() {
|
||||
|
||||
override val sizeMode = SizeMode.Responsive(
|
||||
setOf(
|
||||
Breakpoints.SMALL_SQUARE,
|
||||
Breakpoints.HORIZONTAL_RECTANGLE,
|
||||
Breakpoints.BIG_SQUARE
|
||||
)
|
||||
)
|
||||
|
||||
override val stateDefinition: GlanceStateDefinition<*>?
|
||||
get() = HomeWidgetGlanceStateDefinition()
|
||||
|
||||
override suspend fun provideGlance(context: Context, id: GlanceId) {
|
||||
provideContent {
|
||||
GlanceContent(context, currentState())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@OptIn(ExperimentalGlancePreviewApi::class)
|
||||
@Preview(widthDp = 100, heightDp = 100)
|
||||
@Composable
|
||||
private fun GlanceContent(context: Context, currentState: HomeWidgetGlanceState) {
|
||||
val prefs = currentState.preferences
|
||||
val size = LocalSize.current
|
||||
|
||||
val activeTrackStr = prefs.getString("activeTrack", null)
|
||||
|
||||
val isPlaying = prefs.getBoolean("isPlaying", false)
|
||||
val playbackServerAddress = prefs.getString("playbackServerAddress", null) ?: ""
|
||||
|
||||
var activeTrack: Track? = null
|
||||
if (activeTrackStr != null) {
|
||||
activeTrack = gson.fromJson(activeTrackStr, Track::class.java)
|
||||
}
|
||||
|
||||
|
||||
val playIcon = Icon.createWithResource(context, R.drawable.ic_media_play);
|
||||
val pauseIcon = Icon.createWithResource(context, R.drawable.ic_media_pause);
|
||||
val previousIcon = Icon.createWithResource(context, R.drawable.ic_media_previous);
|
||||
val nextIcon = Icon.createWithResource(context, R.drawable.ic_media_next);
|
||||
|
||||
GlanceTheme {
|
||||
Box(
|
||||
modifier = GlanceModifier
|
||||
.fillMaxSize()
|
||||
.cornerRadius(8.dp)
|
||||
.background(
|
||||
color = GlanceTheme.colors.surface.getColor(context)
|
||||
)
|
||||
.clickable {
|
||||
actionStartActivity<MainActivity>(context)
|
||||
}
|
||||
,
|
||||
) {
|
||||
Box(
|
||||
modifier = GlanceModifier
|
||||
.background(
|
||||
color =
|
||||
GlanceTheme.colors.surface.getColor(context)
|
||||
.copy(alpha = 0.5f),
|
||||
)
|
||||
.fillMaxSize(),
|
||||
) {}
|
||||
Column(
|
||||
modifier = GlanceModifier.padding(top = 10.dp, start = 10.dp, end = 10.dp)
|
||||
) {
|
||||
Row(verticalAlignment = Alignment.Vertical.CenterVertically) {
|
||||
TrackDetailsView(activeTrack)
|
||||
}
|
||||
Spacer(modifier = GlanceModifier.size(6.dp))
|
||||
if (size != Breakpoints.SMALL_SQUARE) {
|
||||
TrackProgress(prefs)
|
||||
}
|
||||
Spacer(modifier = GlanceModifier.size(6.dp))
|
||||
Row(
|
||||
modifier = GlanceModifier.fillMaxWidth(),
|
||||
horizontalAlignment = Alignment.Horizontal.CenterHorizontally
|
||||
) {
|
||||
CircleIconButton(
|
||||
imageProvider = ImageProvider(previousIcon),
|
||||
contentDescription = "Previous",
|
||||
onClick = actionRunCallback<PreviousAction>(
|
||||
parameters = actionParametersOf(serverAddressKey to playbackServerAddress)
|
||||
)
|
||||
)
|
||||
Spacer(modifier = GlanceModifier.size(6.dp))
|
||||
CircleIconButton(
|
||||
imageProvider =
|
||||
if (isPlaying) ImageProvider(pauseIcon)
|
||||
else ImageProvider(playIcon),
|
||||
contentDescription = "Play/Pause",
|
||||
onClick = actionRunCallback<PlayPauseAction>(
|
||||
parameters = actionParametersOf(serverAddressKey to playbackServerAddress)
|
||||
)
|
||||
)
|
||||
Spacer(modifier = GlanceModifier.size(6.dp))
|
||||
CircleIconButton(
|
||||
imageProvider = ImageProvider(nextIcon),
|
||||
contentDescription = "Previous",
|
||||
onClick = actionRunCallback<NextAction>(
|
||||
parameters = actionParametersOf(
|
||||
serverAddressKey to playbackServerAddress
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class PlayPauseAction : InteractiveAction("toggle-playback")
|
||||
class NextAction : InteractiveAction("next")
|
||||
class PreviousAction : InteractiveAction("previous")
|
||||
|
||||
|
||||
abstract class InteractiveAction(val command: String) : ActionCallback {
|
||||
override suspend fun onAction(
|
||||
context: Context,
|
||||
glanceId: GlanceId,
|
||||
parameters: ActionParameters
|
||||
) {
|
||||
val serverAddress = parameters[serverAddressKey] ?: ""
|
||||
|
||||
Log.d("HomePlayerWidget", "Sending command $command to $serverAddress")
|
||||
|
||||
if (serverAddress == null || serverAddress.isEmpty()) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
val backgroundIntent = HomeWidgetBackgroundIntent.getBroadcast(
|
||||
context,
|
||||
Uri.parse("spotube://playback/$command?serverAddress=$serverAddress")
|
||||
)
|
||||
backgroundIntent.send()
|
||||
}
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
package oss.krtirtho.spotube.glance
|
||||
|
||||
import HomeWidgetGlanceWidgetReceiver
|
||||
|
||||
class HomePlayerWidgetReceiver : HomeWidgetGlanceWidgetReceiver<HomePlayerWidget>() {
|
||||
override val glanceAppWidget = HomePlayerWidget()
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
package oss.krtirtho.spotube.glance.models
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class AlbumSimple(
|
||||
@SerializedName("album_type")
|
||||
val albumType: AlbumType?,
|
||||
|
||||
@SerializedName("available_markets")
|
||||
val availableMarkets: List<Market>?,
|
||||
|
||||
val href: String?,
|
||||
val id: String?,
|
||||
val images: List<Image>?,
|
||||
val name: String?,
|
||||
|
||||
@SerializedName("release_date")
|
||||
val releaseDate: String?,
|
||||
|
||||
@SerializedName("release_date_precision")
|
||||
val releaseDatePrecision: DatePrecision?,
|
||||
|
||||
val type: String?,
|
||||
val uri: String?,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
enum class AlbumType {
|
||||
album,
|
||||
single,
|
||||
compilation
|
||||
}
|
||||
|
||||
enum class DatePrecision {
|
||||
year,
|
||||
month,
|
||||
day
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
package oss.krtirtho.spotube.glance.models
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class Artist(
|
||||
val href: String?,
|
||||
val id: String?,
|
||||
val name: String?,
|
||||
val type: String?,
|
||||
val uri: String?,
|
||||
|
||||
val followers: Followers?,
|
||||
val genres: List<String>?,
|
||||
val images: List<Image>?,
|
||||
|
||||
@SerializedName("popularity")
|
||||
val popularity: Int?
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class Followers(
|
||||
val total: Int?
|
||||
)
|
||||
@ -1,10 +0,0 @@
|
||||
package oss.krtirtho.spotube.glance.models
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class Image(
|
||||
val height: Int?,
|
||||
val width: Int?,
|
||||
val path: String,
|
||||
)
|
||||
@ -1,37 +0,0 @@
|
||||
package oss.krtirtho.spotube.glance.models
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlin.time.Duration.Companion.milliseconds
|
||||
|
||||
@Serializable
|
||||
data class Track(
|
||||
val album: AlbumSimple?, val artists: List<Artist>?,
|
||||
|
||||
@SerializedName("available_markets") val availableMarkets: List<Market>?,
|
||||
|
||||
@SerializedName("disc_number") val discNumber: Int?,
|
||||
|
||||
@SerializedName("duration_ms") val durationMs: Int,
|
||||
|
||||
val explicit: Boolean?, val href: String?, val id: String?,
|
||||
|
||||
@SerializedName("is_playable") val isPlayable: Boolean?,
|
||||
|
||||
val name: String?,
|
||||
|
||||
@SerializedName("popularity") val popularity: Int?,
|
||||
|
||||
@SerializedName("preview_url") val previewUrl: String?,
|
||||
|
||||
@SerializedName("track_number") val trackNumber: Int?,
|
||||
|
||||
val type: String?, val uri: String?
|
||||
) {
|
||||
val duration: kotlin.time.Duration
|
||||
get() = durationMs.toLong().milliseconds
|
||||
}
|
||||
|
||||
enum class Market {
|
||||
AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, XK, YE, YT, ZA, ZM, ZW,
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
package oss.krtirtho.spotube.glance.widgets
|
||||
|
||||
import android.graphics.BitmapFactory
|
||||
import android.util.Base64
|
||||
import androidx.glance.ImageProvider
|
||||
|
||||
@Suppress("FunctionName")
|
||||
fun Base64ImageProvider(base64: String): ImageProvider {
|
||||
var bytes = Base64.decode(base64, Base64.DEFAULT);
|
||||
|
||||
var bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.size);
|
||||
|
||||
return ImageProvider(bitmap)
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
package oss.krtirtho.spotube.glance.widgets
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.BitmapFactory
|
||||
import androidx.glance.ImageProvider
|
||||
|
||||
@Suppress("FunctionName")
|
||||
fun FlutterAssetImageProvider(context: Context, path: String): ImageProvider {
|
||||
var inputStream = context.assets.open("flutter_assets/$path")
|
||||
|
||||
return ImageProvider(
|
||||
BitmapFactory.decodeStream(inputStream)
|
||||
)
|
||||
}
|
||||
@ -1,78 +0,0 @@
|
||||
package oss.krtirtho.spotube.glance.widgets
|
||||
|
||||
import android.graphics.BitmapFactory
|
||||
import android.net.Uri
|
||||
import android.util.Log
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.glance.GlanceModifier
|
||||
import androidx.glance.GlanceTheme
|
||||
import androidx.glance.Image
|
||||
import androidx.glance.ImageProvider
|
||||
import androidx.glance.LocalContext
|
||||
import androidx.glance.LocalSize
|
||||
import androidx.glance.appwidget.cornerRadius
|
||||
import androidx.glance.layout.Alignment
|
||||
import androidx.glance.layout.Row
|
||||
import androidx.glance.layout.Column
|
||||
import androidx.glance.layout.ContentScale
|
||||
import androidx.glance.layout.Spacer
|
||||
import androidx.glance.layout.size
|
||||
import androidx.glance.text.FontWeight
|
||||
import androidx.glance.text.Text
|
||||
import androidx.glance.text.TextStyle
|
||||
import oss.krtirtho.spotube.glance.Breakpoints
|
||||
import oss.krtirtho.spotube.glance.models.Track
|
||||
|
||||
@Composable
|
||||
fun TrackDetailsView(activeTrack: Track?) {
|
||||
val context = LocalContext.current
|
||||
|
||||
val size = LocalSize.current
|
||||
|
||||
val artistStr = activeTrack?.artists?.map { it.name }?.joinToString(", ") ?: "<No Artist>"
|
||||
val imgLocalPath = activeTrack?.album?.images?.get(0)?.path;
|
||||
val title = activeTrack?.name ?: "<No Track>"
|
||||
|
||||
|
||||
Image(
|
||||
provider =
|
||||
if (imgLocalPath == null)
|
||||
ImageProvider(
|
||||
BitmapFactory.decodeResource(
|
||||
context.resources,
|
||||
android.R.drawable.ic_delete
|
||||
)
|
||||
)
|
||||
else ImageProvider(BitmapFactory.decodeFile(imgLocalPath)),
|
||||
contentDescription = "Album Art",
|
||||
modifier = GlanceModifier.cornerRadius(8.dp)
|
||||
.size(
|
||||
if (size.height < 200.dp) 50.dp
|
||||
else 100.dp
|
||||
),
|
||||
contentScale = ContentScale.Fit
|
||||
)
|
||||
Spacer(modifier = GlanceModifier.size(6.dp))
|
||||
Column {
|
||||
Text(
|
||||
text = title,
|
||||
style = TextStyle(
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = GlanceTheme.colors.onBackground
|
||||
),
|
||||
)
|
||||
if (size != Breakpoints.SMALL_SQUARE) {
|
||||
Spacer(modifier = GlanceModifier.size(6.dp))
|
||||
Text(
|
||||
text = artistStr,
|
||||
style = TextStyle(
|
||||
fontSize = 14.sp,
|
||||
color = GlanceTheme.colors.onBackground
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,77 +0,0 @@
|
||||
package oss.krtirtho.spotube.glance.widgets
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.glance.GlanceModifier
|
||||
import androidx.glance.GlanceTheme
|
||||
import androidx.glance.LocalSize
|
||||
import androidx.glance.appwidget.LinearProgressIndicator
|
||||
import androidx.glance.layout.Column
|
||||
import androidx.glance.layout.Row
|
||||
import androidx.glance.layout.Spacer
|
||||
import androidx.glance.layout.fillMaxWidth
|
||||
import androidx.glance.layout.size
|
||||
import androidx.glance.text.Text
|
||||
import androidx.glance.text.TextStyle
|
||||
import kotlin.math.max
|
||||
import kotlin.time.Duration
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
import oss.krtirtho.spotube.glance.Breakpoints
|
||||
|
||||
fun Duration.format(): String {
|
||||
return this.toComponents { hour, minutes, seconds, nanoseconds ->
|
||||
var paddedSeconds = seconds.toString().padStart(2, '0')
|
||||
var paddedMinutes = minutes.toString().padStart(2, '0')
|
||||
var paddedHour = hour.toString().padStart(2, '0')
|
||||
if (hour == 0L) {
|
||||
"$paddedMinutes:$paddedSeconds"
|
||||
} else {
|
||||
"$paddedHour:$paddedMinutes:$paddedSeconds"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun TrackProgress(prefs: SharedPreferences) {
|
||||
val size = LocalSize.current
|
||||
val position = prefs.getInt("position", 0).seconds
|
||||
var duration = prefs.getInt("duration", 0).seconds
|
||||
|
||||
var progress = position.inWholeSeconds.toFloat() / max(duration.inWholeSeconds.toFloat(), 1.0f)
|
||||
|
||||
var textStyle =
|
||||
TextStyle(
|
||||
color = GlanceTheme.colors.onBackground,
|
||||
)
|
||||
|
||||
if (size == Breakpoints.HORIZONTAL_RECTANGLE) {
|
||||
Row(modifier = GlanceModifier.fillMaxWidth()) {
|
||||
Text(text = position.format(), style = textStyle)
|
||||
Spacer(modifier = GlanceModifier.size(6.dp))
|
||||
LinearProgressIndicator(
|
||||
progress = progress,
|
||||
modifier = GlanceModifier.defaultWeight(),
|
||||
color = GlanceTheme.colors.primary,
|
||||
backgroundColor = GlanceTheme.colors.primaryContainer,
|
||||
)
|
||||
Spacer(modifier = GlanceModifier.size(6.dp))
|
||||
Text(text = duration.format(), style = textStyle)
|
||||
}
|
||||
} else {
|
||||
Column(modifier = GlanceModifier.fillMaxWidth()) {
|
||||
LinearProgressIndicator(
|
||||
progress = progress,
|
||||
modifier = GlanceModifier.fillMaxWidth(),
|
||||
color = GlanceTheme.colors.primary,
|
||||
backgroundColor = GlanceTheme.colors.primaryContainer,
|
||||
)
|
||||
Spacer(modifier = GlanceModifier.size(6.dp))
|
||||
Row(modifier = GlanceModifier.fillMaxWidth()) {
|
||||
Text(text = position.format(), style = textStyle)
|
||||
Spacer(modifier = GlanceModifier.defaultWeight())
|
||||
Text(text = duration.format(), style = textStyle)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 162 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 247 KiB |
|
Before Width: | Height: | Size: 3.0 MiB |
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<bitmap android:gravity="fill" android:src="@drawable/background"/>
|
||||
</item>
|
||||
<item>
|
||||
<bitmap android:gravity="center" android:src="@drawable/splash"/>
|
||||
</item>
|
||||
<item android:bottom="0dp">
|
||||
<bitmap android:gravity="bottom" android:src="@drawable/branding"/>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 162 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 247 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 3.0 MiB |
@ -1,27 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="762"
|
||||
android:viewportHeight="762">
|
||||
<path
|
||||
android:pathData="M309.08,370.99L309.08,479.87C309.08,486.36 314.33,491.6 320.83,491.6C327.31,491.6 332.58,486.36 332.58,479.87L332.58,370.99C332.58,364.51 327.31,359.26 320.83,359.26C314.33,359.26 309.08,364.51 309.08,370.99Z"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeWidth="14"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#000000"
|
||||
android:strokeLineCap="butt"/>
|
||||
<path
|
||||
android:pathData="M254.59,491.73L280.46,491.73L280.46,362.47C280.53,361.85 280.64,361.23 280.64,360.6C280.64,304.83 325.72,259.46 381.12,259.46C436.51,259.46 481.59,304.83 481.59,360.6C481.59,361.45 481.71,362.27 481.84,363.1L481.84,491.73L507.71,491.73C525.72,491.73 540.33,476.65 540.33,458.03L540.33,390.62C540.33,375.26 530.37,362.33 516.78,358.26C515.53,284.17 455.17,224.26 381.12,224.26C307.05,224.26 246.69,284.18 245.45,358.29C231.88,362.36 221.96,375.29 221.96,390.63L221.96,458.03C221.96,476.64 236.56,491.73 254.59,491.73Z"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeWidth="20"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#000000"
|
||||
android:strokeLineCap="butt"/>
|
||||
<path
|
||||
android:pathData="M431.08,370.99L431.08,479.87C431.08,486.36 436.33,491.6 442.83,491.6C449.31,491.6 454.58,486.36 454.58,479.87L454.58,370.99C454.58,364.51 449.31,359.26 442.83,359.26C436.33,359.26 431.08,364.51 431.08,370.99Z"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeWidth="14"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#000000"
|
||||
android:strokeLineCap="butt"/>
|
||||
</vector>
|
||||
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<bitmap android:gravity="fill" android:src="@drawable/background"/>
|
||||
</item>
|
||||
<item>
|
||||
<bitmap android:gravity="center" android:src="@drawable/splash"/>
|
||||
</item>
|
||||
<item android:bottom="0dp">
|
||||
<bitmap android:gravity="bottom" android:src="@drawable/branding"/>
|
||||
</item>
|
||||
</layer-list>
|
||||
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground>
|
||||
<inset
|
||||
android:drawable="@drawable/ic_launcher_foreground"
|
||||
android:inset="16%" />
|
||||
</foreground>
|
||||
</adaptive-icon>
|
||||