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"
|
|
||||||
}
|
|
||||||
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -76,7 +76,7 @@ body:
|
|||||||
description: Where did you install Spotube from?
|
description: Where did you install Spotube from?
|
||||||
multiple: true
|
multiple: true
|
||||||
options:
|
options:
|
||||||
- "Website (spotube.krtirtho.dev)"
|
- "Website (spotube.org)"
|
||||||
- "GitHub Releases (Binary)"
|
- "GitHub Releases (Binary)"
|
||||||
- "GitHub Actions (Nightly Binary)"
|
- "GitHub Actions (Nightly Binary)"
|
||||||
- "Play Store (Android)"
|
- "Play Store (Android)"
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1,5 +1,5 @@
|
|||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: Ask a question
|
- name: Ask a question
|
||||||
url: https://github.com/KRTirtho/spotube/discussions/new?category=q-a
|
url: https://github.com/team-spotube/spotube/discussions/new?category=q-a
|
||||||
about: The place for questions, support and feature requests
|
about: The place for questions, support and feature requests
|
||||||
|
|||||||
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/>.
|
||||||
16
.github/dependabot.yml
vendored
@ -1,16 +0,0 @@
|
|||||||
version: 2
|
|
||||||
|
|
||||||
enable-beta-ecosystems: true
|
|
||||||
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: "pub"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
||||||
target-branch: "dev"
|
|
||||||
|
|
||||||
- package-ecosystem: "github-actions"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
||||||
target-branch: "dev"
|
|
||||||
26
.github/workflows/maven-publish.yml
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# .github/workflows/publish.yml
|
||||||
|
|
||||||
|
name: Maven Publish
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
name: Release build and publish
|
||||||
|
runs-on: macOS-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
- name: Set up JDK 21
|
||||||
|
uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
distribution: 'zulu'
|
||||||
|
java-version: 21
|
||||||
|
- name: Publish to MavenCentral
|
||||||
|
run: ./gradlew publishToMavenCentral --no-configuration-cache
|
||||||
|
env:
|
||||||
|
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
|
||||||
|
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
|
||||||
|
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.MAVEN_SIGNING_KEY_ID }}
|
||||||
|
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_SIGNING_KEY_PASSWORD }}
|
||||||
|
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_GPG_KEY_CONTENTS }}
|
||||||
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
|
|
||||||
331
.github/workflows/spotube-publish-binary.yml
vendored
@ -1,137 +1,274 @@
|
|||||||
name: Spotube Publish Binary
|
name: Publish
|
||||||
|
|
||||||
|
# Publishes an existing GitHub release (made by spotube-release-binary.yml) to the package managers.
|
||||||
|
# The `render` job checks out the release tag, downloads its assets and renders packaging/<target> with
|
||||||
|
# Gradle (:composeApp:renderPackaging<Target>: version, checksums, git-cliff release notes). The publish
|
||||||
|
# jobs only push what it rendered.
|
||||||
|
#
|
||||||
|
# Secrets:
|
||||||
|
# FLATHUB_TOKEN PAT with push access to team-spotube/org.spotube.spotube
|
||||||
|
# AUR_USERNAME, AUR_EMAIL, AUR_SSH_PRIVATE_KEY AUR account that maintains spotube-bin
|
||||||
|
# WINGET_TOKEN classic PAT (public_repo) that can push to team-spotube/winget-pkgs and open PRs
|
||||||
|
# CHOCO_API_KEY chocolatey.org API key
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
tag:
|
||||||
description: Version to publish (x.x.x)
|
description: Release tag to publish (vX.Y.Z)
|
||||||
default: 4.0.0
|
|
||||||
required: true
|
required: true
|
||||||
dry_run:
|
type: string
|
||||||
description: Dry run
|
|
||||||
required: true
|
|
||||||
type: boolean
|
|
||||||
default: true
|
|
||||||
jobs:
|
jobs:
|
||||||
description: Jobs to run (flathub,aur,winget,chocolatey)
|
description: Jobs to run (flathub,aur,winget,chocolatey)
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
default: "flathub,aur,winget,chocolatey"
|
default: flathub,aur,winget,chocolatey
|
||||||
|
aur_pkgrel:
|
||||||
|
description: AUR pkgrel (bump to re-release the same version)
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: '1'
|
||||||
|
dry_run:
|
||||||
|
description: Dry run (render the packages, push nothing)
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
env:
|
||||||
|
TAG: ${{ inputs.tag }}
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
flathub:
|
render:
|
||||||
runs-on: ubuntu-22.04
|
name: Render packages
|
||||||
if: contains(inputs.jobs, 'flathub')
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.version.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Validate tag and find release
|
||||||
with:
|
id: version
|
||||||
repository: KRTirtho/com.github.KRTirtho.Spotube
|
env:
|
||||||
token: ${{ secrets.FLATHUB_TOKEN }}
|
DRY_RUN: ${{ inputs.dry_run }}
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
path: spotube
|
|
||||||
|
|
||||||
- name: Update flathub version
|
|
||||||
run: |
|
run: |
|
||||||
python3 spotube/scripts/update_flathub_version.py ${{ inputs.version }}
|
if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
rm -rf spotube
|
echo "::error::tag must look like vX.Y.Z, got '$TAG'"
|
||||||
git config --global user.email "krtirtho@gmail.com"
|
exit 1
|
||||||
git config --global user.name "Kingkor Roy Tirtho"
|
fi
|
||||||
git add .
|
is_draft=$(gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json isDraft --jq .isDraft)
|
||||||
git commit -m "v${{ inputs.version }} Update"
|
# The packages download from the public release URLs, which a draft doesn't have yet
|
||||||
git branch update-${{ inputs.version }}
|
if [ "$is_draft" = "true" ] && [ "$DRY_RUN" != "true" ]; then
|
||||||
git switch update-${{ inputs.version }}
|
echo "::error::release $TAG is still a draft; publish it first"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "version=${TAG#v}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Push to flathub
|
# Full history: git-cliff builds the release notes from it
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.tag }}
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up JDK 21
|
||||||
|
uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 21
|
||||||
|
|
||||||
|
# Configuring :composeApp runs cargo (Gobley)
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v6
|
||||||
|
|
||||||
|
- name: Install git-cliff
|
||||||
|
uses: taiki-e/install-action@v2
|
||||||
|
with:
|
||||||
|
tool: git-cliff
|
||||||
|
|
||||||
|
- name: Download release assets
|
||||||
|
run: |
|
||||||
|
gh release download "$TAG" --repo "$GITHUB_REPOSITORY" --dir release-assets \
|
||||||
|
--pattern 'spotube-linux-*.tar.xz' --pattern 'Spotube-windows-x86_64-setup.exe'
|
||||||
|
|
||||||
|
- name: Render packages
|
||||||
|
env:
|
||||||
|
PKGREL: ${{ inputs.aur_pkgrel }}
|
||||||
|
run: |
|
||||||
|
chmod +x gradlew
|
||||||
|
./gradlew :composeApp:renderPackagingFlatpak :composeApp:renderPackagingAur \
|
||||||
|
:composeApp:renderPackagingWinget :composeApp:renderPackagingChocolatey \
|
||||||
|
-Pnightly=false -Ppkgrel="$PKGREL" -PpackagingArtifactsDir=release-assets
|
||||||
|
for f in composeApp/build/packaging/{flatpak/*.yml,aur/PKGBUILD,winget/*.yaml,chocolatey/*.nuspec}; do
|
||||||
|
echo "::group::$f"
|
||||||
|
cat "$f"
|
||||||
|
echo "::endgroup::"
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Upload rendered packages
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: packaging
|
||||||
|
path: |
|
||||||
|
composeApp/build/packaging/flatpak
|
||||||
|
composeApp/build/packaging/aur
|
||||||
|
composeApp/build/packaging/winget
|
||||||
|
composeApp/build/packaging/chocolatey
|
||||||
|
|
||||||
|
# Chocolatey embeds the installer in the package
|
||||||
|
- name: Upload Windows installer
|
||||||
|
if: contains(inputs.jobs, 'chocolatey')
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: windows-installer
|
||||||
|
path: release-assets/Spotube-windows-x86_64-setup.exe
|
||||||
|
|
||||||
|
flathub:
|
||||||
|
name: Flathub
|
||||||
|
needs: render
|
||||||
|
if: contains(inputs.jobs, 'flathub')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
VERSION: ${{ needs.render.outputs.version }}
|
||||||
|
FLATHUB_REPO: team-spotube/org.spotube.spotube
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: packaging
|
||||||
|
path: packaging
|
||||||
|
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
repository: ${{ env.FLATHUB_REPO }}
|
||||||
|
token: ${{ secrets.FLATHUB_TOKEN }}
|
||||||
|
path: flathub
|
||||||
|
|
||||||
|
- name: Commit
|
||||||
|
working-directory: flathub
|
||||||
|
run: |
|
||||||
|
cp ../packaging/flatpak/org.spotube.spotube.yml .
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git switch -c "update-$VERSION"
|
||||||
|
git add org.spotube.spotube.yml
|
||||||
|
git diff --cached
|
||||||
|
git commit -m "Update to $VERSION"
|
||||||
|
|
||||||
|
- name: Push and open PR
|
||||||
if: ${{ !inputs.dry_run }}
|
if: ${{ !inputs.dry_run }}
|
||||||
run: git push -u origin update-${{ inputs.version }}
|
working-directory: flathub
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.FLATHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
git push -u origin "update-$VERSION"
|
||||||
|
gh pr create --repo "$FLATHUB_REPO" --head "update-$VERSION" \
|
||||||
|
--title "Update to $VERSION" \
|
||||||
|
--body "Release notes: https://github.com/$GITHUB_REPOSITORY/releases/tag/$TAG"
|
||||||
|
|
||||||
aur:
|
aur:
|
||||||
runs-on: ubuntu-22.04
|
name: AUR
|
||||||
|
needs: render
|
||||||
if: contains(inputs.jobs, 'aur')
|
if: contains(inputs.jobs, 'aur')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/download-artifact@v8
|
||||||
|
|
||||||
- uses: dsaltares/fetch-gh-release-asset@master
|
|
||||||
with:
|
with:
|
||||||
version: tags/v${{ inputs.version }} # mind the "v" prefix
|
name: packaging
|
||||||
file: spotube-linux-${{inputs.version}}-x86_64.tar.xz
|
path: packaging
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Update PKGBUILD versions
|
- name: Publish to AUR
|
||||||
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 }}
|
if: ${{ !inputs.dry_run }}
|
||||||
uses: KSXGitHub/github-actions-deploy-aur@v2.7.2
|
uses: KSXGitHub/github-actions-deploy-aur@v4.2.0
|
||||||
with:
|
with:
|
||||||
pkgname: spotube-bin
|
pkgname: spotube-bin
|
||||||
pkgbuild: aur-struct/PKGBUILD
|
pkgbuild: packaging/aur/PKGBUILD
|
||||||
commit_username: ${{ secrets.AUR_USERNAME }}
|
commit_username: ${{ secrets.AUR_USERNAME }}
|
||||||
commit_email: ${{ secrets.AUR_EMAIL }}
|
commit_email: ${{ secrets.AUR_EMAIL }}
|
||||||
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
||||||
commit_message: Updated to v${{ inputs.version }}
|
commit_message: Update to ${{ needs.render.outputs.version }}-${{ inputs.aur_pkgrel }}
|
||||||
|
|
||||||
winget:
|
winget:
|
||||||
runs-on: ubuntu-latest
|
name: WinGet
|
||||||
|
needs: render
|
||||||
if: contains(inputs.jobs, 'winget')
|
if: contains(inputs.jobs, 'winget')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
VERSION: ${{ needs.render.outputs.version }}
|
||||||
|
FORK: team-spotube/winget-pkgs
|
||||||
|
MANIFEST_DIR: manifests/k/KRTirtho/Spotube
|
||||||
steps:
|
steps:
|
||||||
- name: Release winget package
|
- uses: actions/download-artifact@v8
|
||||||
if: ${{ !inputs.dry_run }}
|
|
||||||
uses: vedantmgoyal9/winget-releaser@main
|
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.version }}
|
name: packaging
|
||||||
release-tag: v${{ inputs.version }}
|
path: packaging
|
||||||
identifier: KRTirtho.Spotube
|
|
||||||
|
- name: Sync fork with upstream
|
||||||
|
if: ${{ !inputs.dry_run }}
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.WINGET_TOKEN }}
|
||||||
|
run: gh repo sync "$FORK" --source microsoft/winget-pkgs --branch master
|
||||||
|
|
||||||
|
# winget-pkgs is huge: only fetch this package's directory
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
if: ${{ !inputs.dry_run }}
|
||||||
|
with:
|
||||||
|
repository: ${{ env.FORK }}
|
||||||
|
ref: master
|
||||||
token: ${{ secrets.WINGET_TOKEN }}
|
token: ${{ secrets.WINGET_TOKEN }}
|
||||||
|
path: winget-pkgs
|
||||||
|
sparse-checkout: ${{ env.MANIFEST_DIR }}
|
||||||
|
|
||||||
|
- name: Push and open PR
|
||||||
|
if: ${{ !inputs.dry_run }}
|
||||||
|
working-directory: winget-pkgs
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.WINGET_TOKEN }}
|
||||||
|
run: |
|
||||||
|
branch="KRTirtho.Spotube-$VERSION"
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git switch -c "$branch"
|
||||||
|
mkdir -p "$MANIFEST_DIR/$VERSION"
|
||||||
|
cp ../packaging/winget/*.yaml "$MANIFEST_DIR/$VERSION/"
|
||||||
|
git add "$MANIFEST_DIR/$VERSION"
|
||||||
|
git commit -m "New version: KRTirtho.Spotube version $VERSION"
|
||||||
|
git push -u origin "$branch"
|
||||||
|
gh pr create --repo microsoft/winget-pkgs --base master --head "${FORK%%/*}:$branch" \
|
||||||
|
--title "New version: KRTirtho.Spotube version $VERSION" \
|
||||||
|
--body "Release notes: https://github.com/$GITHUB_REPOSITORY/releases/tag/$TAG"
|
||||||
|
|
||||||
chocolatey:
|
chocolatey:
|
||||||
runs-on: windows-latest
|
name: Chocolatey
|
||||||
|
needs: render
|
||||||
if: contains(inputs.jobs, 'chocolatey')
|
if: contains(inputs.jobs, 'chocolatey')
|
||||||
|
runs-on: windows-latest
|
||||||
|
env:
|
||||||
|
VERSION: ${{ needs.render.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
- uses: dsaltares/fetch-gh-release-asset@master
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
version: tags/v${{ inputs.version }} # mind the "v" prefix
|
name: packaging
|
||||||
file: Spotube-windows-x86_64.nupkg
|
path: packaging
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Set up Chocolatey
|
- uses: actions/download-artifact@v8
|
||||||
run: choco apikey -k ${{ secrets.CHOCO_API_KEY }} --source https://push.chocolatey.org/
|
with:
|
||||||
|
name: windows-installer
|
||||||
|
path: packaging/chocolatey/tools
|
||||||
|
|
||||||
- name: Publish to Chocolatey Repository
|
- name: Pack
|
||||||
|
run: choco pack packaging/chocolatey/spotube.nuspec --outputdirectory dist
|
||||||
|
|
||||||
|
- name: Upload package
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: chocolatey-nupkg
|
||||||
|
path: dist/*.nupkg
|
||||||
|
|
||||||
|
- name: Publish to Chocolatey
|
||||||
if: ${{ !inputs.dry_run }}
|
if: ${{ !inputs.dry_run }}
|
||||||
run: choco push Spotube-windows-x86_64.nupkg --source https://push.chocolatey.org/
|
env:
|
||||||
|
CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }}
|
||||||
playstore:
|
run: choco push "dist/spotube.$env:VERSION.nupkg" --source https://push.chocolatey.org/ --api-key "$env:CHOCO_API_KEY"
|
||||||
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 }}
|
|
||||||
|
|||||||
729
.github/workflows/spotube-release-binary.yml
vendored
@ -1,204 +1,603 @@
|
|||||||
name: Spotube Release Binary
|
name: Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
channel:
|
release_type:
|
||||||
|
description: 'Release type'
|
||||||
|
required: true
|
||||||
type: choice
|
type: choice
|
||||||
|
default: 'stable'
|
||||||
options:
|
options:
|
||||||
- stable
|
- stable
|
||||||
- nightly
|
- nightly
|
||||||
default: nightly
|
|
||||||
description: The release channel
|
|
||||||
debug:
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
description: Debug with SSH toggle
|
|
||||||
required: false
|
|
||||||
dry_run:
|
dry_run:
|
||||||
|
description: 'Dry run (build & upload artifacts only, skip creating release)'
|
||||||
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
description: Dry run without uploading to release
|
debug_ssh:
|
||||||
|
description: 'Enable SSH debug session on failure (tmate)'
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
|
# Read-only by default; only create-release gets write access
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
# Never cancel a running release when another is dispatched, and let stable and nightly run side by side
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.release_type }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
env:
|
env:
|
||||||
FLUTTER_VERSION: 3.35.2
|
COMPOSE_WEBVIEW_REPO: KRTirtho/ComposeNativeWebview
|
||||||
FLUTTER_CHANNEL: master
|
COMPOSE_WEBVIEW_COMMIT: cbd36f88927298a28a2d64c6acf7ec3b2def6f9d
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_platform:
|
prepare-deps:
|
||||||
strategy:
|
name: Prepare Dependencies
|
||||||
matrix:
|
runs-on: macos-latest
|
||||||
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:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout ComposeNativeWebview
|
||||||
- uses: subosito/flutter-action@v2.18.0
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
repository: ${{ env.COMPOSE_WEBVIEW_REPO }}
|
||||||
channel: ${{ env.FLUTTER_CHANNEL }}
|
ref: ${{ env.COMPOSE_WEBVIEW_COMMIT }}
|
||||||
cache: true
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
git-source: https://github.com/flutter/flutter.git
|
path: compose-webview
|
||||||
|
|
||||||
# - name: free disk space
|
- name: Set up JDK 21
|
||||||
# if: ${{ matrix.platform == 'android' }}
|
uses: actions/setup-java@v6
|
||||||
# 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:
|
with:
|
||||||
distribution: "zulu"
|
distribution: temurin
|
||||||
java-version: "17"
|
java-version: 21
|
||||||
cache: "gradle"
|
|
||||||
check-latest: true
|
|
||||||
|
|
||||||
- name: Setup Rust toolchain
|
- name: Set up Android SDK
|
||||||
|
uses: android-actions/setup-android@v4
|
||||||
|
|
||||||
|
- name: Set up Rust
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
|
|
||||||
- name: Install Xcode
|
- name: Set up Gradle
|
||||||
if: ${{matrix.platform == 'ios'}}
|
uses: gradle/actions/setup-gradle@v6
|
||||||
uses: maxim-lobanov/setup-xcode@v1
|
|
||||||
with:
|
|
||||||
xcode-version: "16.2"
|
|
||||||
|
|
||||||
- name: Install ${{matrix.platform}} dependencies
|
- name: Publish compose-webview to mavenLocal
|
||||||
|
working-directory: compose-webview
|
||||||
run: |
|
run: |
|
||||||
flutter pub get
|
chmod +x gradlew
|
||||||
dart cli/cli.dart install-dependencies --platform=${{matrix.platform}} --arch=${{matrix.arch}}
|
./gradlew publishToMavenLocal
|
||||||
|
|
||||||
- name: Sign Apk
|
- name: Upload maven local
|
||||||
if: ${{matrix.platform == 'android'}}
|
uses: actions/upload-artifact@v7
|
||||||
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:
|
with:
|
||||||
if-no-files-found: error
|
name: maven-local
|
||||||
name: ${{matrix.platform}}-${{matrix.arch}}
|
path: ~/.m2/repository/
|
||||||
path: ${{matrix.files}}
|
|
||||||
|
|
||||||
- name: Debug With SSH When fails
|
build-android:
|
||||||
if: ${{ failure() && inputs.debug && inputs.channel == 'nightly' }}
|
name: Android
|
||||||
uses: mxschmitt/action-tmate@v3
|
needs: prepare-deps
|
||||||
with:
|
timeout-minutes: 120
|
||||||
limit-access-to-actor: true
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
upload:
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
needs:
|
|
||||||
- build_platform
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
|
- name: Download maven local
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
path: ./Spotube-Release-Binaries
|
name: maven-local
|
||||||
|
path: ~/.m2/repository/
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Set up JDK 21
|
||||||
run: sudo apt-get install tree -y
|
uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 21
|
||||||
|
|
||||||
- name: Generate Checksums
|
- name: Set up Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v6
|
||||||
|
|
||||||
|
- name: Make gradlew executable
|
||||||
|
run: chmod +x gradlew
|
||||||
|
|
||||||
|
- name: Decode keystore
|
||||||
|
env:
|
||||||
|
KEYSTORE: ${{ secrets.KEYSTORE }}
|
||||||
run: |
|
run: |
|
||||||
tree .
|
echo "$KEYSTORE" | base64 --decode > "${{ github.workspace }}/composeApp/upload-keystore.jks"
|
||||||
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
|
- name: Configure Android signing
|
||||||
|
working-directory: composeApp
|
||||||
|
env:
|
||||||
|
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
||||||
|
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
|
||||||
|
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
echo "PUBSPEC_VERSION=$(grep -oP 'version:\s*\K[^+]+(?=\+)' pubspec.yaml)" >> $GITHUB_ENV
|
cat >> local.properties <<EOF
|
||||||
|
release.signing.storeFile=${{ github.workspace }}/composeApp/upload-keystore.jks
|
||||||
|
release.signing.storePassword=${KEYSTORE_PASSWORD}
|
||||||
|
release.signing.keyAlias=${KEYSTORE_KEY_ALIAS}
|
||||||
|
release.signing.keyPassword=${KEYSTORE_KEY_PASSWORD}
|
||||||
|
EOF
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- name: Assemble Release
|
||||||
|
run: |
|
||||||
|
if [ "${{ inputs.release_type }}" = "nightly" ]; then
|
||||||
|
./gradlew :composeApp:assembleNightlyRelease -Pnightly=true -PbuildNumber=${{ github.run_number }}
|
||||||
|
else
|
||||||
|
./gradlew :composeApp:assembleStableRelease
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Rename APK
|
||||||
|
run: |
|
||||||
|
APK_FILE=$(find composeApp/build/outputs/apk -path "*elease*" -name "*.apk" -type f | head -1)
|
||||||
|
cp "$APK_FILE" Spotube-android-all-arch.apk
|
||||||
|
|
||||||
|
- name: Upload APK
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
if-no-files-found: error
|
name: android-apk
|
||||||
name: sums
|
path: Spotube-android-all-arch.apk
|
||||||
path: |
|
|
||||||
RELEASE.md5sum
|
|
||||||
RELEASE.sha256sum
|
|
||||||
|
|
||||||
- name: Upload Release Binaries (stable)
|
- name: Setup tmate session on failure
|
||||||
if: ${{ !inputs.dry_run && inputs.channel == 'stable' }}
|
if: ${{ inputs.debug_ssh && failure() }}
|
||||||
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
|
uses: mxschmitt/action-tmate@v3
|
||||||
with:
|
with:
|
||||||
limit-access-to-actor: true
|
limit-access-to-actor: true
|
||||||
|
|
||||||
|
build-linux:
|
||||||
|
name: Linux Desktop
|
||||||
|
needs: prepare-deps
|
||||||
|
timeout-minutes: 120
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# Full history: the metainfo's release notes come from git-cliff
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Download maven local
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: maven-local
|
||||||
|
path: ~/.m2/repository/
|
||||||
|
|
||||||
|
- name: Install packaging tools
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y rpm fuse build-essential zlib1g-dev patchelf zstd
|
||||||
|
|
||||||
|
- name: Set up JDK 21
|
||||||
|
uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 21
|
||||||
|
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v6
|
||||||
|
|
||||||
|
- name: Make gradlew executable
|
||||||
|
run: chmod +x gradlew
|
||||||
|
|
||||||
|
- name: Cache GraalVM toolchain
|
||||||
|
uses: actions/cache@v6
|
||||||
|
with:
|
||||||
|
path: ~/.gradle/nucleus/graalvm
|
||||||
|
key: graalvm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('gradle/libs.versions.toml', 'composeApp/build.gradle.kts') }}
|
||||||
|
restore-keys: graalvm-${{ runner.os }}-${{ runner.arch }}-
|
||||||
|
|
||||||
|
- name: Package Linux
|
||||||
|
env:
|
||||||
|
# Nucleus lists GraalVM CE releases via the GitHub API; unauthenticated calls hit the 60/hour limit
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: ./gradlew :composeApp:packageGraalvmDeb :composeApp:packageGraalvmRpm -Pnightly=${{ inputs.release_type == 'nightly' }} -PbuildNumber=${{ github.run_number }}
|
||||||
|
|
||||||
|
# Portable tarball the AUR and Flathub packages install from. Like deb/rpm it uses the system's VLC,
|
||||||
|
# GTK and WebKitGTK, so it is packed from the distributable before the AppImage build replaces it
|
||||||
|
- name: Install git-cliff
|
||||||
|
uses: taiki-e/install-action@v2
|
||||||
|
with:
|
||||||
|
tool: git-cliff
|
||||||
|
|
||||||
|
- name: Package Linux tarball
|
||||||
|
run: |
|
||||||
|
if [ "${{ inputs.release_type }}" = "nightly" ]; then
|
||||||
|
VERSION=nightly
|
||||||
|
else
|
||||||
|
VERSION=$(./gradlew -q :composeApp:printVersion)
|
||||||
|
fi
|
||||||
|
# Desktop entry + metainfo, with the release history from git-cliff
|
||||||
|
./gradlew :composeApp:renderPackagingLinux -Pnightly=${{ inputs.release_type == 'nightly' }} -PbuildNumber=${{ github.run_number }}
|
||||||
|
packaging/package-linux-tarball.sh "$VERSION" "${{ inputs.release_type }}" .
|
||||||
|
|
||||||
|
- name: Upload tarball
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: linux-tarball
|
||||||
|
path: spotube-linux-*-x86_64.tar.xz
|
||||||
|
|
||||||
|
# Only the AppImage bundles VLC, GTK and WebKitGTK; deb/rpm depend on the distro packages
|
||||||
|
- name: Package Linux AppImage
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: ./gradlew :composeApp:packageGraalvmAppImage -PappImage=true -Pnightly=${{ inputs.release_type == 'nightly' }} -PbuildNumber=${{ github.run_number }}
|
||||||
|
|
||||||
|
- name: Rename Linux artifacts
|
||||||
|
run: |
|
||||||
|
DEB_FILE=$(find composeApp/build/compose/binaries/main/graalvm-deb -maxdepth 1 -name "*.deb" -type f | head -1)
|
||||||
|
RPM_FILE=$(find composeApp/build/compose/binaries/main/graalvm-rpm -maxdepth 1 -name "*.rpm" -type f | head -1)
|
||||||
|
cp "$DEB_FILE" Spotube-linux-x86_64.deb
|
||||||
|
cp "$RPM_FILE" Spotube-linux-x86_64.rpm
|
||||||
|
APPIMAGE_FILE=$(find composeApp/build/compose/binaries/main -name "*.AppImage" -type f | head -1)
|
||||||
|
cp "$APPIMAGE_FILE" Spotube-linux-x86_64.AppImage
|
||||||
|
|
||||||
|
- name: Upload DEB
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: linux-deb
|
||||||
|
path: Spotube-linux-x86_64.deb
|
||||||
|
|
||||||
|
- name: Upload RPM
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: linux-rpm
|
||||||
|
path: Spotube-linux-x86_64.rpm
|
||||||
|
|
||||||
|
- name: Upload AppImage
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: linux-appimage
|
||||||
|
path: Spotube-linux-x86_64.AppImage
|
||||||
|
|
||||||
|
- name: Setup tmate session on failure
|
||||||
|
if: ${{ inputs.debug_ssh && failure() }}
|
||||||
|
uses: mxschmitt/action-tmate@v3
|
||||||
|
with:
|
||||||
|
limit-access-to-actor: true
|
||||||
|
|
||||||
|
build-linux-arm64:
|
||||||
|
name: Linux Desktop (aarch64)
|
||||||
|
needs: prepare-deps
|
||||||
|
timeout-minutes: 120
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
steps:
|
||||||
|
# Full history: the metainfo's release notes come from git-cliff
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
# The arm64 runner image ships without an Android SDK/NDK, but :composeApp configuration needs both
|
||||||
|
# (Gobley's cargo plugin resolves the NDK directory for the Android Rust targets)
|
||||||
|
- name: Set up Android SDK
|
||||||
|
uses: android-actions/setup-android@v4
|
||||||
|
with:
|
||||||
|
packages: tools platform-tools ndk;28.2.13676358
|
||||||
|
|
||||||
|
- name: Download maven local
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: maven-local
|
||||||
|
path: ~/.m2/repository/
|
||||||
|
|
||||||
|
- name: Install packaging tools
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y rpm fuse build-essential zlib1g-dev patchelf zstd
|
||||||
|
|
||||||
|
- name: Set up JDK 21
|
||||||
|
uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 21
|
||||||
|
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v6
|
||||||
|
|
||||||
|
- name: Make gradlew executable
|
||||||
|
run: chmod +x gradlew
|
||||||
|
|
||||||
|
- name: Cache GraalVM toolchain
|
||||||
|
uses: actions/cache@v6
|
||||||
|
with:
|
||||||
|
path: ~/.gradle/nucleus/graalvm
|
||||||
|
key: graalvm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('gradle/libs.versions.toml', 'composeApp/build.gradle.kts') }}
|
||||||
|
restore-keys: graalvm-${{ runner.os }}-${{ runner.arch }}-
|
||||||
|
|
||||||
|
- name: Package Linux
|
||||||
|
env:
|
||||||
|
# Nucleus lists GraalVM CE releases via the GitHub API; unauthenticated calls hit the 60/hour limit
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: ./gradlew :composeApp:packageGraalvmDeb :composeApp:packageGraalvmRpm -Pnightly=${{ inputs.release_type == 'nightly' }} -PbuildNumber=${{ github.run_number }}
|
||||||
|
|
||||||
|
# Portable tarball the AUR and Flathub packages install from. Like deb/rpm it uses the system's VLC,
|
||||||
|
# GTK and WebKitGTK, so it is packed from the distributable before the AppImage build replaces it
|
||||||
|
- name: Install git-cliff
|
||||||
|
uses: taiki-e/install-action@v2
|
||||||
|
with:
|
||||||
|
tool: git-cliff
|
||||||
|
|
||||||
|
- name: Package Linux tarball
|
||||||
|
run: |
|
||||||
|
if [ "${{ inputs.release_type }}" = "nightly" ]; then
|
||||||
|
VERSION=nightly
|
||||||
|
else
|
||||||
|
VERSION=$(./gradlew -q :composeApp:printVersion)
|
||||||
|
fi
|
||||||
|
# Desktop entry + metainfo, with the release history from git-cliff
|
||||||
|
./gradlew :composeApp:renderPackagingLinux -Pnightly=${{ inputs.release_type == 'nightly' }} -PbuildNumber=${{ github.run_number }}
|
||||||
|
packaging/package-linux-tarball.sh "$VERSION" "${{ inputs.release_type }}" .
|
||||||
|
|
||||||
|
- name: Upload tarball
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: linux-tarball-arm64
|
||||||
|
path: spotube-linux-*-aarch64.tar.xz
|
||||||
|
|
||||||
|
# Only the AppImage bundles VLC, GTK and WebKitGTK; deb/rpm depend on the distro packages
|
||||||
|
- name: Package Linux AppImage
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: ./gradlew :composeApp:packageGraalvmAppImage -PappImage=true -Pnightly=${{ inputs.release_type == 'nightly' }} -PbuildNumber=${{ github.run_number }}
|
||||||
|
|
||||||
|
- name: Rename Linux artifacts
|
||||||
|
run: |
|
||||||
|
DEB_FILE=$(find composeApp/build/compose/binaries/main/graalvm-deb -maxdepth 1 -name "*.deb" -type f | head -1)
|
||||||
|
RPM_FILE=$(find composeApp/build/compose/binaries/main/graalvm-rpm -maxdepth 1 -name "*.rpm" -type f | head -1)
|
||||||
|
cp "$DEB_FILE" Spotube-linux-aarch64.deb
|
||||||
|
cp "$RPM_FILE" Spotube-linux-aarch64.rpm
|
||||||
|
APPIMAGE_FILE=$(find composeApp/build/compose/binaries/main -name "*.AppImage" -type f | head -1)
|
||||||
|
cp "$APPIMAGE_FILE" Spotube-linux-aarch64.AppImage
|
||||||
|
|
||||||
|
- name: Upload DEB
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: linux-deb-arm64
|
||||||
|
path: Spotube-linux-aarch64.deb
|
||||||
|
|
||||||
|
- name: Upload RPM
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: linux-rpm-arm64
|
||||||
|
path: Spotube-linux-aarch64.rpm
|
||||||
|
|
||||||
|
- name: Upload AppImage
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: linux-appimage-arm64
|
||||||
|
path: Spotube-linux-aarch64.AppImage
|
||||||
|
|
||||||
|
- name: Setup tmate session on failure
|
||||||
|
if: ${{ inputs.debug_ssh && failure() }}
|
||||||
|
uses: mxschmitt/action-tmate@v3
|
||||||
|
with:
|
||||||
|
limit-access-to-actor: true
|
||||||
|
|
||||||
|
build-windows:
|
||||||
|
name: Windows Desktop
|
||||||
|
needs: prepare-deps
|
||||||
|
timeout-minutes: 120
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: Download maven local
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: maven-local
|
||||||
|
path: ~/.m2/repository/
|
||||||
|
|
||||||
|
- name: Set up JDK 21
|
||||||
|
uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 21
|
||||||
|
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v6
|
||||||
|
|
||||||
|
# native-image links with MSVC
|
||||||
|
- name: Set up MSVC
|
||||||
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
|
||||||
|
- name: Cache GraalVM toolchain
|
||||||
|
uses: actions/cache@v6
|
||||||
|
with:
|
||||||
|
path: ~/.gradle/nucleus/graalvm
|
||||||
|
key: graalvm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('gradle/libs.versions.toml', 'composeApp/build.gradle.kts') }}
|
||||||
|
restore-keys: graalvm-${{ runner.os }}-${{ runner.arch }}-
|
||||||
|
|
||||||
|
- name: Package EXE
|
||||||
|
env:
|
||||||
|
# Nucleus lists GraalVM CE releases via the GitHub API; unauthenticated calls hit the 60/hour limit
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: ./gradlew :composeApp:packageGraalvmExe -Pnightly=${{ inputs.release_type == 'nightly' }} -PbuildNumber=${{ github.run_number }}
|
||||||
|
|
||||||
|
- name: Rename Windows artifacts
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
# Top level only: subfolders hold the unpacked app, and __* are electron-builder helpers
|
||||||
|
$EXE_FILE = Get-ChildItem -Path composeApp/build/compose/binaries/main/graalvm-exe -Filter "*.exe" |
|
||||||
|
Where-Object { $_.Name -notlike '__*' } | Select-Object -First 1
|
||||||
|
Copy-Item $EXE_FILE.FullName Spotube-windows-x86_64-setup.exe
|
||||||
|
|
||||||
|
- name: Upload EXE
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: windows-exe
|
||||||
|
path: Spotube-windows-x86_64-setup.exe
|
||||||
|
|
||||||
|
- name: Setup tmate session on failure
|
||||||
|
if: ${{ inputs.debug_ssh && failure() }}
|
||||||
|
uses: mxschmitt/action-tmate@v3
|
||||||
|
with:
|
||||||
|
limit-access-to-actor: true
|
||||||
|
|
||||||
|
build-macos:
|
||||||
|
name: macOS Desktop
|
||||||
|
needs: prepare-deps
|
||||||
|
timeout-minutes: 120
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: Download maven local
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: maven-local
|
||||||
|
path: ~/.m2/repository/
|
||||||
|
|
||||||
|
- name: Set up JDK 21
|
||||||
|
uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 21
|
||||||
|
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v6
|
||||||
|
|
||||||
|
- name: Make gradlew executable
|
||||||
|
run: chmod +x gradlew
|
||||||
|
|
||||||
|
- name: Cache GraalVM toolchain
|
||||||
|
uses: actions/cache@v6
|
||||||
|
with:
|
||||||
|
path: ~/.gradle/nucleus/graalvm
|
||||||
|
key: graalvm-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('gradle/libs.versions.toml', 'composeApp/build.gradle.kts') }}
|
||||||
|
restore-keys: graalvm-${{ runner.os }}-${{ runner.arch }}-
|
||||||
|
|
||||||
|
- name: Package DMG
|
||||||
|
env:
|
||||||
|
# Nucleus lists GraalVM CE releases via the GitHub API; unauthenticated calls hit the 60/hour limit
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: ./gradlew :composeApp:packageGraalvmDmg -Pnightly=${{ inputs.release_type == 'nightly' }} -PbuildNumber=${{ github.run_number }}
|
||||||
|
|
||||||
|
- name: Rename macOS artifact
|
||||||
|
run: |
|
||||||
|
DMG_FILE=$(find composeApp/build/compose/binaries/main/graalvm-dmg -maxdepth 1 -name "*.dmg" -type f | head -1)
|
||||||
|
cp "$DMG_FILE" Spotube-macos-universal.dmg
|
||||||
|
|
||||||
|
- name: Upload DMG
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: macos-dmg
|
||||||
|
path: Spotube-macos-universal.dmg
|
||||||
|
|
||||||
|
- name: Setup tmate session on failure
|
||||||
|
if: ${{ inputs.debug_ssh && failure() }}
|
||||||
|
uses: mxschmitt/action-tmate@v3
|
||||||
|
with:
|
||||||
|
limit-access-to-actor: true
|
||||||
|
|
||||||
|
create-release:
|
||||||
|
name: Create GitHub Release
|
||||||
|
if: ${{ !inputs.dry_run }}
|
||||||
|
needs:
|
||||||
|
- build-android
|
||||||
|
- build-linux
|
||||||
|
- build-linux-arm64
|
||||||
|
- build-windows
|
||||||
|
- build-macos
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
|
# The build resolves its plugins from mavenLocal, so Gradle needs the same setup as the build jobs
|
||||||
|
- name: Download maven local
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: maven-local
|
||||||
|
path: ~/.m2/repository/
|
||||||
|
|
||||||
|
- name: Set up JDK 21
|
||||||
|
uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 21
|
||||||
|
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v6
|
||||||
|
|
||||||
|
- name: Set release variables
|
||||||
|
id: vars
|
||||||
|
run: |
|
||||||
|
if [ "${{ inputs.release_type }}" = "stable" ]; then
|
||||||
|
chmod +x gradlew
|
||||||
|
VERSION=$(./gradlew -q :composeApp:printVersion)
|
||||||
|
TAG="v${VERSION}"
|
||||||
|
echo "is_prerelease=false" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "is_draft=true" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "release_name=Spotube ${TAG}" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
TAG="nightly"
|
||||||
|
VERSION="$(date +%Y-%m-%d)-${{ github.run_number }}"
|
||||||
|
echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "is_draft=false" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "release_name=Nightly ${VERSION}" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Download all artifacts
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
|
|
||||||
|
- name: Generate release notes
|
||||||
|
run: |
|
||||||
|
echo "## Downloads" > release-notes.md
|
||||||
|
echo "" >> release-notes.md
|
||||||
|
for dir in android-apk linux-deb linux-rpm linux-appimage linux-tarball linux-deb-arm64 linux-rpm-arm64 linux-appimage-arm64 linux-tarball-arm64 windows-exe macos-dmg; do
|
||||||
|
if [ -d "$dir" ]; then
|
||||||
|
echo "### $dir" >> release-notes.md
|
||||||
|
for f in "$dir"/*; do
|
||||||
|
echo "- \`$(basename "$f")\`" >> release-notes.md
|
||||||
|
done
|
||||||
|
echo "" >> release-notes.md
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# The rolling nightly tag already exists, and the release action never moves an existing tag
|
||||||
|
- name: Move nightly tag to this commit
|
||||||
|
if: ${{ inputs.release_type == 'nightly' }}
|
||||||
|
run: |
|
||||||
|
git tag -f nightly "$GITHUB_SHA"
|
||||||
|
git push -f origin refs/tags/nightly
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
uses: softprops/action-gh-release@v3
|
||||||
|
with:
|
||||||
|
tag_name: ${{ steps.vars.outputs.tag }}
|
||||||
|
# A new tag (stable) would otherwise point at the default branch instead of the built commit
|
||||||
|
target_commitish: ${{ github.sha }}
|
||||||
|
fail_on_unmatched_files: true
|
||||||
|
name: ${{ steps.vars.outputs.release_name }}
|
||||||
|
body_path: release-notes.md
|
||||||
|
draft: ${{ steps.vars.outputs.is_draft }}
|
||||||
|
prerelease: ${{ steps.vars.outputs.is_prerelease }}
|
||||||
|
files: |
|
||||||
|
android-apk/*.apk
|
||||||
|
linux-deb/*.deb
|
||||||
|
linux-rpm/*.rpm
|
||||||
|
linux-appimage/*.AppImage
|
||||||
|
linux-tarball/*.tar.xz
|
||||||
|
linux-deb-arm64/*.deb
|
||||||
|
linux-rpm-arm64/*.rpm
|
||||||
|
linux-appimage-arm64/*.AppImage
|
||||||
|
linux-tarball-arm64/*.tar.xz
|
||||||
|
windows-exe/*.exe
|
||||||
|
macos-dmg/*.dmg
|
||||||
|
|||||||
35
.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
|
# Miscellaneous
|
||||||
*.class
|
*.class
|
||||||
*.log
|
*.log
|
||||||
*.pyc
|
*.pyc
|
||||||
*.swp
|
*.swp
|
||||||
.DS_Store
|
|
||||||
.atom/
|
.atom/
|
||||||
.buildlog/
|
.buildlog/
|
||||||
.history
|
.history
|
||||||
@ -11,7 +36,6 @@
|
|||||||
|
|
||||||
|
|
||||||
# IntelliJ related
|
# IntelliJ related
|
||||||
*.iml
|
|
||||||
*.ipr
|
*.ipr
|
||||||
*.iws
|
*.iws
|
||||||
.idea/
|
.idea/
|
||||||
@ -84,3 +108,10 @@ tm.json
|
|||||||
|
|
||||||
android/build
|
android/build
|
||||||
android/app/.cxx
|
android/app/.cxx
|
||||||
|
|
||||||
|
/node_modules
|
||||||
|
/package.json
|
||||||
|
/package-lock.json
|
||||||
|
/bun.lock
|
||||||
|
|
||||||
|
**/target/
|
||||||
0
.gitmodules
vendored
Normal file
17
.mcp.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"mcpServers": {
|
||||||
|
"compose-hot-reload": {
|
||||||
|
"command": "./gradlew",
|
||||||
|
"args": [
|
||||||
|
"--no-daemon",
|
||||||
|
"--quiet",
|
||||||
|
"--console=plain",
|
||||||
|
"hotMcpServer"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"studio": {
|
||||||
|
"url": "http://127.0.0.1:64342/stream",
|
||||||
|
"type": "http"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
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'
|
|
||||||
21
.opencode/opencode.jsonc
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://opencode.ai/config.json",
|
||||||
|
"mcp": {
|
||||||
|
"compose-hot-reload": {
|
||||||
|
"enabled": true,
|
||||||
|
"disabled": false,
|
||||||
|
"type": "local",
|
||||||
|
"command": [
|
||||||
|
"./gradlew",
|
||||||
|
"--no-daemon",
|
||||||
|
"--quiet",
|
||||||
|
"--console=plain",
|
||||||
|
"hotMcpServer"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"studio": {
|
||||||
|
"url": "http://127.0.0.1:64342/stream",
|
||||||
|
"type": "remote"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
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": []
|
|
||||||
}
|
|
||||||
2
.vscode/settings.json
vendored
@ -1,4 +1,6 @@
|
|||||||
{
|
{
|
||||||
|
"gradle.autoDetect": "off",
|
||||||
|
"java.gradle.buildServer.enabled": "off",
|
||||||
"cmake.configureOnOpen": false,
|
"cmake.configureOnOpen": false,
|
||||||
"cSpell.words": [
|
"cSpell.words": [
|
||||||
"acousticness",
|
"acousticness",
|
||||||
|
|||||||
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": []
|
|
||||||
}
|
|
||||||
92
AGENTS.md
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
# 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/org/spotube/spotube/main.kt` (`mainClass = org.spotube.spotube.MainKt`).
|
||||||
|
- Android: `composeApp/src/androidMain/kotlin/org/spotube/spotube/MainActivity.kt`.
|
||||||
|
- iOS bridge: `composeApp/src/iosMain/kotlin/org/spotube/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:assembleStableDebug` (or `assembleNightlyDebug`). Android has `stable`/`nightly` product flavors (nightly = beta channel: `.nightly` applicationId suffix, own icons/name in `composeApp/src/nightly/res`). Desktop icons come from `composeApp/icons/{stable,nightly}`, chosen with `-Pnightly=true`.
|
||||||
|
- 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.4.21`, JVM target: `11` (compile/target compatibility in both `composeApp/build.gradle.kts` and `plugin_interfaces/build.gradle.kts`).
|
||||||
|
- **compose-webview (desktop) dispatcher hijack:** `dev.nucleusframework:composewebview` transitively pulls `nucleus.decorated-window-tao`, which registers a `TaoMainDispatcherFactory` (`loadPriority = 100`) via `META-INF/services` that hijacks `Dispatchers.Main` away from the Swing EDT. This breaks lifecycle's `enforceMainThreadIfNeeded` (window fails with "Method addObserver must be called on the main thread"). The app overrides it with `SwingMainDispatcherFactory` (`composeApp/src/jvmMain/.../core/coroutines/`, `loadPriority = Int.MAX_VALUE`) which pins `Dispatchers.Main` back to the Swing EDT. Keep that factory + its `META-INF/services/kotlinx.coroutines.internal.MainDispatcherFactory` resource; the long-term fix is in the webview (make the Tao dispatcher opt-in or lower its priority).
|
||||||
|
|
||||||
|
## Networking
|
||||||
|
- Never call `HttpClient(...)` directly. Inject `HttpClientFactory` (`commonMain/.../core/network/HttpClientFactory.kt`, a Koin single) and use `.default` / `.json` (shared, never close them) or `.create { ... }` for extra plugins (caller owns and may close it). It owns the one engine-backed client, so the platform default engine is used everywhere (Darwin on iOS, OkHttp on Android/desktop).
|
||||||
|
- Do not add `ktor-client-cio`: on iOS it competes with Darwin as the default engine and has no TLS on Kotlin/Native, so every HTTPS request fails.
|
||||||
|
|
||||||
|
## GraalVM native image (desktop)
|
||||||
|
- Enabled via `graalvm { }` inside `nucleus.application` in `composeApp/build.gradle.kts`. Nucleus downloads GraalVM CE itself (or uses `$GRAALVM_HOME`). Linux needs `gcc` + `patchelf`.
|
||||||
|
- Build: `:composeApp:createGraalvmNativeDistributable` (output `composeApp/build/compose/binaries/main/graalvm-app/`), installers via `packageGraalvm{Deb,Rpm,AppImage,Dmg,Msi,Exe}`. A build takes ~10 min and uses all cores and ~15 GB RAM.
|
||||||
|
- Hand-maintained + agent-recorded metadata lives in `composeApp/graalvm/reachability-metadata.json`. After adding features that use reflection/JNI/JNA (vlcj, Zipline, plugins), run `:composeApp:runWithNativeAgent`, exercise the feature, then close the window normally (the merge only happens on a clean exit).
|
||||||
|
- `uk.co.caprica.vlcj.binding.lib.LibVlc` must stay registered (`allDeclaredMethods` + `jniAccessible`): JNA direct mapping finds its `native` methods by reflection.
|
||||||
|
- The `*UberJarForCurrentOS` task excludes other OSes'/CPUs' native libs and stale CEF binaries, because native-image embeds every registered resource into the binary. On Linux, `copyGraalvmJvmSo` is disabled and `copyGraalvmAwtSoLibs` prefers native-image's own libs (10 KB `libjvm.so`/`libjava.so` shims instead of the JDK's 28 MB `libjvm.so`).
|
||||||
|
- `isProductionBuild` (top of `composeApp/build.gradle.kts`) is true for `package*`/`create*`/`notarize*`/`nativeImageCompile` tasks, or with `-Pproduction=true|false`. It gates the Rust release profile (Gobley `jvmVariant`) so `:composeApp:run` keeps fast debug Rust builds. Put new slow, ship-only optimizations behind it.
|
||||||
|
- Full user-facing build docs are in `README.md` ("Building from source").
|
||||||
|
|
||||||
|
## 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 = "org.spotube.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.
|
||||||
|
|
||||||
|
## UI component patterns
|
||||||
|
- **ALL user-facing strings MUST come from `composeApp/src/commonMain/composeResources/values/strings.xml` via `stringResource(Res.string.xxx)`.** Never hardcode a literal string in a `Text(...)`, dialog title, button label, content description, placeholder, or error message inside `@Composable` code. If the string you need doesn't exist yet, add a new `<string name="...">` entry to `strings.xml` (grouped near related keys, following the existing `feature_context_purpose` naming convention) and reference it — do not inline the text "just this once". This applies to every module, including ones you're about to add (dialogs, screens, snackbars, etc.), not just `modules/settings`. `strings.xml` is the single source of truth for copy, not a showcase file for one screen.
|
||||||
|
- **ViewModels own ALL state and logic.** Composables are dumb renderers: they collect a single `StateFlow<UiState>` from the ViewModel and forward user events (clicks, text input, drag callbacks) back to ViewModel functions. No business logic, filtering, derivation, reordering buffers, or `LaunchedEffect`-based state syncing belongs in a composable — it goes in the ViewModel. The `combine`/`stateIn` flow chain in the ViewModel must produce fully-computed, ready-to-render UI state so the composable never needs intermediate `remember` derivations or `mutableStateListOf` mirrors.
|
||||||
|
- **AdaptiveDropdownBottomSheet** (`commonMain/.../core/ui/component/AdaptiveDropdownBottomSheet.kt`): switches between `DropdownMenu` (large screen) and `ModalBottomSheet` (small screen) via `currentWindowAdaptiveInfo()`. Do NOT use expect/actual — all adaptive components that rely ONLY on Compose/Material3 APIs belong in commonMain.
|
||||||
|
- **AdaptiveDialogBottomSheet** (`commonMain/.../core/ui/component/AdaptiveDialogBottomSheet.kt`): switches between `ThemedDialog` (large screen) and `ModalBottomSheet` (small screen) via `currentWindowAdaptiveInfo()`. Same rule — keep in commonMain unless platform-specific APIs are required.
|
||||||
|
- Use `expect`/`actual` only when the component MUST use platform-specific APIs (e.g. `WindowState` for desktop window controls, native scrollbars). Pure Compose/Material3 adaptivity stays in commonMain.
|
||||||
|
- 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.
|
||||||
|
|
||||||
|
## Release workflow (`.github/workflows/release.yml`)
|
||||||
|
- Triggered by `workflow_dispatch` with a `release_type` choice input (`stable` | `nightly`).
|
||||||
|
- `prepare-deps` job checks out & publishes `kdroidFilter/ComposeNativeWebview` (compose-webview) to `mavenLocal`. The spotube gradle plugin and vlcj-bundler now come from Maven Central.
|
||||||
|
- Build jobs per platform (Android, Linux, Windows, macOS), all `needs: prepare-deps`. Desktop jobs ship GraalVM native installers (`packageGraalvm{Deb,Rpm,Exe,Dmg}`, output in `composeApp/build/compose/binaries/main/graalvm-<format>/`), not jpackage/JVM ones.
|
||||||
|
- **Stable**: reads `versionName` from `composeApp/build.gradle.kts`, tag = `v{version}`, draft release.
|
||||||
|
- **Nightly**: builds with `-PversionName=nightly`, tag = `nightly` (updates existing), prerelease.
|
||||||
|
- **Android signing**: decodes `secrets.KEYSTORE` (base64) → `composeApp/upload-keystore.jks`, writes signing config into `local.properties` from secrets.
|
||||||
|
- `create-release` job (depends on all builds) uses `softprops/action-gh-release@v2` to create the GitHub release with all artifacts attached.
|
||||||
|
|
||||||
|
## Package managers (`packaging/`, `.github/workflows/spotube-publish-binary.yml`)
|
||||||
|
- `packaging/<target>` (`linux`, `aur`, `flatpak`, `winget`, `chocolatey`) holds JMustache templates (`*.mustache`) plus files copied as is. `:composeApp:renderPackaging<Target>` renders them into `composeApp/build/packaging/<target>` (`RenderPackagingTask` in buildSrc documents the template data). Never hand-write versions, checksums or release notes into these files.
|
||||||
|
- Checksums come from release assets in `-PpackagingArtifactsDir=<dir>`; a template using a missing value fails the render. Release notes come from `git-cliff --context` with `cliff.toml` (`GitCliffContextTask`): needs `git-cliff` on the PATH and full git history. `gradle.properties` defaults to `nightly=true`, which leaves commits unreleased: pass `-Pnightly=false` for a stable render.
|
||||||
|
- `packaging/package-linux-tarball.sh` packs `spotube-linux-<version>-<arch>.tar.xz` (the AUR and Flathub source) from the GraalVM distributable and the rendered `linux` dir; the release workflow builds it before the AppImage step.
|
||||||
|
- The publish workflow (`workflow_dispatch`, input `tag`) renders once, then pushes to Flathub (`team-spotube/org.spotube.spotube`), the AUR (`spotube-bin`), WinGet (PR from `team-spotube/winget-pkgs`) and Chocolatey.
|
||||||
|
|
||||||
|
## OpenCode Agent MCP Execution Directives
|
||||||
|
|
||||||
|
### 1. Code Discovery & Context Search
|
||||||
|
- Use `android-studio-mcp` search/symbol tools to locate declarations before making edits across `:composeApp`, `:plugin_interfaces`, or `:js_plugin_example`[cite: 1, 2].
|
||||||
|
- Keep `gradle/libs.versions.toml` as the single source of truth for dependencies and version updates.
|
||||||
|
|
||||||
|
### 2. UI Architecture Constraints
|
||||||
|
- **Strict ViewModel Separation:** UI composables in `commonMain` must only collect `StateFlow<UiState>` and emit event callbacks. Do NOT write business logic, filtering, or `mutableStateListOf` directly inside `@Composable` functions.
|
||||||
|
- **Adaptive Components:** Use `AdaptiveDropdownBottomSheet` or `AdaptiveDialogBottomSheet` inside `commonMain` for adaptive layouts[cite: 2]. Do NOT create platform-specific `expect/actual` variants unless platform-native APIs (like windowing or native scrollbars) are explicitly required[cite: 2].
|
||||||
|
|
||||||
|
### 3. Verification & Diagnostic Loops
|
||||||
|
- **Post-Edit Verification:** After editing Kotlin code, validate compilation by running `./gradlew :composeApp:check` or `./gradlew :composeApp:assembleStableDebug` via MCP[cite: 2].
|
||||||
|
- **Dispatcher Integrity:** Never remove or bypass `SwingMainDispatcherFactory` in `composeApp/src/jvmMain/.../core/coroutines/`[cite: 2]. It is required to prevent `compose-webview` from hijacking `Dispatchers.Main` away from the Swing EDT[cite: 2].
|
||||||
|
- **Live Preview Iteration:** Use `compose-hot-reload` to evaluate UI layout changes headlessly without forcing full Gradle rebuilds.
|
||||||
1532
CHANGELOG.md
@ -30,19 +30,19 @@ All types of contributions are encouraged and valued. See the [Table of Contents
|
|||||||
## Code of Conduct
|
## Code of Conduct
|
||||||
|
|
||||||
This project and everyone participating in it is governed by the
|
This project and everyone participating in it is governed by the
|
||||||
[Spotube Code of Conduct](https://github.com/KRTirtho/spotube/blob/master/CODE_OF_CONDUCT.md).
|
[Spotube Code of Conduct](https://github.com/team-spotube/spotube/blob/master/CODE_OF_CONDUCT.md).
|
||||||
By participating, you are expected to uphold this code. Please report unacceptable behavior
|
By participating, you are expected to uphold this code. Please report unacceptable behavior
|
||||||
to krtirtho@gmail.com.
|
to team.spotube@proton.me.
|
||||||
|
|
||||||
## I Have a Question
|
## I Have a Question
|
||||||
|
|
||||||
> If you want to ask a question, we assume that you have read the available [Documentation](https://github.com/KRTirtho/spotube#readme).
|
> If you want to ask a question, we assume that you have read the available [Documentation](https://github.com/team-spotube/spotube#readme).
|
||||||
|
|
||||||
Before you ask a question, it is best to search for existing [Issues](https://github.com/KRTirtho/spotube/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first.
|
Before you ask a question, it is best to search for existing [Issues](https://github.com/team-spotube/spotube/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first.
|
||||||
|
|
||||||
If you then still feel the need to ask a question and need clarification, we recommend the following:
|
If you then still feel the need to ask a question and need clarification, we recommend the following:
|
||||||
|
|
||||||
- Open an [Discussion](https://github.com/KRTirtho/spotube/discussions/new) with the question label.
|
- Open an [Discussion](https://github.com/team-spotube/spotube/discussions/new) with the question label.
|
||||||
- Provide as much context as you can about what you're running into.
|
- Provide as much context as you can about what you're running into.
|
||||||
- Provide project and platform versions (flutter, dart, pub, linux etc..), depending on what seems relevant.
|
- Provide project and platform versions (flutter, dart, pub, linux etc..), depending on what seems relevant.
|
||||||
|
|
||||||
@ -61,8 +61,8 @@ We will then take care of the issue as soon as possible.
|
|||||||
A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.
|
A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.
|
||||||
|
|
||||||
- Make sure that you are using the latest version.
|
- Make sure that you are using the latest version.
|
||||||
- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://github.com/KRTirtho/spotube#readme). If you are looking for support, you might want to check [this section](#i-have-a-question)).
|
- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://github.com/team-spotube/spotube#readme). If you are looking for support, you might want to check [this section](#i-have-a-question)).
|
||||||
- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/KRTirtho/spotubeissues?q=label%3Abug).
|
- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/team-spotube/spotube/issues?q=label%3Abug).
|
||||||
- Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue.
|
- Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue.
|
||||||
- Collect information about the bug:
|
- Collect information about the bug:
|
||||||
- Stack trace (Traceback)
|
- Stack trace (Traceback)
|
||||||
@ -77,7 +77,7 @@ A good bug report shouldn't leave others needing to chase you up for more inform
|
|||||||
|
|
||||||
We use GitHub issues to track bugs and errors. If you run into an issue with the project:
|
We use GitHub issues to track bugs and errors. If you run into an issue with the project:
|
||||||
|
|
||||||
- Open an [Issue](https://github.com/KRTirtho/spotube/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
|
- Open an [Issue](https://github.com/team-spotube/spotube/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
|
||||||
- Explain the behavior you would expect and the actual behavior.
|
- Explain the behavior you would expect and the actual behavior.
|
||||||
- Please provide as much context as possible and describe the _reproduction steps_ that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
|
- Please provide as much context as possible and describe the _reproduction steps_ that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
|
||||||
- Provide the information you collected in the previous section.
|
- Provide the information you collected in the previous section.
|
||||||
@ -97,15 +97,15 @@ This section guides you through submitting an enhancement suggestion for Spotube
|
|||||||
#### Before Submitting an Enhancement
|
#### Before Submitting an Enhancement
|
||||||
|
|
||||||
- Make sure that you are using the latest version.
|
- Make sure that you are using the latest version.
|
||||||
- Read the [documentation](https://github.com/KRTirtho/spotube#readme) carefully and find out if the functionality is already covered, maybe by an individual configuration.
|
- Read the [documentation](https://github.com/team-spotube/spotube#readme) carefully and find out if the functionality is already covered, maybe by an individual configuration.
|
||||||
- Perform a [search](https://github.com/KRTirtho/spotube/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
|
- Perform a [search](https://github.com/team-spotube/spotube/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
|
||||||
- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset
|
- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset
|
||||||
|
|
||||||
<!-- omit in toc -->
|
<!-- omit in toc -->
|
||||||
|
|
||||||
#### How Do I Submit a Good Enhancement Suggestion?
|
#### How Do I Submit a Good Enhancement Suggestion?
|
||||||
|
|
||||||
Enhancement suggestions are tracked as [GitHub issues](https://github.com/KRTirtho/spotube/issues).
|
Enhancement suggestions are tracked as [GitHub issues](https://github.com/team-spotube/spotube/issues).
|
||||||
|
|
||||||
- Use a **clear and descriptive title** for the issue to identify the suggestion.
|
- Use a **clear and descriptive title** for the issue to identify the suggestion.
|
||||||
- Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
|
- Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
|
||||||
|
|||||||
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.
|
The GNU Affero General Public License is a free, copyleft license for
|
||||||
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.
|
software and other kinds of works, specifically designed to ensure
|
||||||
3. All advertising materials mentioning features or use of this software must display the following acknowledgement:
|
cooperation with the community in the case of network server software.
|
||||||
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.
|
The licenses for most software and other practical works are designed
|
||||||
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.
|
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
|
|
||||||
@ -59,4 +59,4 @@ This policy is effective as of 2022-04-01
|
|||||||
|
|
||||||
**Contact Us**
|
**Contact Us**
|
||||||
|
|
||||||
If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at krtirtho@gmail.com.
|
If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at team.spotube@proton.me
|
||||||
408
README.md
@ -4,9 +4,7 @@
|
|||||||
A cross-platform extensible open-source music streaming platform.<br>
|
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!
|
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!
|
||||||
|
|
||||||
Btw it's not just another Electron app 😉
|
<a href="https://spotube.org"><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://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>
|
<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>
|
||||||
|
|
||||||
<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://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>
|
||||||
@ -37,298 +35,148 @@ Btw it's not just another Electron app 😉
|
|||||||
- 📖 Open source/libre software.
|
- 📖 Open source/libre software.
|
||||||
- 🔉 Playback control is done locally, not on the server.
|
- 🔉 Playback control is done locally, not on the server.
|
||||||
|
|
||||||
## 📜 ⬇️ Installation guide
|
### ⬇️ Download
|
||||||
|
|
||||||
New versions usually release every 3-4 months.<br />
|
Download Spotube from the Official Website: https://spotube.org
|
||||||
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
|
### 🔄 Nightly Builds
|
||||||
|
|
||||||
Grab the latest nightly builds of Spotube [from the GitHub Releases](https://github.com/KRTirtho/spotube/releases/tag/nightly).
|
Grab the latest nightly builds of Spotube [from the Offical Website](https://spotube.org/downloads/nightly).
|
||||||
|
|
||||||
## 🕳️ Building from source
|
## 🕳️ 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>
|
<a href="https://github.com/team-spotube/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).
|
Spotube is a Kotlin Multiplatform + Compose Multiplatform app. The desktop app is built with the [Nucleus](https://nucleusframework.dev) Gradle plugin and released as a **GraalVM native image**: an ahead-of-time compiled binary that needs no JVM installed.
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
- **JDK 21** to run Gradle. The Gradle daemon JDK and the GraalVM toolchain are provisioned automatically.
|
||||||
|
- **Rust** (`rustup` + `cargo`). The `composeApp` Rust library is built through [Gobley](https://gobley.dev).
|
||||||
|
- **Android SDK**, only for Android builds.
|
||||||
|
- **Unpublished dependency.** One dependency isn't on Maven Central yet. Clone it and run `./gradlew publishToMavenLocal` in it:
|
||||||
|
- [kdroidFilter/ComposeNativeWebview](https://github.com/kdroidFilter/ComposeNativeWebview), at the commit pinned in [`spotube-release-binary.yml`](.github/workflows/spotube-release-binary.yml) (`COMPOSE_WEBVIEW_COMMIT`)
|
||||||
|
- **Linux runtime libraries** (needed to run the app, including `:composeApp:run`). The `.deb`/`.rpm` install these as dependencies from your distro. For a source build, install them yourself, **including VLC**. Only the `.AppImage` is self-contained (it bundles VLC, GTK 3 and WebKitGTK, and uses just the host's glibc, graphics, X11 and sound libraries):
|
||||||
|
|
||||||
|
| Distro | Command |
|
||||||
|
|---|---|
|
||||||
|
| Debian/Ubuntu | `sudo apt-get install libvlc5 vlc-plugin-base libwebkit2gtk-4.1-0 libgtk-3-0 libasound2 libgl1 libxtst6 libxi6 libxrender1` |
|
||||||
|
| Fedora | `sudo dnf install vlc-libs webkit2gtk4.1 gtk3 alsa-lib mesa-libGL libXtst libXi libXrender`. `vlc-libs` is only in [RPM Fusion](https://rpmfusion.org/Configuration), so enable it first. |
|
||||||
|
| Arch / CachyOS / Manjaro | `sudo pacman -S vlc webkit2gtk-4.1 gtk3 alsa-lib libglvnd libxtst libxi libxrender` |
|
||||||
|
| openSUSE | `sudo zypper install libvlc5 libwebkit2gtk-4_1-0 libgtk-3-0 libasound2 Mesa-libGL1 libXtst6 libXi6 libXrender1` (for wide codec support, switch to the [Packman](https://en.opensuse.org/Additional_package_repositories#Packman) repo's VLC) |
|
||||||
|
|
||||||
|
Arch-based distros and openSUSE have no native package here. Use the `.AppImage`. The `.rpm` is built with Fedora package names, so it won't resolve on openSUSE.
|
||||||
|
|
||||||
|
On Ubuntu 24.04+/Debian 13 `libgtk-3-0` and `libasound2` are named `libgtk-3-0t64` and `libasound2t64`; apt resolves this automatically.
|
||||||
|
|
||||||
|
Always use the Gradle wrapper (`./gradlew`, or `gradlew.bat` on Windows).
|
||||||
|
|
||||||
|
### Development
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./gradlew :composeApp:run # desktop (JVM), fastest edit/run loop
|
||||||
|
./gradlew :composeApp:assembleStableDebug # Android debug APK (or assembleNightlyDebug)
|
||||||
|
```
|
||||||
|
|
||||||
|
Development builds stay fast. The release-only optimizations (the Rust release profile with LTO and symbol stripping, the native image, native-library pruning) are only applied when you build something to ship. See [Production vs development builds](#production-vs-development-builds).
|
||||||
|
|
||||||
|
### Building the desktop app (GraalVM native image)
|
||||||
|
|
||||||
|
#### Native toolchain
|
||||||
|
|
||||||
|
[Nucleus downloads and caches GraalVM CE](https://nucleusframework.dev/en/docs/performance/graalvm/) under `~/.gradle/nucleus/graalvm` on the first native build. Set `GRAALVM_HOME` to use your own GraalVM instead. Each OS also needs a native C toolchain:
|
||||||
|
|
||||||
|
| OS | Requirements |
|
||||||
|
|---|---|
|
||||||
|
| Linux | `gcc`, `zlib` headers, `patchelf`; plus `rpm` for `.rpm` packages, `fuse` for `.AppImage`, and, for the AppImage's bundled libraries, `zstd` (plus `ar`/`tar` and `readelf`, from binutils). Debian/Ubuntu: `sudo apt-get install build-essential zlib1g-dev patchelf rpm fuse zstd`. Fedora: `sudo dnf install gcc zlib-devel patchelf rpm-build fuse zstd` (also install the [Linux runtime libraries](#prerequisites) to run what you build) |
|
||||||
|
| macOS | Xcode Command Line Tools (`xcode-select --install`) |
|
||||||
|
| Windows | Visual Studio Build Tools with the "Desktop development with C++" workload. Build from an "x64 Native Tools" prompt if `native-image` can't find MSVC. |
|
||||||
|
|
||||||
|
A native build is a whole-program compile. It takes **about 10 minutes**, uses **every CPU core**, and peaks at roughly **15 GB of RAM** (it gets slower, not broken, with less). That only happens for the native tasks below, never for `run`.
|
||||||
|
|
||||||
|
#### Build and run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# App folder: binary + its native libs, in composeApp/build/compose/binaries/main/graalvm-app/
|
||||||
|
./gradlew :composeApp:createGraalvmNativeDistributable
|
||||||
|
|
||||||
|
# Run that folder's binary directly
|
||||||
|
./composeApp/build/compose/binaries/main/graalvm-app/org.spotube.spotube/spotube
|
||||||
|
|
||||||
|
# Or build and launch in one step
|
||||||
|
./gradlew :composeApp:runGraalvmNativeDistributable
|
||||||
|
```
|
||||||
|
|
||||||
|
Keep the `spotube` binary next to the `.so`/`.dll`/`lib/` files it was built with; it loads them from its own folder.
|
||||||
|
|
||||||
|
#### Installers
|
||||||
|
|
||||||
|
Each OS can only build its own installers:
|
||||||
|
|
||||||
|
| OS | Command | Output |
|
||||||
|
|---|---|---|
|
||||||
|
| Linux | `./gradlew :composeApp:packageGraalvmDeb :composeApp:packageGraalvmRpm`, then `./gradlew :composeApp:packageGraalvmAppImage -PappImage=true` | `composeApp/build/compose/binaries/main/graalvm-{deb,rpm,appimage}/` |
|
||||||
|
| Windows | `./gradlew :composeApp:packageGraalvmExe` (or `packageGraalvmMsi`) | `composeApp/build/compose/binaries/main/graalvm-exe/` |
|
||||||
|
| macOS | `./gradlew :composeApp:packageGraalvmDmg` | `composeApp/build/compose/binaries/main/graalvm-dmg/` |
|
||||||
|
|
||||||
|
Add `-Pnightly=true` for the nightly channel (separate icons and name).
|
||||||
|
|
||||||
|
The `.deb` and `.rpm` use your distro's shared libraries and declare them as dependencies, so the package manager installs them (on Fedora, `vlc-libs` needs RPM Fusion enabled). The `.AppImage` is the self-contained one: it bundles VLC, GTK 3 and WebKitGTK (see [What the AppImage bundles](#what-the-appimage-bundles)).
|
||||||
|
|
||||||
|
#### What the AppImage bundles
|
||||||
|
|
||||||
|
Build it with `./gradlew :composeApp:packageGraalvmAppImage -PappImage=true`. Without `-PappImage=true` nothing is bundled and the app uses the system libraries, which is what the `.deb`/`.rpm` and `:composeApp:run` do.
|
||||||
|
|
||||||
|
The bundle follows the [AppImage exclude list](https://github.com/AppImageCommunity/pkg2appimage/blob/master/excludelist) and what Tauri apps ship. It carries VLC (audio-only, from the [vlcj-bundler](https://github.com/team-spotube/vlcj-bundler-gradle-plugin) plugin's `bundleVlc` option), GTK 3, WebKitGTK 4.1, GLib/GIO, pango/cairo and their dependencies, plus glib-networking for HTTPS in the webview. It leaves the host's glibc, `libstdc++`, `libz`, GL/EGL/DRM, X11/xcb, ALSA, fontconfig/freetype/harfbuzz and the Wayland libraries alone, so the host's graphics, display and sound stack is used. Everything is taken from the Ubuntu 24.04 archive, so the AppImage needs glibc 2.38 or newer.
|
||||||
|
|
||||||
|
How it works, in short:
|
||||||
|
- [`DownloadLinuxGtkBundleTask`](buildSrc/src/main/kotlin/org/spotube/gradle/DownloadLinuxGtkBundleTask.kt) downloads the packages, keeps the libraries reachable from GTK/WebKit and relocates them with `patchelf`. Needs `ar`, `tar`, `zstd`, `readelf` and `patchelf`.
|
||||||
|
- WebKitGTK has its helper-process path compiled in, so the library is patched to look relative to the working directory, and at startup the app moves there ([`AppImageEnvironment`](composeApp/src/jvmMain/kotlin/org/spotube/spotube/core/appimage/AppImageEnvironment.kt)). It also points `GIO_EXTRA_MODULES` at the bundled TLS module and sets `WEBKIT_DISABLE_DMABUF_RENDERER=1`, because the bundled WebKitGTK 2.44's dmabuf renderer never paints (or aborts) against a newer host Mesa/compositor. The display backend is left alone: forcing X11 doesn't help, since the webview doesn't paint on XWayland either.
|
||||||
|
- Startup order matters: `main()` calls `GraalVmInitializer.initialize()` first, since the VLC loader and the environment setup read `compose.application.resources.dir`.
|
||||||
|
|
||||||
|
#### Reflection metadata (when a feature breaks only in the native build)
|
||||||
|
|
||||||
|
A native image is a closed world: anything the app reaches through reflection, JNI or JNA (vlcj, the Zipline/QuickJS plugin engine, NewPipe, ktor, datastore, …) must be declared at build time. Nucleus generates most of this automatically. The rest is in [`composeApp/graalvm/reachability-metadata.json`](composeApp/graalvm/reachability-metadata.json).
|
||||||
|
|
||||||
|
If something works in `:composeApp:run` but throws `ClassNotFoundException`, `NoSuchMethodException`, `MissingReflectionRegistrationError` or similar in the native binary, record what's missing:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./gradlew :composeApp:runWithNativeAgent
|
||||||
|
```
|
||||||
|
|
||||||
|
The app starts on the JVM with GraalVM's tracing agent attached. Use the broken feature (and anything near it), then **close the window normally**: the recorded entries are merged into `composeApp/graalvm/` only on a clean exit, not with Ctrl+C. Commit the updated JSON and rebuild the native image.
|
||||||
|
|
||||||
|
`./gradlew :composeApp:runGraalvmNative` gives a faster debugging loop: a quick-build (`-Ob`) native image that reports exactly which registration is missing.
|
||||||
|
|
||||||
|
Keep the hand-written `uk.co.caprica.vlcj.binding.lib.LibVlc` entry. JNA's direct mapping looks up its `native` methods through reflection, and without the entry, playback fails to initialize.
|
||||||
|
|
||||||
|
### Production vs development builds
|
||||||
|
|
||||||
|
Production mode is switched on automatically when you ask Gradle for a shippable artifact: any `package*`, `create*`, `notarize*` or `nativeImageCompile` task. You can force it either way with `-Pproduction=true` or `-Pproduction=false`.
|
||||||
|
|
||||||
|
| | Development (`run`, debug builds) | Production (installers, native image) |
|
||||||
|
|---|---|---|
|
||||||
|
| Rust library (desktop) | `debug` profile, fast incremental compile | `release` profile with LTO, single codegen unit, stripped (31 MB → 1.8 MB) |
|
||||||
|
| Desktop app | JVM, hot-reloadable | GraalVM native image, `-Os` (size-optimized) |
|
||||||
|
| Native libraries | everything on the classpath | only the host OS/CPU's natives; other OSes' and CPUs' libraries are pruned from the uber JAR the image is compiled from |
|
||||||
|
| Skia (Skiko) | extracted from the JAR | loaded from `lib/` next to the binary, not embedded a second time |
|
||||||
|
| JDK runtime libs (Linux) | n/a | native-image's ~10 KB `libjvm.so`/`libjava.so` shims instead of the JDK's (28 MB `libjvm.so`) |
|
||||||
|
|
||||||
|
Android picks the Rust profile from its build type (`debug` or `release`) on its own.
|
||||||
|
|
||||||
|
### Releases
|
||||||
|
|
||||||
|
Releases are built by [`spotube-release-binary.yml`](.github/workflows/spotube-release-binary.yml), run manually (`workflow_dispatch`) as `stable` or `nightly`. Each desktop platform (Linux x86_64 and aarch64, Windows, macOS) builds its native installers on its own runner. Android builds a signed APK.
|
||||||
|
|
||||||
## 👥 The Spotube team
|
## 👥 The Spotube team
|
||||||
|
|
||||||
- [Kingkor Roy Tirtho](https://github.com/KRTirtho) - The Founder, Maintainer and Lead Developer
|
- [Kingkor Roy Tirtho](https://github.com/team-spotube) - The Founder, Maintainer and Lead Developer
|
||||||
- [Owen Connor](https://github.com/owencz1998) - The Cool Discord Moderator
|
- [Owen Connor](https://github.com/owencz1998) - The Cool Discord Moderator
|
||||||
- [Piotr Rogowski](https://github.com/karniv00l) - The MacOS Developer
|
- [Piotr Rogowski](https://github.com/karniv00l) - The MacOS Developer
|
||||||
- [Rusty Apple](https://github.com/RustyApple) - The Mysterious Unknown Guy
|
- [Rusty Apple](https://github.com/RustyApple) - The Mysterious Unknown Guy
|
||||||
|
|
||||||
## 💼 License
|
## 💼 License
|
||||||
|
|
||||||
Spotube is open source and licensed under the [BSD-4-Clause](/LICENSE) License.
|
Spotube is open source and licensed under the [AGPL-3.0-or-later](/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).
|
<div align="center"><h4>© Copyright Spotube 2026</h4></div>
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|||||||
@ -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>
|
|
||||||
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 23 KiB |
@ -1,23 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
|
||||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
|
||||||
<item name="android:forceDarkAllowed">false</item>
|
|
||||||
<item name="android:windowFullscreen">false</item>
|
|
||||||
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
|
|
||||||
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
|
|
||||||
<item name="android:windowSplashScreenBackground">#000000</item>
|
|
||||||
<item name="android:windowSplashScreenBrandingImage">@drawable/android12branding</item>
|
|
||||||
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
|
|
||||||
<item name="android:windowSplashScreenIconBackgroundColor">#000000</item>
|
|
||||||
</style>
|
|
||||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
|
||||||
This theme determines the color of the Android Window while your
|
|
||||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
|
||||||
running.
|
|
||||||
|
|
||||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
|
||||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
|
||||||
<item name="android:windowBackground">?android:colorBackground</item>
|
|
||||||
</style>
|
|
||||||
</resources>
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
|
|
||||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
|
||||||
<!-- Show a splash screen on the activity. Automatically removed when
|
|
||||||
Flutter draws its first frame -->
|
|
||||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
|
||||||
<item name="android:forceDarkAllowed">false</item>
|
|
||||||
<item name="android:windowFullscreen">false</item>
|
|
||||||
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
|
|
||||||
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
|
|
||||||
</style>
|
|
||||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
|
||||||
This theme determines the color of the Android Window while your
|
|
||||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
|
||||||
running.
|
|
||||||
|
|
||||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
|
||||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
|
||||||
<item name="android:windowBackground">?android:colorBackground</item>
|
|
||||||
</style>
|
|
||||||
</resources>
|
|
||||||