Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump icon versions #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ You can find all code reference in the docs of the icon packs bellow.

| Icon pack | Icon Version | Dependency | All Icons Docs |
| --- | --- | --- | --- |
| [Simple-Icons](https://simpleicons.org/) | 4.14.0 | `simple-icons` | [docs](simple-icons/DOCUMENTATION.md) |
| [Feather](https://feathericons.com/) | 4.28.0 | `feather` | [docs](feather/DOCUMENTATION.md) |
| [Tabler Icons](https://tabler-icons.io/) | 1.39.1 | `tabler-icons` | [docs](tabler-icons/DOCUMENTATION.md) |
| [Eva Icons](https://akveo.github.io/eva-icons/#/) | 1.1.3 | `eva-icons` | [docs](eva-icons/DOCUMENTATION.md) |
| [Font Awesome](https://fontawesome.com/) | 5.15.2 | `font-awesome` | [docs](font-awesome/DOCUMENTATION.md) |
| [Octicons](https://primer.style/octicons/) | 12.1.0 | `octicons` | [docs](octicons/DOCUMENTATION.md) |
| [Linea](http://www.linea.io/) | 1.0 | `linea` | [docs](linea/DOCUMENTATION.md) |
| [Line Awesome](https://icons8.com/line-awesome) | 1.3.0 (a60f113) | `line-awesome` | [docs](line-awesome/DOCUMENTATION.md) |
| [Weather Icons by Erik Flowers](https://github.com/erikflowers/weather-icons) | 2.0.12 | `erikflowers-weather-icons` | [docs](erikflowers-weather-icons/DOCUMENTATION.md) |
| [css.gg](https://css.gg/) | 2.0.0 | `css-gg` | [docs](css-gg/DOCUMENTATION.md) |
| [css.gg](https://css.gg) | 2.1.1 | `css-gg` | [docs](css-gg/DOCUMENTATION.md) |
| [Erik Flowers' Weather Icons](https://github.com/erikflowers/weather-icons) | 2.0.12 | `erikflowers-weather-icons` | [docs](erikflowers-weather-icons/DOCUMENTATION.md) |
| [Eva Icons](https://akveo.github.io/eva-icons) | 1.1.3 | `eva-icons` | [docs](eva-icons/DOCUMENTATION.md) |
| [Feather](https://feathericons.com) | 4.29.2 | `feather` | [docs](feather/DOCUMENTATION.md) |
| [Font Awesome](https://fontawesome.com) | 6.6.0 | `font-awesome` | [docs](font-awesome/DOCUMENTATION.md) |
| [Line Awesome](https://icons8.com/line-awesome) | 1.3.1 (78a1012) | `line-awesome` | [docs](line-awesome/DOCUMENTATION.md) |
| [Linea](https://github.com/linea-io/Linea-Iconset) | 1.0 | `linea` | [docs](linea/DOCUMENTATION.md) |
| [Octicons](https://primer.style/octicons) | 19.12.0 | `octicons` | [docs](octicons/DOCUMENTATION.md) |
| [Simple-Icons](https://simpleicons.org) | 13.16.0 | `simple-icons` | [docs](simple-icons/DOCUMENTATION.md) |
| [Tabler Icons](https://tabler-icons.io) | 3.22.0 | `tabler-icons` | [docs](tabler-icons/DOCUMENTATION.md) |

## Version Catalog

Expand Down
4 changes: 2 additions & 2 deletions css-gg/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {

registerGeneratorTask(
githubId = "astrit/css.gg",
version = "2.0.0",
version = "2.1.1",
mapSourceCodeIconsToSvgComposeFolder = { repoCloneDir ->
val iconsDir = File(repoCloneDir, "icons/svg")

Expand All @@ -45,6 +45,6 @@ registerGeneratorTask(
accessorName = "CssGgIcons",
),
licensePathAtRepo = { "LICENSE" },
documentationHeader = "[css.gg](https://css.gg/)"
documentationHeader = "[css.gg](https://css.gg)"
)

2 changes: 1 addition & 1 deletion erikflowers-weather-icons/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ registerGeneratorTask(
accessorName = "WeatherIcons",
),
licensePathAtRepo = { null },
documentationHeader = "[Weather Icons by Erik Flowers](https://github.com/erikflowers/weather-icons)",
documentationHeader = "[Erik Flowers' Weather Icons](https://github.com/erikflowers/weather-icons)",
licenseUrl = { _, _ -> "http://scripts.sil.org/OFL" }
)
2 changes: 1 addition & 1 deletion erikflowers-weather-icons/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
POM_NAME=Compose Icons Weather Icons by Erik Flowers
POM_NAME=Compose Icons Erik Flowers' Weather Icons
POM_ARTIFACT_ID=erikflowers-weather-icons
2 changes: 1 addition & 1 deletion eva-icons/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ registerGeneratorTask(
}
),
licensePathAtRepo = { "LICENSE.txt" },
documentationHeader = "[Eva Icons](https://akveo.github.io/eva-icons/)",
documentationHeader = "[Eva Icons](https://akveo.github.io/eva-icons)",
)
4 changes: 2 additions & 2 deletions feather/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {

registerGeneratorTask(
githubId = "feathericons/feather",
version = "v4.28.0",
version = "v4.29.2",
mapSourceCodeIconsToSvgComposeFolder = { repoCloneDir ->
val iconsDir = File(repoCloneDir, "icons")

Expand Down Expand Up @@ -46,5 +46,5 @@ registerGeneratorTask(
accessorName = "FeatherIcons",
),
licensePathAtRepo = { "LICENSE" },
documentationHeader = "[Feather Icons](https://feathericons.com/)"
documentationHeader = "[Feather Icons](https://feathericons.com)"
)
2 changes: 1 addition & 1 deletion font-awesome/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {

registerGeneratorTask(
githubId = "FortAwesome/Font-Awesome",
version = "5.15.2",
version = "6.6.0",
mapSourceCodeIconsToSvgComposeFolder = { repoCloneDir ->
val relocatedNames = mutableMapOf<String, String>()

Expand Down
4 changes: 2 additions & 2 deletions line-awesome/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ android {

registerGeneratorTask(
githubId = "icons8/line-awesome",
version = "a60f11367584e7df157277b5ab9d1654ec91ae24",
gitCheckoutName = "a60f11367584e7df157277b5ab9d1654ec91ae24",
version = "78a101217707c9b1c4dcf2a821be75684e36307f", // 1.3.1
gitCheckoutName = "78a101217707c9b1c4dcf2a821be75684e36307f",
mapSourceCodeIconsToSvgComposeFolder = { repoCloneDir ->
val relocatedNames = mutableMapOf<String, String>()

Expand Down
2 changes: 1 addition & 1 deletion linea/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ registerGeneratorTask(
accessorName = "LineaIcons",
),
licensePathAtRepo = { "LICENSE" },
documentationHeader = "[Linea](http://www.linea.io/)"
documentationHeader = "[Linea](https://github.com/linea-io/Linea-Iconset)"
)
4 changes: 2 additions & 2 deletions octicons/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {

registerGeneratorTask(
githubId = "primer/octicons",
version = "v12.1.0",
version = "v19.12.0",
mapSourceCodeIconsToSvgComposeFolder = { repoCloneDir ->
val relocatedNames = mutableMapOf<String, String>()

Expand Down Expand Up @@ -46,5 +46,5 @@ registerGeneratorTask(
accessorName = "Octicons",
),
licensePathAtRepo = { "LICENSE" },
documentationHeader = "[Octicons](https://primer.style/octicons/)"
documentationHeader = "[Octicons](https://primer.style/octicons)"
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package compose.icons.sample.data

import compose.icons.AllIcons
import compose.icons.AllIconsNamed
import compose.icons.CssGgIcons
import compose.icons.EvaIcons
Expand All @@ -21,7 +20,7 @@ val iconPacks = listOf(
allIcons = CssGgIcons.AllIconsNamed,
),
IconPackModel(
packName = "Weather Icons by Erik Flowers",
packName = "Erik Flowers' Weather Icons",
allIcons = WeatherIcons.AllIconsNamed,
),
IconPackModel(
Expand Down
29 changes: 13 additions & 16 deletions simple-icons/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import generator.putRelocatedRelativeTo
import generator.registerGeneratorTask
import org.jetbrains.kotlin.com.google.gson.Gson
import java.text.Normalizer
import java.util.Locale

plugins {
kotlin("multiplatform")
Expand All @@ -21,24 +22,20 @@ android {

registerGeneratorTask(
githubId = "simple-icons/simple-icons",
version = "4.14.0",
version = "13.17.0",
mapSourceCodeIconsToSvgComposeFolder = { repoCloneDir ->
val relocatedNames = mutableMapOf<String, String>()

val ignoredIcons = listOf(
"Elsevier"
)

val iconsJsonFile = File(repoCloneDir, "_data/simple-icons.json")

val icons = Gson().fromJson<SimpleIcons>(iconsJsonFile.readText(), SimpleIcons::class.java).icons
val icons = Gson().fromJson(iconsJsonFile.readText(), SimpleIcons::class.java).icons

fun String.normalize(form: Normalizer.Form): String {
return Normalizer.normalize(this, form)
}

fun iconTitleToSlug(title: String): String {
return title.toLowerCase()
return title.lowercase(Locale.getDefault())
.replace("\\+".toRegex(), "plus")
.replace("^\\.".toRegex(), "dot-")
.replace("\\.$".toRegex(), "-dot")
Expand All @@ -59,14 +56,16 @@ registerGeneratorTask(
.replace("[^a-z0-9\\-]".toRegex(), "")
}

val iconsNamesFixed = icons.map { if(it.slug != null) it.slug!! else iconTitleToSlug(it.title) }
val iconsNamesFixed = icons.map { if (it.slug != null) it.slug!! else iconTitleToSlug(it.title) }

val iconsDir = File(repoCloneDir, "icons")

val ignoredIcons = listOf("Elsevier")

iconsNamesFixed
.associate {
val sourceName = it.replace(" ", "_").replace("-", "_") + ".svg"
val fileName = it.replace(" ", "") + ".svg"
val fileName = it.replace(" ", "").replace("-", "") + ".svg"

val icon = File(iconsDir, fileName)
val renamed = File(iconsDir, sourceName)
Expand All @@ -76,12 +75,10 @@ registerGeneratorTask(

sourceName to fileName
}
.apply {
forEach {
if (ignoredIcons.any { ignored -> it.value.contains(ignored, ignoreCase = true) }) {
File(iconsDir, it.value).delete()
println("Removed ignored icon: ${it.key}")
}
.onEach {
if (ignoredIcons.any { ignored -> it.value.contains(ignored, ignoreCase = true) }) {
File(iconsDir, it.value).delete()
println("Removed ignored icon: ${it.key}")
}
}

Expand All @@ -95,5 +92,5 @@ registerGeneratorTask(
accessorName = "SimpleIcons",
),
licensePathAtRepo = { "LICENSE.md" },
documentationHeader = "[Simple Icons](https://simpleicons.org/)"
documentationHeader = "[Simple Icons](https://simpleicons.org)"
)
29 changes: 15 additions & 14 deletions tabler-icons/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,24 @@ android {

registerGeneratorTask(
githubId = "tabler/tabler-icons",
version = "v1.39.1",
version = "v3.22.0",
mapSourceCodeIconsToSvgComposeFolder = { repoCloneDir ->
val iconsDir = File(repoCloneDir, "icons")

val relocatedNames = mutableMapOf<String, String>()

// renaming to match to svg-to-compose
iconsDir.listFiles().filter { it.extension == "svg" }
.forEach {
val newFile = File(it.parentFile, it.name.replace("-", "_"))

// store the name change
relocatedNames.putRelocatedRelativeTo(repoCloneDir, newFile, it)

// rename to conform with SVG to Compose
it.renameTo(newFile)
}
val iconsDir = File(repoCloneDir, "icons")
val iconFiles = iconsDir.listFiles()
?.flatMap { it.listFiles().orEmpty().toList() }
?.filter { it.extension == "svg" }
.orEmpty()
iconFiles.forEach {
val newFile = File(it.parentFile, it.name.replace("-", "_"))

// store the name change
relocatedNames.putRelocatedRelativeTo(repoCloneDir, newFile, it)

// rename to conform with SVG to Compose
it.renameTo(newFile)
}

MapIconsToSvgComposeFolderResult(
iconsFolder = iconsDir,
Expand Down