Skip to content

Commit e885fe3

Browse files
authored
Merge pull request #110 from librespot-org/toml-conf
Use TOML for configuration file
2 parents 0a08ba3 + d94c348 commit e885fe3

File tree

12 files changed

+170
-284
lines changed

12 files changed

+170
-284
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
out/
33
target/
44
*iml
5-
conf.json
5+
config.toml
66
/cache/

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[![Build Status](https://travis-ci.com/librespot-org/librespot-java.svg?branch=master)](https://travis-ci.com/librespot-org/librespot-java)
33
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/xyz.gianlu.librespot/librespot-java/badge.svg)](https://maven-badges.herokuapp.com/maven-central/xyz.gianlu.librespot/librespot-java)
44

5-
`librespot-java` is a port of [librespot](https://github.com/librespot-org/librespot), originally written in Rust. Additionally, this implementation provides an useful API to request metadata or control the player, more [here](https://github.com/librespot-org/librespot-java/blob/master/api).
5+
`librespot-java` is a port of [librespot](https://github.com/librespot-org/librespot), originally written in Rust, which as evolved into the most up-to-date open-source Spotify client. Additionally, this implementation provides an useful API to request metadata or control the player, more [here](https://github.com/librespot-org/librespot-java/blob/master/api).
66

77
## Features
88
This client is pretty much capable of playing anything that's available on Spotify.
@@ -14,7 +14,7 @@ Its main features are:
1414
- Gapless playback
1515

1616
## Get started
17-
All the configuration you need is inside the `conf.properties` file, there you can decide to authenticate with:
17+
All the configuration you need is inside the `config.toml` file, there you can decide to authenticate with:
1818
- Username and password
1919
- Zeroconf
2020
- Facebook
@@ -36,6 +36,6 @@ This is more advanced and should only be used if you saved an authentication blo
3636
You can download the latest release from [here](https://github.com/librespot-org/librespot-java/releases) and then run `java -jar ./librespot-core-jar-with-dependencies.jar` from the command line.
3737

3838
## Build it
39-
This project uses [Maven](https://maven.apache.org/), after installing it you can compile with `mvn clean package` in the project root, if the compilation succeeds you'll be pleased with a JAR executable in `core/target`. Remember that you need to clone the project with its submodules (`git clone --recursive https://github.com/librespot-org/librespot-java`).
39+
This project uses [Maven](https://maven.apache.org/), after installing it you can compile with `mvn clean package` in the project root, if the compilation succeeds you'll be pleased with a JAR executable in `core/target`.
4040

4141
To run the newly build jar run `java -jar ./core/target/librespot-core-jar-with-dependencies.jar`.

api/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,5 @@
4747
<artifactId>librespot-core</artifactId>
4848
<version>${project.version}</version>
4949
</dependency>
50-
<dependency>
51-
<groupId>xyz.gianlu.librespot</groupId>
52-
<artifactId>librespot-common</artifactId>
53-
<version>${project.version}</version>
54-
</dependency>
5550
</dependencies>
5651
</project>

api/src/main/java/xyz/gianlu/librespot/api/Main.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import xyz.gianlu.librespot.core.Session;
66
import xyz.gianlu.librespot.spirc.SpotifyIrc;
77

8-
import java.io.File;
98
import java.io.IOException;
109
import java.security.GeneralSecurityException;
1110

@@ -15,7 +14,7 @@
1514
public class Main {
1615

1716
public static void main(String[] args) throws IOException, GeneralSecurityException, SpotifyIrc.IrcException, Session.SpotifyAuthenticationException {
18-
Session session = new Session.Builder(new FileConfiguration(new File("conf.properties"), args)).create();
17+
Session session = new Session.Builder(new FileConfiguration(args)).create();
1918

2019
ApiServer server = new ApiServer(24879);
2120
server.registerHandler(new PlayerHandler(session));

conf.properties

Lines changed: 0 additions & 45 deletions
This file was deleted.

core/pom.xml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,6 @@
4949
<version>${project.version}</version>
5050
</dependency>
5151

52-
<!-- Data -->
53-
<dependency>
54-
<groupId>com.google.code.gson</groupId>
55-
<artifactId>gson</artifactId>
56-
<version>${gson.version}</version>
57-
</dependency>
58-
<dependency>
59-
<groupId>com.google.protobuf</groupId>
60-
<artifactId>protobuf-java</artifactId>
61-
<version>${protobuf.version}</version>
62-
</dependency>
63-
6452
<!-- Audio -->
6553
<dependency>
6654
<groupId>org.jcraft</groupId>
@@ -88,5 +76,12 @@
8876
<artifactId>okhttp</artifactId>
8977
<version>3.14.1</version>
9078
</dependency>
79+
80+
<!-- TOML configuration -->
81+
<dependency>
82+
<groupId>com.electronwill.night-config</groupId>
83+
<artifactId>toml</artifactId>
84+
<version>3.6.0</version>
85+
</dependency>
9186
</dependencies>
9287
</project>

core/src/main/java/xyz/gianlu/librespot/DefaultConfiguration.java

Lines changed: 0 additions & 137 deletions
This file was deleted.

0 commit comments

Comments
 (0)