Skip to content

Commit

Permalink
Integrate Supercell API Wrapper Essentials (#181)
Browse files Browse the repository at this point in the history
* Integrate supercell-api-wrapper-essentials

* Remove unused classes

* Remove test resources

* Change version

* Change email

---------

Co-authored-by: Michael Lieshoff <[email protected]>
  • Loading branch information
mlieshoff and Michael Lieshoff authored Dec 18, 2023
1 parent 5ebbade commit 7db66b0
Show file tree
Hide file tree
Showing 96 changed files with 230 additions and 1,299 deletions.
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

## [Unreleased]

## [4.0.0] - 2023-12-18

### Added

- new dependency supercell-api-wrapper-essentials

### Changed

- classes in package jcrapi2.api.* moved to supercell.api.wrapper.essentials.api.*
- classes in package jcrapi2.connector moved to supercell.api.wrapper.essentials.connector
- classes in package jcrapi2.api.connector moved to supercell.api.wrapper.essentials.api.connector
- classes in package jcrapi2.build moved to supercell.api.wrapper.essentials.build
- classes in package jcrapi2.common moved to supercell.api.wrapper.essentials.common

### Removed

- class jcrapi2.api.intern.locations.seasons.global.v2.TopPlayerLeagueSeasonsRequest
- class jcrapi2.api.intern.locations.seasons.global.v2.TopPlayerLeagueSeasonsResponse

## [3.0.5] - 2023-12-18

### Added
Expand Down Expand Up @@ -132,7 +151,8 @@

- Create a Release job (#152)

[unreleased]: https://github.com/mlieshoff/jcrapi2/compare/v3.0.5...HEAD
[unreleased]: https://github.com/mlieshoff/jcrapi2/compare/v4.0.0...HEAD
[4.0.0]: https://github.com/mlieshoff/jcrapi2/compare/v3.0.5...4.0.0
[3.0.5]: https://github.com/mlieshoff/jcrapi2/compare/v3.0.4...3.0.5
[3.0.4]: https://github.com/mlieshoff/jcrapi2/compare/v3.0.3...3.0.4
[3.0.3]: https://github.com/mlieshoff/jcrapi2/compare/v3.0.2...3.0.3
Expand Down
40 changes: 35 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![](https://img.shields.io/badge/java-packagecloud.io-844fec.svg)](https://packagecloud.io/)
[![Nightlies](https://github.com/mlieshoff/jcrapi2/actions/workflows/nightlies.yml/badge.svg)](https://github.com/mlieshoff/jcrapi2/actions/workflows/nightlies.yml)

# jcrapi2 3.0.5
# jcrapi2 4.0.0
A Java Wrapper For Official Supercell Clash Royal Api

## Why we don't use the Swagger scheme?
Expand Down Expand Up @@ -37,9 +37,39 @@ Proxy endpoint
https://crproxy.royaleapi.dev/v1
```

Use built-in http connector
Bind essentials to your project
```xml
<repositories>
<repository>
<id>packagecloud-supercell-api-wrapper-essentials</id>
<url>https://packagecloud.io/mlieshoff/supercell-api-wrapper-essentials/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
```

and use the dependency
```xml
<dependency>
<groupId>supercell-api-wrapper-essentials</groupId>
<artifactId>supercell-api-wrapper-essentials</artifactId>
<version>1.0.1</version>
</dependency>
```

Use built-in standard connector
```java
Connector connector = new StandardConnector();
```

or use the new filesystem cached connector
```java
Connector connector = new StandardConnector();
Connector connector = new FilesystemCachedConnector("jcrapi2")
```

or use custom implementation
Expand Down Expand Up @@ -424,15 +454,15 @@ All requests are returning *java.concurrent.Future*. The execution will be async

to Gradle:
```groovy
implementation group: 'jcrapi2', name: 'jcrapi2', version: '3.0.5'
implementation group: 'jcrapi2', name: 'jcrapi2', version: '4.0.0'
```

to Maven:
```xml
<dependency>
<groupId>jcrapi2</groupId>
<artifactId>jcrapi2</artifactId>
<version>3.0.5</version>
<version>4.0.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.0.5
v4.0.0
24 changes: 20 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>jcrapi2</artifactId>
<packaging>jar</packaging>
<version>3.0.5</version>
<version>4.0.0</version>
<groupId>jcrapi2</groupId>
<url>https://maven.apache.org</url>
<inceptionYear>2018</inceptionYear>
Expand All @@ -12,8 +12,8 @@
<developer>
<id>michael.lieshoff (ML)</id>
<name>Michael Lieshoff</name>
<email>[email protected]</email>
<organization>mili.org</organization>
<email>[email protected]</email>
<organization>psiclops</organization>
<roles>
<role>Developer</role>
</roles>
Expand Down Expand Up @@ -48,6 +48,7 @@
<version.maven.packagecloud>0.0.4</version.maven.packagecloud>
<version.mockito>5.8.0</version.mockito>
<version.slf4j>2.0.9</version.slf4j>
<version.supercell.api.wrapper.essentials>1.0.0</version.supercell.api.wrapper.essentials>
<version.wiremock>3.0.1</version.wiremock>
</properties>
<build>
Expand Down Expand Up @@ -135,7 +136,7 @@
<goal>java</goal>
</goals>
<configuration>
<mainClass>jcrapi2.build.ReleaseVersionChecker</mainClass>
<mainClass>supercell.api.wrapper.essentials.build.ReleaseVersionChecker</mainClass>
<arguments>
<argument>./VERSION.txt</argument>
<argument>./pom.xml</argument>
Expand Down Expand Up @@ -201,6 +202,11 @@
<artifactId>gson</artifactId>
<version>${version.gson}</version>
</dependency>
<dependency>
<groupId>supercell-api-wrapper-essentials</groupId>
<artifactId>supercell-api-wrapper-essentials</artifactId>
<version>1.0.1</version>
</dependency>

<!-- others -->
<dependency>
Expand Down Expand Up @@ -289,5 +295,15 @@
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>packagecloud-supercell-api-wrapper-essentials</id>
<url>https://packagecloud.io/mlieshoff/supercell-api-wrapper-essentials/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</project>
9 changes: 5 additions & 4 deletions src/main/java/jcrapi2/JCrApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
*/
package jcrapi2;

import static jcrapi2.common.Utils.require;
import static supercell.api.wrapper.essentials.common.Utils.require;

import static java.util.stream.Collectors.toList;

import jcrapi2.api.Api;
import jcrapi2.api.ApiContext;
import jcrapi2.api.intern.DefaultApiClasses;
import jcrapi2.connector.Connector;

import supercell.api.wrapper.essentials.api.Api;
import supercell.api.wrapper.essentials.api.ApiContext;
import supercell.api.wrapper.essentials.connector.Connector;

import java.lang.reflect.Constructor;
import java.util.HashMap;
Expand Down
19 changes: 0 additions & 19 deletions src/main/java/jcrapi2/api/Api.java

This file was deleted.

30 changes: 0 additions & 30 deletions src/main/java/jcrapi2/api/ApiContext.java

This file was deleted.

52 changes: 0 additions & 52 deletions src/main/java/jcrapi2/api/BaseApi.java

This file was deleted.

35 changes: 0 additions & 35 deletions src/main/java/jcrapi2/api/ExecutorServiceDecorator.java

This file was deleted.

3 changes: 2 additions & 1 deletion src/main/java/jcrapi2/api/intern/DefaultApiClasses.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package jcrapi2.api.intern;

import jcrapi2.api.Api;
import jcrapi2.api.intern.cards.CardApi;
import jcrapi2.api.intern.challenges.ChallengeApi;
import jcrapi2.api.intern.clans.ClanApi;
Expand All @@ -27,6 +26,8 @@

import lombok.Getter;

import supercell.api.wrapper.essentials.api.Api;

import java.util.Map;

@Getter
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/jcrapi2/api/intern/cards/CardApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package jcrapi2.api.intern.cards;

import jcrapi2.api.Api;
import supercell.api.wrapper.essentials.api.Api;

import java.util.concurrent.Future;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/jcrapi2/api/intern/cards/CardApiImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/
package jcrapi2.api.intern.cards;

import jcrapi2.api.ApiContext;
import jcrapi2.api.BaseApi;
import supercell.api.wrapper.essentials.api.ApiContext;
import supercell.api.wrapper.essentials.api.BaseApi;

import java.util.concurrent.Future;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/jcrapi2/api/intern/cards/CardsRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
*/
package jcrapi2.api.intern.cards;

import jcrapi2.common.Request;

import lombok.Builder;

import supercell.api.wrapper.essentials.common.Request;

public class CardsRequest extends Request {

@Builder
Expand Down
Loading

0 comments on commit 7db66b0

Please sign in to comment.