Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 2.1 #48

Merged
merged 26 commits into from
May 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
727b22f
refactor(ALL): refactor to Gradle / split project / improve code [ski…
May 3, 2018
a549165
chore(TEMPLATE): update github templates [skip ci]
May 3, 2018
87099ea
chore(CI): fixing issue CI [skip ci]
May 3, 2018
0e674a7
chore(Bintray): Bintray upload [skip ci]
May 3, 2018
c9fc48d
feat(README): Update README [skip ci]
May 3, 2018
9eabd2a
chore(UPDATE): update code [skip ci]
May 5, 2018
e1add55
perf(REST): allows a custom RestTemplate
May 5, 2018
0068156
chore(FILE): Remove file
May 5, 2018
2bb0646
perf(SESSION): session creation adjustments
May 5, 2018
6ffeb5a
perf(JSON): change access method to public
May 5, 2018
6c916bf
perf(COMMON): Builder improvement
May 5, 2018
4f6c27f
Merge remote-tracking branch 'origin/feature/2.1' into feature/2.1
May 5, 2018
4d22642
ci(TRAVIS): do not install
May 6, 2018
ab8bafb
perf(FEED): getting if it is all platforms
May 6, 2018
29167a2
refactor(REST): Refactoring Rest Client
May 6, 2018
e575782
style(ALL): formatting code
May 6, 2018
53200d5
fix(CODACY): code coverage
May 6, 2018
cec00f5
fix(CODACY): code coverage
May 6, 2018
52245ce
fix(CODACY): code coverage - deprecated
May 6, 2018
4d29050
fix(REST): fixing rest response
May 7, 2018
c51a48e
style(ALL): typings and toString
May 7, 2018
ab0538b
perf(SESSION): logging session creation
May 7, 2018
a480cb0
style(ALL): reformat code
May 7, 2018
b623b3a
style(ALL): reformat code
May 7, 2018
7bd82bf
style(CHECKSTYLE): Typings, Javadoc
May 7, 2018
bf05537
style(CHECKSTYLE): checkstyle file
May 7, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/ISSUES_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ possible. Thank you!
-->
### Versioning
**Version**: <!-- Package version -->

**OS Platform**: <!-- Operating system version with platform (x86 or x64) -->

**Java Version ( >= 1.8 )**: <!-- Recommending using Java 8, Specify Java Build version -->

### Description

<!-- Describe exactly your problem. For codes or console logs use tripple backquote (`)
For example:
```java
package pl.stachuofficial.examples
package com.examples
public class ExampleTest {
public static void main(String[] args){
System.out.println("This is a example compiled text.")
Expand Down
5 changes: 4 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->
**IDE:**

**OS Platform:**

**Java Version:**
**Maven Version:**

**Gradle Version:**

### Screenshots (optional):
27 changes: 5 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
# Created by .ignore support plugin (hsz.mobi)
### Maven template
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties

# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
!/.mvn/wrapper/maven-wrapper.jar

!.github/

### JetBrains
.idea/**
.idea
*.iml

src/test/java/com/github/stachu540/hirezapi/*.java
!src/test/java/com/github/stachu540/hirezapi/HiRezAPITest.java
out/
.gradle
build/
logs/
22 changes: 14 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@ language: java
jdk:
- oraclejdk8

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- ~/.m2/repository
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/

install:
- mvn install -Dmaven.javadoc.skip=true -P !build-extras -B
- mvn dependency:go-offline -Dmaven.javadoc.skip=true -P !build-extras -B
before_install:
- chmod +x ./gradlew
script:
- mvn test -DskipTest=false -Dmaven.javadoc.skip=true -P !build-extras -B
- mvn cobertura:cobertura -Dmaven.javadoc.skip=true -P !build-extras -B
after_success:
- mvn codacy:coverage -Dmaven.javadoc.skip=true -P !build-extras -B
- ./gradlew test

deploy:
- provider: script
script: ./gradlew bintrayUpload
on:
tags: true
37 changes: 19 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
[![Build Status](https://travis-ci.org/stachu540/HiRezAPI.svg)](https://travis-ci.org/stachu540/HiRezAPI)
[![Libraries.io](https://img.shields.io/librariesio/github/stachu540/HiRezAPI.svg)](https://libraries.io/github/stachu540/HiRezAPI)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/ee16a92996a3425d87403780aa18f316)](https://www.codacy.com/app/stachu540/HiRezAPI?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=stachu540/HiRezAPI&amp;utm_campaign=Badge_Grade)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/ee16a92996a3425d87403780aa18f316)](https://www.codacy.com/app/stachu540/HiRezAPI?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=stachu540/HiRezAPI&amp;utm_campaign=Badge_Coverage)
[![Javadocs](https://img.shields.io/badge/Javadoc-v2.0.1-brightgreen.svg)](https://jitpack.io/com/github/stachu540/HiRezAPI/v2.0.1/javadoc/)
[![Release](https://jitpack.io/v/stachu540/HiRezAPI.svg)](https://jitpack.io/#stachu540/HiRezAPI)

# HiRezAPI

Java-Based API Wrapper for Hi-Rez Studios games. Currently supports:
* [Smite](https://smitegame.com/)
* [Paladins](https://paladinsgame.com/)
* [Paladins](https://paladins.com/)

## Features

Expand All @@ -28,37 +27,39 @@ Add to `pom.xml` build.
<repositories>
...
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
<id>jcenter</id>
<url>https://jcenter.bintray.com</url>
</repository>
</repositories>
...

<dependencies>
...
<dependency>
<groupId>com.github.stachu540</groupId>
<artifactId>HiRezAPI</artifactId>
<version>2.0.1</version>
<!--for all games-->
<artifactId>HiRezAPI-core</artifactId>
<!--for paladins-->
<!--<artifactId>HiRezAPI-paladins</artifactId>-->
<!--for smite-->
<!--<artifactId>HiRezAPI-smite</artifactId>-->
<version>2.1.0</version>
</dependency>
</dependencies>
...
```
#### Gradle
Add to `build.gradle` build.
```groovy
...
repositories {
...
maven {
url "https://jitpack.io"
}
jcenter()
}
...

dependencies {
...
compile "com.github.stachu540:HiRezAPI:2.0.1"
// for all games
compile "com.github.stachu540:HiRezAPI-core:2.1.0"
// for paladins
// compile "com.github.stachu540:HiRezAPI-paladins:2.1.0"
// for smite
// compile "com.github.stachu540:HiRezAPI-smite:2.1.0"
}
...
```

For starting using script check [Wiki page](https://github.com/stachu540/HiRezAPI/wiki/Example-Usage).
Expand Down
130 changes: 130 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
plugins {
id "idea"
id "maven"
id "jacoco"
id "maven-publish"
id "net.ltgt.apt" version "0.15"
id "com.jfrog.bintray" version "1.8.0"
}

ext {
versions = [
lombok : "1.16.20",
slf4j : "1.7.25",
logback : "1.2.3",
jackson : "2.9.5",
rome : "1.9.0",
commons_lang3 : "3.7",
okhttp : "3.10.0",
jsoup : "1.11.3",
codacy : "4.0.0",
mockito : "2.18.3",
junit : "4.12"
]
}

allprojects {
group = 'com.github.stachu540'
version = '2.1.0-SNAPSHOT'

repositories {
jcenter()
}

plugins.withType(JavaPlugin) {
plugins.withId("net.ltgt.apt-idea") {
afterEvaluate {
project.idea.module.apt.addAptDependencies = false
}
}
}

}

subprojects {
apply plugin: "java"
apply plugin: "jacoco"
apply plugin: "net.ltgt.apt"
apply plugin: "maven-publish"
apply plugin: "com.jfrog.bintray"

sourceCompatibility = 1.8
targetCompatibility = 1.8

ext.subprojectName = (project.name == "HiRezApi") ? "HiRezApi" : "HiRezApi-${project.name}"

sourceSets {
main {
java {
srcDirs = ['build/generated/source/apt/main', 'src/main/java']
}
}
}

dependencies {
compile "org.slf4j:slf4j-api:${versions.slf4j}"
annotationProcessor "org.projectlombok:lombok:${versions.lombok}"
compileOnly "org.projectlombok:lombok:${versions.lombok}"

testCompile "junit:junit:${versions.junit}"
testCompile "org.mockito:mockito-core:${versions.mockito}"
testCompile "ch.qos.logback:logback-classic:${versions.logback}"
}

// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
baseName = 'HiRezApi-' + baseName
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
baseName = 'HiRezApi-' + baseName
from javadoc.destinationDir
}

artifacts {
archives javadocJar
archives sourcesJar
}

publishing {
publications {
mainProject(MavenPublication) {
from project.components.java
groupId group
artifactId subprojectName
version version
artifact sourcesJar
artifact javadocJar
}
}
}

bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_API_KEY')
publications = ['mainProject']
pkg {
repo = 'Java'
name = 'HiRezAPI'
userOrg = user
desc = 'Java-Based API Wrapper for Hi-Rez Studios games.'
websiteUrl = 'https://github.com/stachu540/HiRezAPI'
vcsUrl = 'https://github.com/stachu540/HiRezAPI.git'
issueTrackerUrl = 'https://github.com/stachu540/HiRezAPI/issues'
licenses = ['MIT']
labels = ['hi-rez', 'api-wrapper', 'smite', 'paladins']
publicDownloadNumbers = true
version {
name = project.version
}
}
}
}

wrapper {
gradleVersion = "4.7"
distributionType = Wrapper.DistributionType.ALL
}
25 changes: 16 additions & 9 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
-->

<module name="Checker">
<module name = "Checker">
<property name="charset" value="UTF-8"/>

<property name="severity" value="warning"/>
Expand Down Expand Up @@ -50,20 +50,23 @@
<module name="NoLineWrap"/>
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<module name="NeedBraces"/>
<module name="LeftCurly"/>
<module name="RightCurly">
<property name="id" value="RightCurlySame"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE,
LITERAL_DO"/>
</module>
<module name="RightCurly">
<property name="id" value="RightCurlyAlone"/>
<property name="option" value="alone"/>
<property name="tokens"
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
INSTANCE_INIT"/>
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
Expand Down Expand Up @@ -189,18 +192,21 @@
</module>
<module name="MethodParamPad"/>
<module name="NoWhitespaceBefore">
<property name="tokens" value="COMMA, SEMI, POST_INC, POST_DEC, DOT, ELLIPSIS, METHOD_REF"/>
<property name="tokens"
value="COMMA, SEMI, POST_INC, POST_DEC, DOT, ELLIPSIS, METHOD_REF"/>
<property name="allowLineBreaks" value="true"/>
</module>
<module name="ParenPad"/>
<module name="OperatorWrap">
<property name="option" value="NL"/>
<property name="tokens"
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR,
LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
</module>
<module name="AnnotationLocation">
<property name="id" value="AnnotationLocationMostCases"/>
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
</module>
<module name="AnnotationLocation">
<property name="id" value="AnnotationLocationVariables"/>
Expand All @@ -216,7 +222,8 @@
<module name="JavadocParagraph"/>
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
<property name="target"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="JavadocMethod">
<property name="scope" value="public"/>
Expand All @@ -240,4 +247,4 @@
</module>
<module name="CommentsIndentation"/>
</module>
</module>
</module>
8 changes: 8 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dependencies {
compile "com.squareup.okhttp3:okhttp:${versions.okhttp}"
compile "com.squareup.okhttp3:logging-interceptor:${versions.okhttp}"
compile "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
compile "org.jsoup:jsoup:${versions.jsoup}"
compile "org.apache.commons:commons-lang3:${versions.commons_lang3}"
compile "com.rometools:rome:${versions.rome}"
}
Loading