Skip to content

Commit

Permalink
Release of version 1.8.1 (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminkomen authored May 2, 2020
1 parent 5cb1fc2 commit a23ba53
Show file tree
Hide file tree
Showing 26 changed files with 427 additions and 653 deletions.
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
*.class

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
Expand All @@ -15,7 +12,7 @@ hs_err_pid*
.idea/
*.properties
target/
!maven-wrapper.properties
!maven-wrapper.jar
build/
!system.properties
.gradle/
!src/test/resources/credentials.properties
Binary file removed .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
1 change: 0 additions & 1 deletion .mvn/wrapper/maven-wrapper.properties

This file was deleted.

11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
language: java

jdk:
- openjdk13
- openjdk14

addons:
sonarcloud:
organization: "benjaminkomen-github"

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'
- '$HOME/.gradle/'
- '.gradle'

# the dependency benjaminkomen/jwiki recides in GitHub Packages, for which you need credentials to download.
# They are set here, with the GITHUB_TOKEN in Travis.
install:
- cp .travis.settings.xml $HOME/.m2/settings.xml

script:
- ./mvnw clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar
# - ./gradlew clean build sonarqube ## FIXME enable when the java/util/jar/Pack200 bug has been fixed
- ./gradlew clean build
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
FROM maven:3.6.2-jdk-13 as builder
FROM gradle:6.3.0-jdk14 as builder

# Copy local code to the container image.
WORKDIR /app
COPY pom.xml .
COPY build.gradle .
COPY src ./src

ARG GITHUB_TOKEN
ENV GITHUB_TOKEN=${GITHUB_TOKEN}
COPY .travis.settings.xml /root/.m2/settings.xml

# Build a release artifact.
RUN mvn package -DskipTests
RUN gradle build --no-daemon

FROM adoptopenjdk/openjdk13:jdk-13_33-alpine-slim
FROM adoptopenjdk/openjdk14:jdk-14.0.1_7-alpine-slim

COPY --from=builder /app/target/TibiaWikiApi.jar /TibiaWikiApi.jar
COPY --from=builder /app/build/libs/app-*.jar /TibiaWikiApi.jar

# Run the web service on container startup.
CMD ["java","-Djava.security.egd=file:/dev/./urandom","-Dserver.port=${PORT}","-jar","/TibiaWikiApi.jar"]
CMD [ "java","-Djava.security.egd=file:/dev/./urandom","-Dserver.port=${PORT}","--enable-preview","-jar","/TibiaWikiApi.jar"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Benjamin Komen
Copyright (c) 2020 Benjamin Komen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=com.tibiawiki%3ATibiaWikiApi&metric=coverage)](https://sonarcloud.io/dashboard?id=com.tibiawiki%3ATibiaWikiApi)

# TibiaWikiApi

Gets data from http://tibia.wikia.com and exposes this data using a RESTful JSON API.

## View online
Navigate to https://tibiawiki.dev to view the Swagger API of this project.

## Run locally
Clone this git project to your local computer and compile it using: `mvn clean install` from your favourite command line
terminal. Then execute: `mvn spring-boot:run` and open your browser on http://localhost:8080
Clone this git project to your local computer and compile it using: `./gradlew build` from your favourite command line
terminal. Then execute: `./gradlew bootRun` and open your browser on http://localhost:8080

Note that you need to add the [sample settings.xml](.travis.settings.xml) to your $HOME/.m2/settings.xml directory
with a valid username and github token with read packages scope.
Expand Down
112 changes: 112 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
plugins {
id 'org.springframework.boot' version '2.2.6.RELEASE'
id 'java'
id 'idea'
id 'jacoco'
id "org.sonarqube" version "2.8"
}

group = 'com.tibiawiki'
version = '1.8.1'
description = 'TibiaWikiApi'
sourceCompatibility = '14'
targetCompatibility = '14'

repositories {
mavenLocal()
mavenCentral()

maven {
url = 'https://maven.pkg.github.com/benjaminkomen/jwiki'
credentials {
username = 'benjaminkomen'
password = System.getenv("GITHUB_TOKEN")
}
}
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter:2.2.6.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-jersey:2.2.6.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-web:2.2.6.RELEASE'
implementation 'benjaminkomen:jwiki:2.2.0'
implementation 'org.slf4j:slf4j-api:1.7.30'
implementation 'org.slf4j:slf4j-log4j12:1.7.30'
implementation 'org.json:json:20190722'
implementation 'org.jetbrains:annotations:19.0.0'
implementation 'one.util:streamex:0.7.2'
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'javax.activation:activation:1.1.1'
implementation 'com.google.guava:guava:29.0-jre'
implementation 'io.swagger:swagger-jersey2-jaxrs:1.6.1'
implementation 'io.vavr:vavr:0.10.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.6.2'
testImplementation 'org.mockito:mockito-core:3.3.3'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.2.6.RELEASE'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
compileOnly 'org.projectlombok:lombok:1.18.12'
}

sonarqube {
properties {
property "sonar.projectName", "TibiaWikiApi"
property "sonar.projectKey", "com.tibiawiki:TibiaWikiApi"
}
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs += '--enable-preview'
}

tasks.withType(Test) {
jvmArgs += "--enable-preview"
useJUnitPlatform()

testLogging {
events "passed", "skipped", "failed"
}
}

tasks.withType(JavaExec) {
jvmArgs += '--enable-preview'
}

jar {
manifest {
attributes 'Main-Class': 'com/tibiawiki/TibiaWikiApiApplication'
}
}

sourceSets {
integrationTest {
compileClasspath += sourceSets.main.output + configurations.testCompile
runtimeClasspath += output + compileClasspath + configurations.testRuntime
}
}

configurations {
integrationTestImplementation.extendsFrom implementation
integrationTestImplementation.extendsFrom testImplementation
}

idea {
module {
testSourceDirs += sourceSets.integrationTest.java.srcDirs
testResourceDirs += sourceSets.integrationTest.resources.srcDirs
scopes.TEST.plus += [configurations.integrationTestCompile]
}
}

task integrationTest(type: Test) {
description = 'Runs the integration tests.'
group = 'verification'
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false }
mustRunAfter test
}

check.dependsOn integrationTest
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Sat May 02 12:23:41 CEST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Loading

0 comments on commit a23ba53

Please sign in to comment.