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

resources demo js workaround #2614

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dima-avdeev-jb
Copy link
Contributor

No description provided.

@dima-avdeev-jb dima-avdeev-jb requested a review from pjBooms January 9, 2023 18:19
@eymar
Copy link
Member

eymar commented Feb 24, 2023

I asked about the issue with resources in different modules in k/js. It's a known thing, but no official solution available yet.
This workaround is a valid thing to do. I took it for Compose k/wasm experiments.
So it's okay to merge in my opinion.

@dima-avdeev-jb
Copy link
Contributor Author

dima-avdeev-jb commented Feb 24, 2023

@eymar
For now, JS resources work fine if JS app "executable" is specified in shared module. So, maybe this PR is redundant.

./gradlew :resources:demo:shared:jsBrowserDevelopmentRun - works fine.

@eymar
Copy link
Member

eymar commented Feb 24, 2023

That's right. This workaround will be needed if we have many modules with different resources and all of them need to be included in the final distribution.
So if we keep the "executable" JS in the same module where we keep the resources, then it's fine and workaround is not needed indeed.

@dima-avdeev-jb
Copy link
Contributor Author

@eymar
I think we can postpone current PR after Kotlin Conf.

@eymar
Copy link
Member

eymar commented Feb 24, 2023

Yeah, not urgent.

Just some notes for the time we decided to get back to it:
demo/jsMain/resources contains the copy of resources, so it would work even without a workaround in this PR.

So I changed it a bit in my branch to make it work:

val copyResources = tasks.create("copyJsResourcesWorkaround", Copy::class.java) {
    from(project(":resources:demo:shared").file("src/commonMain/resources"))
    into("build/processedResources/js/main")
}

afterEvaluate {
    project.tasks.getByName("jsProcessResources").finalizedBy(copyResources)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants