Skip to content

Commit

Permalink
Relocate the emojis.json source file from root directory in resource …
Browse files Browse the repository at this point in the history
…folder to emoji_sources.
  • Loading branch information
felldo committed Oct 26, 2023
1 parent ec8f1f9 commit f31b618
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a name="startReadme"></a>
![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)
Expand Down
14 changes: 9 additions & 5 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Expand Down Expand Up @@ -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) }
}

Expand Down Expand Up @@ -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))
}
}

Expand Down Expand Up @@ -481,7 +485,7 @@ fun getEmojiTerraMap(): Map<String, EmojiTerraInfo> {
?: emptyList()

Pair(
document.getElementById("copy-emoji")?.`val`()!!,
document.getElementById("copy-emoji")?.ownText()!!,
EmojiTerraInfo(discordCode, githubCode, slackCode, keywords)
)
}.forEach { put(it.first, it.second) }
Expand Down
1 change: 1 addition & 0 deletions lib/src/main/resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not reference any files in this directory, as they can change anytime. Use the files in this [directory](../../../../public) instead.
1 change: 1 addition & 0 deletions public/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is the public directory for any files this project might produce, to ensure a permanent link to those files.

0 comments on commit f31b618

Please sign in to comment.