Skip to content

Commit

Permalink
feat(windows): show nuget download info explicitely in verbose mode (#…
Browse files Browse the repository at this point in the history
…1449)

# Description

The standard cmake message command prints to `stderr`. So it prints
`Nuget.exe not found, trying to download or use cached version.`, when
building an audioplayers app, which is confusing, as nothing went wrong.
The `STATUS` keyword changes it to `stdout`, which can be accessed via
the `flutter --verbose` command.
Also: 
- updated the `nuget` package to `v6.5.0`
- updated the docs on how to setup Windows and Linux. The paths could
change again, once there are individual READMEs for each platform.

Closes #1303
  • Loading branch information
Gustl22 committed Mar 23, 2023
1 parent 734c6ec commit 136028f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
7 changes: 5 additions & 2 deletions getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ This tutorial should help you get started with the audioplayers library, coverin

In order to install this package, add the [latest version](pub.dev/packages/audioplayers) of `audioplayers` to your `pubspec.yaml` file. This packages uses [the Federated Plugin](https://docs.flutter.dev/development/packages-and-plugins/developing-packages) guidelines to support multiple platforms, so it should just work on all supported platforms your app is built for without any extra configuration. You should not need to add the `audioplayers_*` packages directly.

## Build Requirements
## Setup Platforms

Audioplayers for Linux (`audioplayers_linux`) is the only platform implementation which relies on additional dependencies. You need to fulfill [these requirements](packages/audioplayers_linux/requirements.md).
For building and running for certain platforms you need pay attention to additional steps:

* [Linux Setup](packages/audioplayers_linux/setup.md) (`audioplayers_linux`).
* [Windows Setup](packages/audioplayers_windows/setup.md) (`audioplayers_windows`).

## AudioPlayer

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Requirements for Linux
# Setup for Linux

## Debian

### Dev Dependencies

[Flutter](https://docs.flutter.dev/get-started/install/linux#additional-linux-requirements) dependencies:
[Flutter](https://docs.flutter.dev/get-started/install/linux#linux-setup) dependencies:

```bash
sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
Expand Down
5 changes: 5 additions & 0 deletions packages/audioplayers_windows/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Setup for Windows

Please follow the Flutter guide to [set up Flutter on Windows](https://docs.flutter.dev/get-started/install/windows#windows-setup).

Optionally you can add the individual component `NuGet package manager` inside **Visual Studio** or **Visual Studio Build Tools**, otherwise it will be downloaded while building.
6 changes: 3 additions & 3 deletions packages/audioplayers_windows/windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ include(FetchContent)
set(PLUGIN_NAME "${PROJECT_NAME}_plugin")

FetchContent_Declare(nuget
URL "https://dist.nuget.org/win-x86-commandline/v6.0.0/nuget.exe"
URL_HASH SHA256=04eb6c4fe4213907e2773e1be1bbbd730e9a655a3c9c58387ce8d4a714a5b9e1
URL "https://dist.nuget.org/win-x86-commandline/v6.5.0/nuget.exe"
URL_HASH SHA256=d5fce5185de92b7356ea9264b997a620e35c6f6c3c061e471e0dc3a84b3d74fd
DOWNLOAD_NO_EXTRACT true
)

find_program(NUGET nuget)
if (NOT NUGET)
message("Nuget.exe not found, trying to download or use cached version.")
message(STATUS "Nuget.exe not found, trying to download or use cached version.")
FetchContent_MakeAvailable(nuget)
set(NUGET ${nuget_SOURCE_DIR}/nuget.exe)
endif()
Expand Down
8 changes: 6 additions & 2 deletions troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ flutter pub get
1. If the problem still persists, and no existing (open or closed) issue on this repo, no stack overflow question or existing discord discussion solves you problem, then you can open an issue. But you must follow the issue template, and refer to the problem on the example app (or start with its code and make only the necessary modifications to trigger the issue), not on your own app that we don't have access (because since step 2 the error must be reproducible on the example app).
1. Again, only open an issue if you reached step 3 and follow the issue template closely. Build issues that do not follow these steps will be closed without warning.

### [Linux] Build Requirements
In order to use the package `audioplayers_linux` you need to fulfill [these requirements](packages/audioplayers_linux/requirements.md).
### Build Requirements

Some platforms need additional requirements to be fulfilled:

* [Linux](packages/audioplayers_linux/setup.md) (`audioplayers_linux`).
* [Windows](packages/audioplayers_windows/setup.md) (`audioplayers_windows`).

## [iOS] Background Audio

Expand Down

0 comments on commit 136028f

Please sign in to comment.