Skip to content

Commit

Permalink
Merge pull request #23 from EndlessCodeGroup/v0.6.2
Browse files Browse the repository at this point in the history
v0.6.2
  • Loading branch information
osipxd authored Dec 29, 2021
2 parents 31fb942 + 365d140 commit aba2cc5
Show file tree
Hide file tree
Showing 38 changed files with 694 additions and 1,253 deletions.
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
## [Unreleased]

## [v0.6.2] (2021-12-29)

### API Changes

- Added vararg variants of ClassSystem methods

### Fixed

- Check plugin exists before registering built-in integrations
- Isolate `MimicItemsRegistry` from exceptions thrown from other items registries implementations.

### Housekeeping

- Update Kotlin to 1.6.10
- Update Gradle to 7.3.3
- Migrate tests to MockK and Kotest assertions

## [v0.6.1] (2021-08-23)

### Fixed
Expand Down Expand Up @@ -42,6 +59,7 @@
- Update bukkit-gradle to 0.10.0
- Update Gradle to 7.2

[unreleased]: https://github.com/EndlessCodeGroup/Mimic/compare/v0.6.1...develop
[unreleased]: https://github.com/EndlessCodeGroup/Mimic/compare/v0.6.2...develop
[v0.6.2]: https://github.com/EndlessCodeGroup/Mimic/compare/v0.6.1...v0.6.2
[v0.6.1]: https://github.com/EndlessCodeGroup/Mimic/compare/v0.6...v0.6.1
[v0.6]: https://github.com/EndlessCodeGroup/Mimic/compare/v0.5...v0.6
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ repositories {
}

dependencies {
compileOnly("ru.endlesscode.mimic:mimic-bukkit-api:0.6.1")
compileOnly("ru.endlesscode.mimic:mimic-bukkit-api:0.6.2")
}
```

Expand All @@ -56,7 +56,7 @@ dependencies {
<dependency>
<groupId>ru.endlesscode.mimic</groupId>
<artifactId>mimic-bukkit-api</artifactId>
<version>0.6.1</version>
<version>0.6.2</version>
<scope>provided</scope>
</dependency>
```
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

plugins {
id("org.jetbrains.dokka")
id("com.github.ben-manes.versions") version "0.36.0"
id("com.github.ben-manes.versions") version "0.39.0"
}

// Common configurations for all Mimic projects
subprojects {
apply(plugin = "commons")
apply(plugin = "publish")

version = "0.6.1"
version = "0.6.2"
group = "ru.endlesscode.mimic"
}

Expand Down
6 changes: 3 additions & 3 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ java {
}

dependencies {
val kotlinVersion = "1.5.21"
val kotlinVersion = "1.6.10"
implementation(kotlin("gradle-plugin", version = kotlinVersion))
implementation(kotlin("serialization", version = kotlinVersion))
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.5.0")
implementation("org.jetbrains.kotlinx:binary-compatibility-validator:0.7.0")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.6.0")
implementation("org.jetbrains.kotlinx:binary-compatibility-validator:0.8.0")
implementation("de.undercouch:gradle-download-task:4.1.2")
}

Expand Down
15 changes: 0 additions & 15 deletions buildSrc/src/main/kotlin/HoconSerializationRule.kt

This file was deleted.

8 changes: 4 additions & 4 deletions buildSrc/src/main/kotlin/commons.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ tasks.test {
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
apiVersion = "1.5"
languageVersion = "1.5"
apiVersion = "1.6"
languageVersion = "1.6"
freeCompilerArgs = listOf("-Xjvm-default=all")
allWarningsAsErrors = System.getProperty("warningsAsErrors") == "true"
javaParameters = true
Expand Down Expand Up @@ -61,6 +61,6 @@ fun DependencyHandlerScope.testingDependencies() {
testImplementation(kotlin("test-junit5"))
testImplementation(junit.jupiter)
testImplementation(junit.jupiter_params)
testImplementation(mockito.kotlin)
testImplementation(mockito.inline)
testImplementation(misc.mockk)
testImplementation(kotest.assertions)
}
28 changes: 6 additions & 22 deletions buildSrc/src/main/kotlin/dependencies.kt
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
@file:Suppress("ClassName")
/*
* This file is part of RPGInventory.
* Copyright (C) 2019 EndlessCode Group and contributors
*
* RPGInventory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RPGInventory is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with RPGInventory. If not, see <http://www.gnu.org/licenses/>.
*/

object rpgplugins {
const val skillapi = "com.sucy:SkillAPI:3.102"
Expand All @@ -24,7 +7,7 @@ object rpgplugins {
const val mmoLib = "net.Indyuce:MMOLib:1.7.3"
const val mmoItems = "net.Indyuce:MMOItems:6.5.5"
const val mythicLib = "io.lumine:MythicLib:1.0.10"
const val heroes = "com.herocraftonline.heroes:Heroes:1.9.6-SNAPSHOT:stripped"
const val heroes = ":Heroes:1.9.9"
}

object acf {
Expand All @@ -34,7 +17,8 @@ object acf {
object misc {
const val bstats = "org.bstats:bstats-bukkit:1.8"
const val annotations = "org.jetbrains:annotations:13.0"
const val serialization_hocon = "org.jetbrains.kotlinx:kotlinx-serialization-hocon:1.2.2"
const val serialization_hocon = "org.jetbrains.kotlinx:kotlinx-serialization-hocon:1.3.2"
const val mockk = "io.mockk:mockk:1.12.1"
}

// Testing
Expand All @@ -44,7 +28,7 @@ object junit {
const val jupiter_params = "org.junit.jupiter:junit-jupiter-params:$jupiter_version"
}

object mockito {
const val kotlin = "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
const val inline = "org.mockito:mockito-inline:2.23.0"
object kotest {
private const val version = "5.0.3"
const val assertions = "io.kotest:kotest-assertions-core:$version"
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 3 additions & 0 deletions mimic-api/api/mimic-api.api
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ public final class ru/endlesscode/mimic/MimicApiLevel {
public static final field CURRENT I
public static final field INSTANCE Lru/endlesscode/mimic/MimicApiLevel;
public static final field VERSION_0_6 I
public static final field VERSION_0_6_2 I
public static final fun checkApiLevel (I)Z
}

Expand All @@ -17,8 +18,10 @@ public abstract interface class ru/endlesscode/mimic/ProviderService : ru/endles
public abstract interface class ru/endlesscode/mimic/classes/ClassSystem {
public abstract fun getClasses ()Ljava/util/List;
public fun getPrimaryClass ()Ljava/lang/String;
public fun hasAllClasses (Ljava/lang/String;[Ljava/lang/String;)Z
public fun hasAllClasses (Ljava/util/List;)Z
public fun hasAnyClass ()Z
public fun hasAnyOfClasses (Ljava/lang/String;[Ljava/lang/String;)Z
public fun hasAnyOfClasses (Ljava/util/List;)Z
public fun hasClass (Ljava/lang/String;)Z
}
Expand Down
8 changes: 7 additions & 1 deletion mimic-api/src/main/kotlin/MimicApiLevel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ public object MimicApiLevel {
*/
public const val VERSION_0_6: Int = 1

/**
* # Version 0.6.2
* - Vararg variants of ClassSystem methods
*/
public const val VERSION_0_6_2: Int = 2

/**
* The latest version at the moment of Mimic COMPILATION.
*
Expand All @@ -37,7 +43,7 @@ public object MimicApiLevel {
* Use [checkApiLevel] if you want to check that the current RUNNING Mimic API level meets to
* the required.
*/
public const val CURRENT: Int = VERSION_0_6
public const val CURRENT: Int = VERSION_0_6_2

/**
* Returns 'true' if the current RUNNING Mimic API level meets to the required, otherwise `false`.
Expand Down
16 changes: 16 additions & 0 deletions mimic-api/src/main/kotlin/classes/ClassSystem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,27 @@ public interface ClassSystem {
/** Returns `true` if player has any class. */
public fun hasAnyClass(): Boolean = primaryClass != null

/**
* Returns `true` if player has any of required classes.
* @since 0.6.2
*/
public fun hasAnyOfClasses(firstClass: String, vararg restClasses: String): Boolean {
return hasAnyOfClasses(listOf(firstClass, *restClasses))
}

/** Returns `true` if player has any of [requiredClasses]. */
public fun hasAnyOfClasses(requiredClasses: List<String>): Boolean {
return requiredClasses.any { hasClass(it) }
}

/**
* Returns `true` if player has all required classes.
* @since 0.6.2
*/
public fun hasAllClasses(firstClass: String, vararg restClasses: String): Boolean {
return hasAllClasses(listOf(firstClass, *restClasses))
}

/** Returns `true` if player has all [requiredClasses]. */
public fun hasAllClasses(requiredClasses: List<String>): Boolean {
return requiredClasses.all { hasClass(it) }
Expand Down
Loading

0 comments on commit aba2cc5

Please sign in to comment.