compose-multiplatform
compose-multiplatform copied to clipboard
Material icons extended only being published for desktop
I was having trouble using the extended material icons in my common code. It turns out it is only being built/published for desktop.
You can verify here: https://maven.pkg.jetbrains.space/public/p/compose/dev/org/jetbrains/compose/material/
Material icons core does not have this issue.
We only publish it for desktop. For android it should be redirected to the Jetpack Compose published version.
I just checked Compose 1.1.1, and it works fine, if we add icons this way (in MPP-style project):
kotlin {
...
sourceSets {
named("commonMain") {
dependencies {
...
api(compose.materialIconsExtended)
}
}
}
}
and use Icons.Filled.BlurOn
Redirecting is described in this file: https://maven.pkg.jetbrains.space/public/p/compose/dev/org/jetbrains/compose/material/material-icons-extended/1.1.1/material-icons-extended-1.1.1.module (look for androidx.compose.material)
Okay, if that's on purpose, why? The basic icon set is published for all targets as I mentioned. Shouldn't the extended icons be published for all targets as well?
We only publish it for desktop. For android it should be redirected to the Jetpack Compose published version.
I just checked Compose 1.1.1, and it works fine, if we add icons this way (in MPP-style project):
kotlin { ... sourceSets { named("commonMain") { dependencies { ... api(compose.materialIconsExtended) } } } }
and use
Icons.Filled.BlurOn
@igordmn
Sorry, what I reported was somewhat incorrect.
The project will build with implementation(compose.materialIconsExtended)
in commonMain
. But, Intellij will fail to resolve any extended icon in the commonMain
source set. Which is just really annoying plus code completion for the extended icons doesn't work.
to work around that issue I added implementation("org.jetbrains.compose.material:material-icons-extended-desktop:_")
to both jvm and android dependencies and everything works as it should.
However, I have been trying out the ios support on the alpha build and it would be nice to have the icons published for all the targets
I just ran into the same issue as @luca992.
Icons.Default.Add
is in the material-icons-core
package.
Icons.Default.Remove
is in the material-icons-extended
package.
- With
api(compose.materialIconsExtended)
-
Icons.Default.Remove
is highlighted red and autocomplete for icons from the extended package does not work.
-
- With
api(compose("org.jetbrains.compose.material:material-icons-extended-desktop"))
-
Icons.Default.Remove
is correctly recognized.
-
In both cases, the app compiles just fine but IntelliJ IDEA highlighting and autocomplete are broken in the first scenario.
I have been trying out the ios support on the alpha build and it would be nice to have the icons published for all the targets
Oh, I understand. Publishing for iOS and JS is indeed not enabled. It will be fixed. Publishing for Android will remain the same (artifacts will point to the artifacts published by Google)
@igordmn I think when these packages (icons extended, material3, etc) are published for all targets that the following issue may be fixed as well. It is about autocomplete not working in common source sets. https://github.com/JetBrains/compose-jb/issues/2032 (see comments). It seems to only affect the packages that are not published for all targets.
It should be fixed in 1.2.0-alpha01-dev731. Could you try it?
1.2.0-alpha01-dev731
is working for me in common and building for jvm and android. Thanks!
material-icons-extended-js is still missing from https://maven.pkg.jetbrains.space/public/p/compose/dev/org/jetbrains/compose/material/
material-icons-extended-js is still missing from
Indeed. Thanks for noticing.
Reopening this issue until we fix it for js.
is there any eta on js? @igordmn
can we have this fixed? :( @igordmn
@igordmn is there anything to do here besides making sure that artifact gets published correctly?
Edit: I just published to maven local and it seems to work fine
@igordmn is there anything to do here besides making sure that artifact gets published correctly?
Probably not, but I can't tell for sure. This task should publish icons for all platforms (into the local directory). This issue isn't in our near plans, but if someone will make a PR with the fix, ping me in the PR, and mention this issue, I will review and merge.
I'll see if I can find anything.
Would it be possible to manually build and deploy the artifacts for existing versions (1.2.1, 1.3.0-beta, etc...)?
possible to manually build
No, it requires much more efforts comparing to just publishing for the next versions (our CI isn't configured for this)
How does CI run publishComposeJbExtendedIcons
?
Without seeing that, my best guess would be that compose.platforms
either isn't set or doesn't specify js
when running publishExtendedIcons
I looked on the other task, and found out that for JS we call publish
tasks separately with an additional argument. Added a new task:
And ran the new 1.3.0-beta
Awesome thank you!
Here there are 🎉.