diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..f3a8538 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,94 @@ +pipeline { + agent { + docker { + image "maven:3.8.1-adoptopenjdk-11" + args '-v /root/.m2:/root/.m2' + } + } + + environment { + NEXUS_VERSION = "nexus3" + NEXUS_PROTOCOL = "https" + NEXUS_REPOSITORY = "maven-goudham" + NEXUS_URL = credentials('fe3e0c7e-bcb1-4d55-9591-f55f71f42356') + NEXUS_CREDENTIAL_ID = 'e5582b32-3507-4e88-ab7c-d16d701c46e9' + + CODECOV_TOKEN = credentials('44a3c021-5cbb-4a6f-bea2-ae6c51d43038') + } + + stages { + stage("Building") { + steps { + sh "mvn -B -DskipTests clean install" + } + } + stage("Testing") { + steps { + sh "mvn test" + } + } + stage("Deploying To Nexus") { + when { + branch 'release' + } + steps { + script { + pom = readMavenPom file: "pom.xml"; + filesByGlob = findFiles(glob: "target/*.${pom.packaging}"); + + echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}" + + artifactPath = filesByGlob[0].path; + artifactExists = fileExists artifactPath; + + if (artifactExists) { + echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}"; + + nexusArtifactUploader( + nexusVersion: NEXUS_VERSION, + protocol: NEXUS_PROTOCOL, + nexusUrl: NEXUS_URL, + groupId: pom.groupId, + version: pom.version, + repository: NEXUS_REPOSITORY, + credentialsId: NEXUS_CREDENTIAL_ID, + artifacts: [ + [artifactId: pom.artifactId, + classifier: '', + file: artifactPath, + type: pom.packaging], + + [artifactId: pom.artifactId, + classifier: '', + file: "pom.xml", + type: "pom"] + ] + ) + } else { + error "*** File: ${artifactPath}, could not be found"; + } + } + } + } + } + + post { + success { + echo "I'm Feeling Swag!" + + echo "Generating Test Report..." + publishCoverage adapters: [jacocoAdapter('target/site/jacoco/jacoco.xml')] + + echo "Sending Report to CodeCov..." + sh '''#!/bin/bash + bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN || echo "Codecov did not collect coverage reports" + ''' + } + failure { + echo 'Not Very Swag :(' + } + cleanup { + cleanWs() + } + } +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 2766e38..9349c21 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ org.jetbrains annotations - RELEASE + 21.0.1 compile diff --git a/src/main/java/org/goudham/me/MyWaifuClient.java b/src/main/java/org/goudham/me/MyWaifuClient.java index e8a407e..2dae6d8 100644 --- a/src/main/java/org/goudham/me/MyWaifuClient.java +++ b/src/main/java/org/goudham/me/MyWaifuClient.java @@ -14,11 +14,8 @@ import java.util.concurrent.Executor; /** * A MyWaifuClient * - *

Main entry point for retrieving information from MyWaifuList.

+ *

Main entry point for retrieving information from MyWaifuList.

*

{@link MyWaifuWrapper} is utilised to make the API requests

- *

Examples of such methods include: - *

  • {@link }
  • - *

    */ public class MyWaifuClient { private final MyWaifuWrapper myWaifuWrapper; diff --git a/src/main/java/org/goudham/me/api/entity/PaginationData.java b/src/main/java/org/goudham/me/api/entity/PaginationData.java index 9883837..6c08c9d 100644 --- a/src/main/java/org/goudham/me/api/entity/PaginationData.java +++ b/src/main/java/org/goudham/me/api/entity/PaginationData.java @@ -12,10 +12,14 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; * {@link PaginationData} *

    Contains standard Pagination data from the API

    * - *
  • {@link Integer currentPage}
  • - *
  • {@link Integer lastPage}
  • - *
  • {@link Integer perPage}
  • - *
  • {@link Integer total}
  • + *

    Fields included are:

    + * + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/Studio.java b/src/main/java/org/goudham/me/api/entity/Studio.java index a52b95c..dbe47fa 100644 --- a/src/main/java/org/goudham/me/api/entity/Studio.java +++ b/src/main/java/org/goudham/me/api/entity/Studio.java @@ -14,9 +14,12 @@ import java.util.Objects; *

    Contains information on a given animation or game development studio

    * *

    Fields included are:

    - *
  • {@link Integer id}
  • - *
  • {@link String name}
  • - *
  • {@link String originalName}
  • + * + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/series/FilteredSeries.java b/src/main/java/org/goudham/me/api/entity/series/FilteredSeries.java index 4858263..3c30991 100644 --- a/src/main/java/org/goudham/me/api/entity/series/FilteredSeries.java +++ b/src/main/java/org/goudham/me/api/entity/series/FilteredSeries.java @@ -15,13 +15,16 @@ import java.util.Objects; *

    Contains basic series information for most endpoints

    * *

    Fields included are:

    - *
  • {@link String name}
  • - *
  • {@link String originalName}
  • - *
  • {@link String romajiName}
  • - *
  • {@link String slug}
  • - *
  • {@link String description}
  • - *
  • {@link String url}
  • - *
  • {@link Integer id}
  • + * + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/series/Series.java b/src/main/java/org/goudham/me/api/entity/series/Series.java index b952753..632a182 100644 --- a/src/main/java/org/goudham/me/api/entity/series/Series.java +++ b/src/main/java/org/goudham/me/api/entity/series/Series.java @@ -16,18 +16,21 @@ import java.util.Objects; *

    Represents a grouping of various {@link Waifu}'s. This can be an anime, mobile game, video game, manga, or LN

    * *

    Fields included are:

    - *
  • {@link String name}
  • - *
  • {@link String originalName}
  • - *
  • {@link String romajiName}
  • - *
  • {@link String slug}
  • - *
  • {@link String releaseDate}
  • - *
  • {@link String airingStart}
  • - *
  • {@link String airingEnd}
  • - *
  • {@link Integer episodeCount}
  • - *
  • {@link String image}
  • - *
  • {@link String url}
  • - *
  • {@link Studio}
  • - *
  • {@link Integer id}
  • + * + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/user/TrueLove.java b/src/main/java/org/goudham/me/api/entity/user/TrueLove.java index e2ec077..3606c89 100644 --- a/src/main/java/org/goudham/me/api/entity/user/TrueLove.java +++ b/src/main/java/org/goudham/me/api/entity/user/TrueLove.java @@ -14,9 +14,13 @@ import java.util.Objects; * {@link TrueLove} *

    Represents a {@link User}'s True Love

    * - *
  • {@link String name}
  • - *
  • {@link String slug}
  • - *
  • {@link String series}
  • + *

    Fields included are:

    + * + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/user/User.java b/src/main/java/org/goudham/me/api/entity/user/User.java index 045e35c..71fad46 100644 --- a/src/main/java/org/goudham/me/api/entity/user/User.java +++ b/src/main/java/org/goudham/me/api/entity/user/User.java @@ -16,14 +16,17 @@ import java.util.Objects; *

    Standard user information and counts of waifus created, liked, trashed. Also contains true love

    * *

    Fields included are:

    - *
  • {@link Integer id}
  • - *
  • {@link String name}
  • - *
  • {@link String twitter}
  • - *
  • {@link String joined}
  • - *
  • {@link Integer waifusCreated}
  • - *
  • {@link Integer waifusLiked}
  • - *
  • {@link Integer waifusTrashed}
  • - *
  • {@link TrueLove trueLove}
  • + * + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/user/UserList.java b/src/main/java/org/goudham/me/api/entity/user/UserList.java index e933e37..a962aaf 100644 --- a/src/main/java/org/goudham/me/api/entity/user/UserList.java +++ b/src/main/java/org/goudham/me/api/entity/user/UserList.java @@ -14,10 +14,14 @@ import org.goudham.me.api.entity.waifu.Waifu; * {@link UserList} *

    Get an array of all user lists on their profile

    * - *
  • {@link Integer id}
  • - *
  • {@link String name}
  • - *
  • {@link String order}
  • - *
  • {@link List< Waifu > waifus}
  • + *

    Fields included are:

    + * + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/waifu/Appearance.java b/src/main/java/org/goudham/me/api/entity/waifu/Appearance.java index 0a4d986..ca7032a 100644 --- a/src/main/java/org/goudham/me/api/entity/waifu/Appearance.java +++ b/src/main/java/org/goudham/me/api/entity/waifu/Appearance.java @@ -13,13 +13,16 @@ import javax.annotation.processing.Generated; *

    Contains basic series information for most endpoints

    * *

    Fields included are:

    - *
  • {@link String name}
  • - *
  • {@link String originalName}
  • - *
  • {@link String romajiName}
  • - *
  • {@link String slug}
  • - *
  • {@link String description}
  • - *
  • {@link String url}
  • - *
  • {@link Integer id}
  • + * + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/waifu/FilteredWaifu.java b/src/main/java/org/goudham/me/api/entity/waifu/FilteredWaifu.java index 0aa2198..ae2a827 100644 --- a/src/main/java/org/goudham/me/api/entity/waifu/FilteredWaifu.java +++ b/src/main/java/org/goudham/me/api/entity/waifu/FilteredWaifu.java @@ -15,17 +15,20 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; *

    Contains Waifu data structure for endpoints other than the primary endpoint (/waifu/{slug})

    * *

    Fields included are:

    - *
  • {@link String slug}
  • - *
  • {@link String name}
  • - *
  • {@link String originalName}
  • - *
  • {@link String romajiName}
  • - *
  • {@link String displayPicture}
  • - *
  • {@link Integer likes}
  • - *
  • {@link Integer trash}
  • - *
  • {@link Integer episodeCount}
  • - *
  • {@link String url}
  • - *
  • {@link List appearances}
  • - *
  • {@link Double id}
  • + * + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/waifu/Waifu.java b/src/main/java/org/goudham/me/api/entity/waifu/Waifu.java index 6c537cd..716fd07 100644 --- a/src/main/java/org/goudham/me/api/entity/waifu/Waifu.java +++ b/src/main/java/org/goudham/me/api/entity/waifu/Waifu.java @@ -20,34 +20,37 @@ import org.goudham.me.api.entity.series.Series; *

    Contains most common attributes for {@link Waifu}'s based on various source material

    * *

    Fields included are:

    - *
  • {@link Integer id}
  • - *
  • {@link String slug}
  • - *
  • {@link Integer creatorId}
  • - *
  • {@link String name}
  • - *
  • {@link String originalName}
  • - *
  • {@link String displayPicture}
  • - *
  • {@link String description}
  • - *
  • {@link Double weight}
  • - *
  • {@link Double height}
  • - *
  • {@link Double bust}
  • - *
  • {@link Double hip}
  • - *
  • {@link Double waist}
  • - *
  • {@link Waifu.BloodType bloodType}
  • - *
  • {@link String origin}
  • - *
  • {@link Integer age}
  • - *
  • {@link String birthdayMonth}
  • - *
  • {@link Integer birthdayDay}
  • - *
  • {@link Integer birthdayYear}
  • - *
  • {@link Integer likes}
  • - *
  • {@link Integer trash}
  • - *
  • {@link String url}
  • - *
  • {@link Boolean husbando}
  • - *
  • {@link Boolean nsfw}
  • - *
  • {@link Integer popularityRank}
  • - *
  • {@link Integer likeRank}
  • - *
  • {@link Integer trashRank}
  • - *
  • {@link List appearances}
  • - *
  • {@link Series series}
  • + * + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/waifu/WaifuImage.java b/src/main/java/org/goudham/me/api/entity/waifu/WaifuImage.java index 2182a45..06ef5d7 100644 --- a/src/main/java/org/goudham/me/api/entity/waifu/WaifuImage.java +++ b/src/main/java/org/goudham/me/api/entity/waifu/WaifuImage.java @@ -10,12 +10,15 @@ import java.util.Objects; /** * {@link WaifuImage} - *

    Contains a thumbnail & full res image link for an image in a given Waifu’s gallery

    + *

    Contains a thumbnail and full res image link for an image in a given Waifu’s gallery

    * *

    Fields included are:

    - *
  • {@link Integer id}
  • - *
  • {@link String thumbnail}
  • - *
  • {@link String path}
  • + * + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({