Skip to content

Commit

Permalink
Chore/update libraries (#205)
Browse files Browse the repository at this point in the history
* Update libraries

* Running automated script

* Update example app

* remove env

* update dependabot config

* add release workflow

* update release flow
  • Loading branch information
brim-borium authored Nov 19, 2023
1 parent 9cf5b94 commit 529036c
Show file tree
Hide file tree
Showing 20 changed files with 104 additions and 40 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "pub"
directory: "/example" # Location of package manifests in the example directory
schedule:
interval: "weekly"
File renamed without changes.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish to pub.dev
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*" # tag-pattern on pub.dev: ''

jobs:
pana:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2

- name: Install Dependencies
run: |
flutter packages get
flutter pub global activate pana
sudo apt-get install webp
- name: Verify Pub Score
run: ./.github/scripts/verify_pub_score.sh

publish:
needs: pana
permissions:
id-token: write # Required for authentication using OIDC
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
# Specify the github actions deployment environment
environment: pub.dev
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 3.0.0-dev.3
* Fix: prevent multiple iOS initializations (#203)
* Chore: Update libraries (#202)
* Feat: Automatic setup of the android integration of the spotify_sdk (#204)

## 3.0.0-dev.2
* Feat: add set podcastPlaybackSpeed and switchToLocalDevice for android (#160)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# spotify_sdk

<p align="center">
<a href="https://pub.dev/packages/spotify_sdk"><img src="https://img.shields.io/badge/pub-3.0.0.dev.2-orange" alt="build"></a>
<a href="https://pub.dev/packages/spotify_sdk"><img src="https://img.shields.io/badge/pub-3.0.0.dev.3-orange" alt="build"></a>
<a href="https://github.com/brim-borium/spotify_sdk"><img src="https://img.shields.io/github/stars/brim-borium/spotify_sdk?color=deeppink" alt="build"></a>
<a href="https://github.com/brim-borium/spotify_sdk/actions?query=workflow%3Aspotify_sdk"><img src="https://img.shields.io/github/actions/workflow/status/brim-borium/spotify_sdk/spotify_sdk.yml" alt="build"></a>
<a href="https://github.com/brim-borium/spotify_sdk/blob/main/LICENSE"><img src="https://img.shields.io/github/license/brim-borium/spotify_sdk?color=blue" alt="build"></a>
Expand Down
2 changes: 1 addition & 1 deletion bin/precondition_checker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class PreconditionChecker {

if (prevRun) {
logger.w('Warning: The setup may have already been executed. '
'Please run the cleanup script before running this script again.');
'Please run dart run spotify_sdk:android_setup --cleanup before running this script again.');
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions example/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```sh
CLIENT_ID=61b2332ab76d45918a33f91c3268ec1e
REDIRECT_URL=comspotifytestsdk://callback
CLIENT_ID=
REDIRECT_URL=
```
14 changes: 12 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,31 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace 'de.minimalme.spotify_sdk_example'
compileSdk 34
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}


defaultConfig {
manifestPlaceholders = [redirectSchemeName: "spotify-sdk", redirectHostName: "auth"]
applicationId "de.minimalme.spotify_sdk_example"
minSdkVersion 21
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [redirectSchemeName: "spotify-sdk", redirectHostName: "auth"]
}

buildTypes {
Expand Down
3 changes: 1 addition & 2 deletions example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.minimalme.spotify_sdk_example">
<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.
-->
Expand Down
3 changes: 1 addition & 2 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.minimalme.spotify_sdk_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
Expand Down
3 changes: 1 addition & 2 deletions example/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.minimalme.spotify_sdk_example">
<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.
-->
Expand Down
3 changes: 3 additions & 0 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
4 changes: 2 additions & 2 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Nov 01 19:28:37 CET 2020
#Sun Nov 19 15:44:37 CET 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
28 changes: 17 additions & 11 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
include ':app', ':spotify-app-remote'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()

def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")

def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
plugins {
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
}
}

plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}
include ":app"
include ':spotify-app-remote'

apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle"
10 changes: 10 additions & 0 deletions example/android/spotify-app-remote/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Spotify Android SDK for Flutter
This module (`:spotify-app-remote`) was generated by running the `android_setup` script of
the [spotify_sdk](https://pub.dev/packages/spotify_sdk) plugin.

If you want to update the `aar`-library, please run the `android_setup` script using
one of the following commands:
```
dart run spotify_sdk:android_setup --cleanup
flutter pub run spotify_sdk:android_setup --cleanup
```
2 changes: 1 addition & 1 deletion example/android/spotify-app-remote/build.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configurations.maybeCreate("default")
artifacts.add("default", file('spotify-app-remote-release-0.8.0.aar'))
artifacts.add("default", file('spotify-app-remote-release-0.8.0.aar'))
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Future<void> main() async {
/// * [spotify_sdk](https://pub.dev/packages/spotify_sdk)
/// to connect to Spotify and use controls.
class Home extends StatefulWidget {
const Home({Key? key}) : super(key: key);
const Home({super.key});

@override
HomeState createState() => HomeState();
Expand Down
5 changes: 2 additions & 3 deletions example/lib/widgets/sized_icon_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ class SizedIconButton extends StatelessWidget {
///[icon] sets the icon
/// [onPressed] is the callback
const SizedIconButton(
{Key? key,
{super.key,
required this.width,
required this.icon,
required this.onPressed})
: super(key: key);
required this.onPressed});

///[width] sets the size of the icon
final double width;
Expand Down
8 changes: 4 additions & 4 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ description: Demonstrates how to use the spotify_sdk plugin.
publish_to: 'none'

environment:
sdk: ">=3.0.6 <4.0.0"
sdk: ">=3.1.1 <4.0.0"

dependencies:
flutter:
sdk: flutter
logger: ^2.0.1
logger: ^2.0.2+1
flutter_dotenv: ^5.1.0
cupertino_icons: ^1.0.5
cupertino_icons: ^1.0.6
spotify_sdk:
# When depending on this package from a real application you should use:
# spotify_sdk: ^x.y.z
Expand All @@ -22,7 +22,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.2
flutter_lints: ^3.0.1

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
Expand Down
12 changes: 6 additions & 6 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: spotify_sdk
description: A flutter plugin that let's you communicate with the spotify sdk and auth lib
version: 3.0.0-dev.2
version: 3.0.0-dev.3
homepage: https://github.com/brim-borium/spotify_sdk
issue_tracker: https://github.com/brim-borium/spotify_sdk/issues

environment:
sdk: '>=3.0.6 <4.0.0'
flutter: ">=1.12.0"
sdk: '>=3.1.1 <4.0.0'
flutter: ">=1.17.0"

dependencies:
flutter:
sdk: flutter
flutter_web_plugins:
sdk: flutter
logger: ^2.0.1
dio: ^5.3.2
logger: ^2.0.2+1
dio: ^5.3.3
json_annotation: ^4.8.1
js: ^0.6.7
crypto: ^3.0.3
Expand All @@ -26,7 +26,7 @@ dev_dependencies:
sdk: flutter
build_runner: ^2.4.6
json_serializable: ^6.7.1
flutter_lints: ">=2.0.2 <4.0.0"
flutter_lints: ^3.0.1


# For information on the generic Dart part of this file, see the
Expand Down

0 comments on commit 529036c

Please sign in to comment.