From f31b6182834c7b6de63657f9cba764ee18c75c6c Mon Sep 17 00:00:00 2001 From: Dominic Fellbaum Date: Thu, 26 Oct 2023 07:34:41 +0200 Subject: [PATCH] Relocate the emojis.json source file from root directory in resource folder to emoji_sources. --- README.md | 2 +- lib/build.gradle.kts | 14 +++++++++----- lib/src/main/resources/README.md | 1 + public/README.md | 1 + 4 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 lib/src/main/resources/README.md create mode 100644 public/README.md diff --git a/README.md b/README.md index 575d644..0f11384 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -![Unicode Version](https://img.shields.io/badge/Unicode_version-15.0-critical?style=for-the-badge) +![Unicode Emoji Version](https://img.shields.io/badge/Unicode_Emoji_version-15.1-critical?style=for-the-badge) ![Maven Central](https://img.shields.io/maven-central/v/net.fellbaum/jemoji?style=for-the-badge) ![GitHub](https://img.shields.io/github/license/felldo/JEmoji?style=for-the-badge) # Java Emoji (JEmoji) diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index 8fdcbe0..0ad8d65 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -157,7 +157,7 @@ tasks.named("build") { tasks.register("copyJarToProject") { doLast { copy { - from("$buildDir/libs/jemoji.jar") + from("${layout.buildDirectory}/libs/jemoji.jar") into(project.rootDir.path + "\\libs") } } @@ -365,7 +365,7 @@ tasks.register("generateEmojis") { } val completeGitHubAliases = buildSet { - githubEmojiAliasMap[cpOrigString]?.let { addAll(it.map { it.first }.toList()) } + githubEmojiAliasMap[cpOrigString]?.let { pairList -> addAll(pairList.map { it.first }.toList()) } emojiTerraInfo?.githubCode?.let { add(it) } } @@ -394,9 +394,13 @@ tasks.register("generateEmojis") { //val fileRead = File("$projectDir/src/main/resources/emojis-override.json") TODO: Allow specific overrides or additions to i.e. aliases - val file = File("$projectDir/src/main/resources/emojis.json") + val resourceFile = File("$projectDir/src/main/resources/emojis.json") + val publicFile = File("$rootDir/public/emojis.json") + val publicFileMin = File("$rootDir/public/emojis.min.json") - file.writeText(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(allUnicodeEmojis)) + resourceFile.writeText(mapper.writeValueAsString(allUnicodeEmojis)) + publicFile.writeText(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(allUnicodeEmojis)) + publicFileMin.writeText(mapper.writeValueAsString(allUnicodeEmojis)) } } @@ -481,7 +485,7 @@ fun getEmojiTerraMap(): Map { ?: emptyList() Pair( - document.getElementById("copy-emoji")?.`val`()!!, + document.getElementById("copy-emoji")?.ownText()!!, EmojiTerraInfo(discordCode, githubCode, slackCode, keywords) ) }.forEach { put(it.first, it.second) } diff --git a/lib/src/main/resources/README.md b/lib/src/main/resources/README.md new file mode 100644 index 0000000..f6fe8ed --- /dev/null +++ b/lib/src/main/resources/README.md @@ -0,0 +1 @@ +Do not reference any files in this directory, as they can change anytime. Use the files in this [directory](../../../../public) instead. \ No newline at end of file diff --git a/public/README.md b/public/README.md new file mode 100644 index 0000000..c89e324 --- /dev/null +++ b/public/README.md @@ -0,0 +1 @@ +This is the public directory for any files this project might produce, to ensure a permanent link to those files. \ No newline at end of file