19 Commits

Author SHA1 Message Date
af37fd67bf build: bump com.google.code.gson:gson from 2.11.0 to 2.12.0
Bumps [com.google.code.gson:gson](https://github.com/google/gson) from 2.11.0 to 2.12.0.
- [Release notes](https://github.com/google/gson/releases)
- [Changelog](https://github.com/google/gson/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google/gson/compare/gson-parent-2.11.0...gson-parent-2.12.0)

---
updated-dependencies:
- dependency-name: com.google.code.gson:gson
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-30 14:34:58 +00:00
3bbb439d86 build: bump jvm from 2.1.0 to 2.1.10 (#46)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-27 15:34:59 +01:00
c6a8325eba build: bump org.jetbrains.dokka from 1.9.20 to 2.0.0 (#45)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-22 01:26:46 +01:00
0c38358bc4 build: bump jvm from 2.0.21 to 2.1.0 (#44)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-28 00:37:31 +01:00
150acada74 build: bump jvm from 2.0.20 to 2.0.21 (#43) 2024-10-13 19:38:00 +02:00
58e02cc460 build: bump jvm from 2.0.0 to 2.0.20 (#40)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 16:12:47 +02:00
b207560670 fix: Fixing property name (#42) 2024-09-05 16:08:06 +02:00
89e706f692 chore: Enable caching (#41) 2024-08-30 11:10:22 +02:00
7af1fa8880 chore: Upgrade from jvm 1 to jvm 2 (#38) 2024-06-26 17:23:46 +02:00
8b6bbd603d build: bump actions/checkout from 3 to 4 (#37)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 17:19:57 +02:00
4b88b09a7f build: bump actions/setup-java from 3 to 4 (#36)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 17:07:55 +02:00
981351da73 build: bump gradle/gradle-build-action from 2 to 3 (#35)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 16:17:32 +02:00
d881859750 build: bump org.jetbrains.dokka from 1.6.21 to 1.9.20 (#34)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 15:56:25 +02:00
a215226c36 build: bump com.google.code.gson:gson from 2.9.0 to 2.11.0 (#32)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 15:50:22 +02:00
26289a7256 fix: run CI/CD on PRs 2024-06-26 15:43:47 +02:00
13e719d1fb feat: Auto publish to Github Packages on tag (#31) 2023-12-28 03:32:33 +01:00
7c7ca1742b chore: Add the ability to publish to Github packages
Signed-off-by: Avior <github@avior.me>
2023-12-28 03:03:40 +01:00
238c215d35 fix: Upgrade Gradle version
Signed-off-by: Avior <github@avior.me>
2023-12-28 02:40:04 +01:00
2ca33328d0 chore: update tests to test current versions of Java 2023-12-28 02:31:46 +01:00
5 changed files with 88 additions and 43 deletions

View File

@ -5,30 +5,40 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Java CI with Gradle
name: Build & test the project
on:
push:
branches: [ master ]
branches:
- '*'
tags:
- v*
pull_request:
branches: [ master ]
permissions:
contents: read
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# follows https://en.wikipedia.org/wiki/Java_version_history#Release_table
java-versions: ['8', '11', '17', '21']
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java ${{ matrix.java-versions }}
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: ${{ matrix.java-versions }}
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action@fec4a42eb0c83154e5c9590748ba8337949c5701
cache: 'gradle'
- name: Build & Test
uses: gradle/gradle-build-action@v3
with:
arguments: build
arguments: build test

View File

@ -8,38 +8,37 @@
name: Gradle Package
on:
release:
types: [created]
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '8' # use the lowest version from https://en.wikipedia.org/wiki/Java_version_history#Release_table
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Build with Gradle
uses: gradle/gradle-build-action@fec4a42eb0c83154e5c9590748ba8337949c5701
- name: Build the project
uses: gradle/gradle-build-action@v3
with:
arguments: build
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
# the publishing section of your build.gradle
- name: Publish to GitHub Packages
uses: gradle/gradle-build-action@fec4a42eb0c83154e5c9590748ba8337949c5701
uses: gradle/gradle-build-action@v3
with:
arguments: publish
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
TOKEN: ${{ secrets.REPO_TOKEN }}

View File

@ -1,16 +1,44 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
// Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
kotlin("jvm") version "1.6.21"
id("org.jetbrains.dokka") version "1.6.21"
kotlin("jvm") version "2.1.10"
id("org.jetbrains.dokka") version "2.0.0"
// Apply the java-library plugin for API and implementation separation.
`java-library`
`maven-publish`
}
// from: https://discuss.kotlinlang.org/t/use-git-hash-as-version-number-in-build-gradle-kts/19818/8
fun String.runCommand(
workingDir: File = File("."),
timeoutAmount: Long = 60,
timeoutUnit: TimeUnit = TimeUnit.SECONDS
): String = ProcessBuilder(split("\\s(?=(?:[^'\"`]*(['\"`])[^'\"`]*\\1)*[^'\"`]*$)".toRegex()))
.directory(workingDir)
.redirectOutput(ProcessBuilder.Redirect.PIPE)
.redirectError(ProcessBuilder.Redirect.PIPE)
.start()
.apply { waitFor(timeoutAmount, timeoutUnit) }
.run {
val error = errorStream.bufferedReader().readText().trim()
if (error.isNotEmpty()) {
return@run ""
}
inputStream.bufferedReader().readText().trim()
}
val branch = "git rev-parse --abbrev-ref HEAD".runCommand(workingDir = rootDir)
val tag = "git tag -l --points-at HEAD".runCommand(workingDir = rootDir)
val commitId = "git rev-parse HEAD".runCommand(workingDir = rootDir)
val finalVersion = System.getenv("version") ?: tag.drop(1) ?: "2.0.0"
val finalGroup = System.getenv("group") ?: "net.tcgdex"
val artifact = System.getenv("artifact") ?: "sdk"
group = System.getenv("group") ?: "net.tcgdex"
version = System.getenv("version") ?: "2.0.0"
group = finalGroup
version = finalVersion
repositories {
mavenCentral()
@ -21,7 +49,7 @@ dependencies {
// Use the Kotlin JDK 8 standard library.
implementation(kotlin("stdlib-jdk8"))
// Gson
implementation("com.google.code.gson:gson:2.9.0")
implementation("com.google.code.gson:gson:2.12.0")
testImplementation(kotlin("test"))
}
@ -33,19 +61,17 @@ tasks.test {
}
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}
java {
withJavadocJar()
withSourcesJar()
targetCompatibility = JavaVersion.VERSION_1_8
}
// Javadocs
@ -56,9 +82,9 @@ val javadocJar = tasks.named<Jar>("javadocJar") {
publishing {
publications {
create<MavenPublication>("maven") {
// groupId = group
groupId = finalGroup
artifactId = artifact
// version = ver
version = finalVersion
from(components["java"])
@ -86,4 +112,14 @@ publishing {
}
}
}
repositories {
maven {
name = "GithubPackages"
url = uri("https://maven.pkg.github.com/tcgdex/java-sdk")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
}
}
}

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists

View File

@ -66,7 +66,7 @@ data class Card internal constructor(
/**
* the Pokémon Pokédex IDs (multiple if multiple pokémon appears on the card)
*/
val dexIDs: List<Int>?,
val dexId: List<Int>?,
/**
* HP of the pokemon