https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
j

Jess Brent

04/21/2020, 7:08 PM
is there a way to prepend the
com.whatever.whatever
for import statements one platform, but not another? i can’t really come up with the exact phrase to google here so i’m a little SoL
e

emmano

04/21/2020, 7:44 PM
You mean for one platform to have one package name and another platform another package name?
j

Jess Brent

04/21/2020, 7:45 PM
the default configuration appears to not contain the a package structure similar to how people normally set up libraries, where the package directive is something more like the above. i’m assuming there’s a way to do this without changing the entire project’s structure
i’m not so familiar with gradle..
in javascript we never really imported things in this style of “com.company.library”
e

emmano

04/21/2020, 7:51 PM
I am not sure if I am following, but I would create the package and then move the classes into it? Android Studio can help.
j

Jess Brent

04/21/2020, 7:51 PM
i assume i would have to do this for all compilations. i’m trying to avoid this for js
i gave up and did it that way anyway, too frivolous to worry about imo
👍 1
g

galex

05/06/2020, 11:55 AM
I’d like that too. In JS we don’t need a package as everything is inside a module/namespace, but it is useful on Android and iOS.
2 Views