Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Create Roku Custom Library

Hi, 
I am plan to create custom library on ROKU, No idea for that. 

My Doubt's
1) If any possible for custom library creation??? 
2) If it is possible please provide steps for creation
3) How to integrate custom library in our project ??

Please provide a solution.

Thank you
0 Kudos
11 REPLIES 11
NB_
Roku Guru

Re: Create Roku Custom Library

Can you describe your use-case, i.e. why do you need to create library for Roku?
The business need for it, how is it to be used and so forth - that may help give you some ideas.
0 Kudos
pmpascua
Visitor

Re: Create Roku Custom Library

Hi,

I'm also curious if its possible to make a custom library for Roku as I'm looking into possible ways to fix this particular issue.

In my case, we have an SDK, which composed of about 50 files all flattened onto 1 file on release, to give to our clients. Our clients wants us to use our SDK on a single Scene Graph Task node and this is where we're having some issues on the development stage.

Due to how the file imports work on Scene graph, either I have to explicitly import all 50 files or import 1 flattened release file for the task node to work, both are inefficient approach as I have to juggle between dev and release builds to debug my changes. The idea for the custom library was for the task node to only import 1 file that only contains the line "Library OurSDK" in it, making it so to dynamically load the SDK without explicitly stating the filepath

Thoughts?
0 Kudos
NB_
Roku Guru

Re: Create Roku Custom Library

"pmpascua" wrote:
[...] The idea for the custom library was for the task node to only import 1 file that only contains the line "Library OurSDK" in it, making it so to dynamically load the SDK without explicitly stating the filepath

Thoughts?

Sounds complicated. IMO if there were a feature like this, it would cover it:
<script type = "text/brightscript" uri = "pkg:/ourSDK/*.brs" />

Personally i am skeptical about having 50 separate files for your library, seems gratuitous - there is no benefit of fine grinding it into "one function = one file" mush
0 Kudos
pmpascua
Visitor

Re: Create Roku Custom Library

That wildcard approach doesn't work. If it does I shouldn't be posting here in the first place.
0 Kudos
NB_
Roku Guru

Re: Create Roku Custom Library

Correct, currently it doesn't. Hence i tried saying "if there were a feature like this". Apologies for my bad English.
Question is if there is a strong case for adding that. (me, i am ambivalent)
0 Kudos
pmpascua
Visitor

Re: Create Roku Custom Library

I for one would love to have that feature added if a custom library cannot be made. Not only does it applies on my case but to mimic the way the other platforms (iOS, Android) have done in regards to importing files. 

You could argue about our 50 files approach here but we did it this way for cleanliness and readability 
0 Kudos
tim_beynart
Channel Surfer

Re: Create Roku Custom Library

If you only care about a single flat file when you deliver the library, why not write a script to concatenate all the code?
- edit -
What I mean is, write a script to munge all your code into a release version and deliver it to the device for debugging. But re-reading this thread I see that you want to juggle between dev and prod. 
0 Kudos
pmpascua
Visitor

Re: Create Roku Custom Library

I'm just exploring my options here if a custom library can be made for cleanliness sake. If it is not viable I can do the messy approach to make a script to replace all of those 50 imports inside the xml file into that one file import. I appreciate taking your time to answer my questions. 
0 Kudos
NB_
Roku Guru

Re: Create Roku Custom Library

Opinions on which approach is "messy" may differ here. For example for me it is "unclean" to develop/debug your app in one configuration (50 source files) but in production use only 1 file. The reason being "stay as close to production as reasonably possible". Otherwise risks like having "vanishing" asserts, who may have side-effects in debug mode compilation.

I'd have done what @tim_beynart said, add a merge step to the build script (something like `cat moresels/*.brs >monolith-1-4-9.brs`)
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.