compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

Material icons extended only being published for desktop

Open luca992 opened this issue 2 years ago • 12 comments

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.

luca992 avatar Jun 09 '22 07:06 luca992

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 avatar Jun 17 '22 08:06 igordmn

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)

igordmn avatar Jun 17 '22 08:06 igordmn

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?

luca992 avatar Jun 17 '22 16:06 luca992

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

luca992 avatar Jun 17 '22 17:06 luca992

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.

Antimonit avatar Jun 18 '22 03:06 Antimonit

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 avatar Jun 20 '22 13:06 igordmn

@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.

Thomas-Vos avatar Jun 20 '22 14:06 Thomas-Vos

It should be fixed in 1.2.0-alpha01-dev731. Could you try it?

igordmn avatar Jun 29 '22 20:06 igordmn

1.2.0-alpha01-dev731 is working for me in common and building for jvm and android. Thanks!

luca992 avatar Jun 29 '22 21:06 luca992

material-icons-extended-js is still missing from https://maven.pkg.jetbrains.space/public/p/compose/dev/org/jetbrains/compose/material/

lucasmeneghin avatar Jul 05 '22 19:07 lucasmeneghin

material-icons-extended-js is still missing from

Indeed. Thanks for noticing.

Reopening this issue until we fix it for js.

igordmn avatar Jul 05 '22 19:07 igordmn

is there any eta on js? @igordmn

luca992 avatar Sep 13 '22 08:09 luca992

can we have this fixed? :( @igordmn

lucasmeneghin avatar Oct 04 '22 00:10 lucasmeneghin

@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

eygraber avatar Nov 30 '22 03:11 eygraber

@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.

igordmn avatar Nov 30 '22 09:11 igordmn

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...)?

eygraber avatar Nov 30 '22 10:11 eygraber

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)

igordmn avatar Nov 30 '22 10:11 igordmn

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

eygraber avatar Nov 30 '22 10:11 eygraber

Here is the CI task (you can create an account in this TeamCity if you don't have one)

image image image

igordmn avatar Nov 30 '22 11:11 igordmn

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:

image

And ran the new 1.3.0-beta

igordmn avatar Nov 30 '22 11:11 igordmn

Awesome thank you!

eygraber avatar Nov 30 '22 15:11 eygraber

Here there are 🎉.

igordmn avatar Nov 30 '22 16:11 igordmn