Skip to content

Commit

Permalink
Raised lowest supported version to 2023.3ˆ
Browse files Browse the repository at this point in the history
  • Loading branch information
Unthrottled committed Dec 27, 2023
1 parent af6e009 commit fb0a5cb
Show file tree
Hide file tree
Showing 62 changed files with 246 additions and 181 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

# AMII Changelog

## [1.2.0]

### Added

- 2023.3 Build Support

### Removed

- All older build support


## [1.1.8]

### Added
Expand Down
20 changes: 11 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ fun properties(key: String) = project.findProperty(key).toString()

plugins {
// Kotlin support
kotlin("jvm") version "1.7.10"
kotlin("jvm") version "1.8.10"
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
id("org.jetbrains.intellij") version "1.12.0"
id("org.jetbrains.intellij") version "1.13.3"
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
id("org.jetbrains.changelog") version "1.1.2"
id("org.jetbrains.changelog") version "2.0.0"
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
id("io.gitlab.arturbosch.detekt") version "1.21.0"
id("io.gitlab.arturbosch.detekt") version "1.22.0"
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
id("org.jlleitschuh.gradle.ktlint") version "11.0.0"
id("org.jlleitschuh.gradle.ktlint") version "11.3.2"
}

// Import variables from gradle.properties file
Expand Down Expand Up @@ -47,6 +47,7 @@ dependencies {
implementation("commons-io:commons-io:2.11.0")
implementation("com.googlecode.soundlibs:mp3spi:1.9.5.4")
implementation("io.sentry:sentry:6.4.2")
implementation(files("lib/instrumented-doki-theme-jetbrains-88.5-1.11.0.jar"))
testImplementation("org.assertj:assertj-core:3.23.1")
testImplementation("io.mockk:mockk:1.12.8")
}
Expand Down Expand Up @@ -92,20 +93,21 @@ detekt {

tasks {
withType<JavaCompile> {
sourceCompatibility = "11"
targetCompatibility = "11"
sourceCompatibility = "17"
targetCompatibility = "17"
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "11"
kotlinOptions.jvmTarget = "17"
}

withType<Detekt> {
jvmTarget = "11"
jvmTarget = "17"
}

runIde {
maxHeapSize = "2g"
autoReloadPlugins.set(false)
enabled = environment.getOrDefault("SHOULD_DOKI_THEME_RUN", "true") == "true"
val idePath = properties("idePath")
if (idePath.isNotEmpty()) {
ideDir.set(file(idePath))
Expand Down
5 changes: 4 additions & 1 deletion docs/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
### Added

- Initial 2023.2 Build Support
- 2023.3 Build Support

### Removed

- All older build support
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
pluginGroup = io.unthrottled
pluginName_ = Anime Memes
pluginVersion = 1.1.8
pluginSinceBuild = 231
pluginUntilBuild = 232.*
pluginSinceBuild = 233
pluginUntilBuild = 233.*
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
# See https://jb.gg/intellij-platform-builds-list for available build versions
pluginVerifierIdeVersions = 2023.2.1
pluginVerifierIdeVersions = 2023.3

platformType = IU
platformVersion = 2023.2
platformVersion = 2023.3.2
platformDownloadSources = true
# Plugin Dependencies -> https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html
# Example: platformPlugins = com.intellij.java,com.jetbrains.php:203.4449.22
platformPlugins = io.acari.DDLCTheme:88.5-1.11.0,NodeJS,Dart:232.8660.129,io.flutter:75.0.4
platformPlugins = NodeJS,Dart:233.13135.65,io.flutter:77.0.1

idePath=
#idePath=/Users/alexsimons/Library/Application Support/JetBrains/Toolbox/apps/Rider/ch-0/231.8109.48/Rider EAP.app/Contents
Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/icons/AMIIIcons.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ object AMIIIcons {
val AMII = IconLoader.getIcon("/icons/plugins/amii-android-extension.svg", javaClass)
}
}

@JvmField
val PLUGIN_ICON = IconLoader.getIcon("/icons/plugin-tool-window.svg", javaClass)

Expand All @@ -28,12 +29,14 @@ object AMIIIcons {
val E1F60F = IconLoader.getIcon("/icons/emojis/1f60f.svg", javaClass)
val E1F62D = IconLoader.getIcon("/icons/emojis/1f62d.svg", javaClass)
val E1F92C = IconLoader.getIcon("/icons/emojis/1f92c.svg", javaClass)

@JvmField
val E1F609 = IconLoader.getIcon("/icons/emojis/1f609.svg", javaClass)
val E1F611 = IconLoader.getIcon("/icons/emojis/1f611.svg", javaClass)
val E1F612 = IconLoader.getIcon("/icons/emojis/1f612.svg", javaClass)
val E1F620 = IconLoader.getIcon("/icons/emojis/1f620.svg", javaClass)
val E1F632 = IconLoader.getIcon("/icons/emojis/1f632.svg", javaClass)

@JvmField
val E1F634 = IconLoader.getIcon("/icons/emojis/1f634.svg", javaClass)
val E1F642 = IconLoader.getIcon("/icons/emojis/1f642.svg", javaClass)
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/io/unthrottled/amii/PluginMaster.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class PluginMaster : Disposable, Logging {
AudibleContentManager,
RemoteVisualContentManager,
AnimeContentManager,
CharacterContentManager,
CharacterContentManager
).map { it.status }
.allMatch { it == Status.OK }
if (!isInGoodState) {
Expand Down Expand Up @@ -86,7 +86,7 @@ class PluginMaster : Disposable, Logging {
}

internal data class ProjectListeners(
private val project: Project,
private val project: Project
) : Disposable {

private val idleEventListener = IdleEventListener(project)
Expand Down
14 changes: 7 additions & 7 deletions src/main/kotlin/io/unthrottled/amii/assets/APIAssetManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@ object APIAssetManager : Logging {
* download the remote asset.
*/
fun forceResolveAssetUrl(
apiPath: String,
apiPath: String
): Optional<URI> =
forceResolve(apiPath)

private fun <T : AssetRepresentation> cachedResolve(
assetPath: String,
assetConverter: (InputStream) -> Optional<List<T>>,
assetConverter: (InputStream) -> Optional<List<T>>
): Optional<URI> =
resolveAsset(assetPath) { localAssetPath, remoteAssetUrl ->
resolveTheAssetUrl(localAssetPath, remoteAssetUrl, assetConverter)
}

private fun forceResolve(
assetPath: String,
assetPath: String
): Optional<URI> =
resolveAsset(assetPath) { localAssetPath, remoteAssetUrl ->
downloadAndGetAssetUrl(localAssetPath, remoteAssetUrl)
Expand All @@ -94,7 +94,7 @@ object APIAssetManager : Logging {
downloadAndUpdateAssetDefinitions(
localAssetPath,
"$apiPath?changedSince=${metaData.epochSecond}",
assetConverter,
assetConverter
).toOptional()
apiAssetStatus == NOT_DOWNLOADED ||
(apiAssetStatus == STALE && metaData == null) -> downloadAndGetAssetUrl(localAssetPath, apiPath)
Expand All @@ -115,7 +115,7 @@ object APIAssetManager : Logging {

private fun downloadAndGetAssetUrl(
localAssetPath: Path,
apiPath: String,
apiPath: String
): Optional<URI> {
LocalStorageService.createDirectories(localAssetPath)
return AssetAPI.getAsset(apiPath) { inputStream ->
Expand All @@ -138,7 +138,7 @@ object APIAssetManager : Logging {
private fun <T : AssetRepresentation> downloadAndUpdateAssetDefinitions(
localAssetPath: Path,
apiPath: String,
assetConverter: (InputStream) -> Optional<List<T>>,
assetConverter: (InputStream) -> Optional<List<T>>
): URI =
runSafelyWithResult({
AssetAPI.getAsset(apiPath) { inputStream ->
Expand All @@ -158,7 +158,7 @@ object APIAssetManager : Logging {

val updatedAssets = Stream.concat(
newAssets.stream(),
existingAssets.stream(),
existingAssets.stream()
)
.filter { it.del != true }
.filter { deletedAssetIds.contains(it.id).not() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import java.util.Optional

// todo: post mvp: consolidate
abstract class APIContentManager<T : AssetRepresentation>(
private val assetCategory: AssetCategory,
private val assetCategory: AssetCategory
) : HasStatus {
private lateinit var assetRepresentations: List<T>

Expand Down
26 changes: 13 additions & 13 deletions src/main/kotlin/io/unthrottled/amii/assets/AssetModels.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import java.net.URI
@Suppress("MagicNumber")
enum class MemeAssetCategory(
val value: Int,
val prettyName: String,
val prettyName: String
) {
ACKNOWLEDGEMENT(0, PluginMessageBundle.message("meme.asset.category.acknowledgement")),
FRUSTRATION(1, PluginMessageBundle.message("meme.asset.category.frustration")),
Expand All @@ -26,7 +26,7 @@ enum class MemeAssetCategory(
BORED(15, PluginMessageBundle.message("meme.asset.category.bored")),
TIRED(16, PluginMessageBundle.message("meme.asset.category.tired")),
PATIENTLY_WAITING(17, PluginMessageBundle.message("meme.asset.category.patiently_waiting")),
POUTING(18, PluginMessageBundle.message("meme.asset.category.pouting")),
POUTING(18, PluginMessageBundle.message("meme.asset.category.pouting"))
;

companion object {
Expand Down Expand Up @@ -56,7 +56,7 @@ data class VisualMemeContent(
val id: String,
val filePath: URI,
val imageAlt: String,
val audioId: String?,
val audioId: String?
) : Content

data class VisualAssetEntity(
Expand All @@ -67,7 +67,7 @@ data class VisualAssetEntity(
val characters: List<CharacterEntity>, // should already be downloaded at startup
val representation: VisualAssetRepresentation,
val audibleAssetId: String? = null, // has to be downloaded separately
val isCustomAsset: Boolean = false,
val isCustomAsset: Boolean = false
) {
val isLewd: Boolean
get() = representation.lewd == true
Expand All @@ -76,7 +76,7 @@ data class VisualAssetEntity(
id,
assetUrl,
alt,
audibleAssetId,
audibleAssetId
)

fun duplicate(
Expand All @@ -99,7 +99,7 @@ data class VisualAssetRepresentation(
val char: List<String>,
val aud: String? = null,
val lewd: Boolean? = false,
override val del: Boolean? = null,
override val del: Boolean? = null
) : ContentRepresentation {
fun toEntity(characters: List<CharacterEntity>): VisualAssetEntity =
visualAssetEntity(characters, false)
Expand All @@ -118,7 +118,7 @@ data class VisualAssetRepresentation(

private fun visualAssetEntity(
characters: List<CharacterEntity>,
isCustomAsset: Boolean,
isCustomAsset: Boolean
) =
VisualAssetEntity(
id,
Expand Down Expand Up @@ -150,11 +150,11 @@ data class VisualAssetRepresentation(
data class AudibleRepresentation(
override val id: String,
override val path: String,
override val del: Boolean? = null,
override val del: Boolean? = null
) : ContentRepresentation {
fun toContent(assetUrl: URI): AudibleContent =
AudibleContent(
assetUrl,
assetUrl
)
}

Expand All @@ -165,15 +165,15 @@ data class AudibleContent(
data class AnimeRepresentation(
override val id: String,
val name: String,
override val del: Boolean? = null,
override val del: Boolean? = null
) : AssetRepresentation {
fun toEntity(): AnimeEntity =
AnimeEntity(id, name)
}

data class AnimeEntity(
val id: String,
val name: String,
val name: String
) : Comparable<AnimeEntity> {
override fun compareTo(other: AnimeEntity): Int =
name.compareTo(other.name, ignoreCase = true)
Expand Down Expand Up @@ -201,7 +201,7 @@ data class CharacterRepresentation(
val animeId: String,
val name: String,
val gender: Int,
override val del: Boolean? = null,
override val del: Boolean? = null
) : AssetRepresentation {
fun toEntity(anime: AnimeEntity): CharacterEntity =
CharacterEntity(
Expand All @@ -216,5 +216,5 @@ data class CharacterEntity(
val id: String,
val anime: AnimeEntity,
val name: String,
val gender: Gender,
val gender: Gender
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import kotlin.math.max

data class AssetObservationLedger(
val assetSeenCounts: ConcurrentMap<String, Int>,
val writeDate: Instant,
val writeDate: Instant
)

object AssetObservationService : LocalPersistenceService<AssetObservationLedger>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object BackgroundAssetService {
private const val MIN_ASSETS_REQUIRED = 4

fun downloadNewAssets(
memeAssetCategory: MemeAssetCategory,
memeAssetCategory: MemeAssetCategory
) {
if (Config.instance.onlyCustomAssets) {
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ enum class AssetCategory(val category: String) {

META("meta"),

PROMOTION("promotion"),
PROMOTION("promotion")
}

object ContentAssetManager {
Expand Down Expand Up @@ -54,7 +54,7 @@ object ContentAssetManager {

private fun constructRemoteAssetUrl(
assetCategory: AssetCategory,
assetPath: String,
assetPath: String
): String = "$assetSource/${assetCategory.category}/$assetPath"

private fun resolveTheAssetUrl(localAssetPath: Path, remoteAssetUrl: String): Optional<URI> =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.unthrottled.amii.assets

data class AudibleAssetStorage(
val savedAudibleAssets: Map<String, AudibleRepresentation>,
val savedAudibleAssets: Map<String, AudibleRepresentation>
)

object LocalAudibleAssetStorageService : LocalPersistenceService<AudibleAssetStorage>(
"user-audible-representations.json",
AudibleAssetStorage::class.java,
AudibleAssetStorage::class.java
) {
override fun decorateItem(item: AudibleAssetStorage): AudibleAssetStorage = item

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ enum class AssetStatus {

data class AssetCheckPayload(
val status: AssetStatus,
val metaData: Any? = null,
val metaData: Any? = null
)

object LocalContentService {
fun hasAssetChanged(
localInstallPath: Path,
localInstallPath: Path
): Boolean =
!Files.exists(localInstallPath)

fun hasAPIAssetChanged(
localInstallPath: Path,
localInstallPath: Path
): AssetCheckPayload =
when {
!Files.exists(localInstallPath) -> AssetCheckPayload(AssetStatus.NOT_DOWNLOADED)
Expand Down
Loading

0 comments on commit fb0a5cb

Please sign in to comment.