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

Add tvOS support #745

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Conversation

muralex-e
Copy link

In this PR I've tried to add tvOS targets to moko-resources project.

As mentioned in #739, the core implementation was already done in Apple generators, so I followed the approach in #648.

I've done the following:

  • Added tvOS targets and source seta to extended convention and Apple main convention.
  • Implemented the expected classes and methods for tvOS targets.
  • Added missing mocks for tvOS "resources-test" project.

I've tried to build the tvOS target in the sample ios app, but I'm getting the error
No matching variant of dev.icerock.moko:resources:0.24.1 was found.

Maybe you can suggest how I can test the tvOS target before it is added in the release version.

Comment on lines 41 to 45
sourceSets.matching {
it.name == "tvosMain"
}.configureEach {
this.dependsOn(sourceSets.getByName("appleMain"))
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to use

val appleSourceSets = listOf("watchos", "tvos")
val appleMainSourceSets = appleSourceSets.map { "${it}Main" }
val appleTestSourceSets = appleSourceSets.map { "${it}Test" }

sourceSets
    .matching { it.name in appleMainSourceSets }
    .configureEach { this.dependsOn(sourceSets.getByName("appleMain")) }
    
sourceSets
    .matching { it.name in appleTestSourceSets }
    .configureEach { this.dependsOn(sourceSets.getByName("appleTest")) }

@Alex009
Copy link
Member

Alex009 commented Jul 7, 2024

I've tried to build the tvOS target in the sample ios app, but I'm getting the error
No matching variant of dev.icerock.moko:resources:0.24.1 was found.

Maybe you can suggest how I can test the tvOS target before it is added in the release version.

you should up version in gradle/moko.versions.toml and run ./gradlew publishToMavenLocal

@Alex009 Alex009 added this to the 0.25.0 milestone Jul 7, 2024
@Alex009 Alex009 linked an issue Jul 7, 2024 that may be closed by this pull request
@muralex-e
Copy link
Author

I have added the requested changes. Thank you for the suggestion, it helped with the error I had.
However, I still can’t compile the tvOS project with the mokoresources.

So, basically I tried to follow the commits from PR #648 and added a tvOS target in the samples/kotlin-ios-app. TvOS app can be built without moko resources, but when I try to import mpp-library I’m getting the error:

No such module 'MppLibrary'

I also tried creating a new tvOS application in the project, but I encountered the same error and couldn't figure out how to fix it.

Would it be useful to add here the commits with the tvOS target in the existing app or the newly created app that I tried, even though it is not working properly?

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.

Moko resources and tvOS support
2 participants