yshrsmz / BuildKonfig

BuildConfig for Kotlin Multiplatform Project
Apache License 2.0
729 stars 33 forks source link

BuildKonfigs objects are not available in dependent modules. #119

Closed farhazulMullick closed 9 months ago

farhazulMullick commented 9 months ago

Hello @yshrsmz

The generated BuildKonfig objects are not accessible in dependent modules. For ex: if i have (:shared:core) module and BuildKonfig is defined in (:core) then it is not available in (:shared) module, unlike any BuildConfig file which is available in all dependent modules in any multimodular project.

When checked the generated classes found it is an internal expect object {}. Seems like making it public will do the job. Or if there are any challenges let me know, will try to figure out possible solutions.

package com.example.core

import kotlin.Boolean
import kotlin.String

internal expect object BuildKonfig {
  public val BUILD_TYPE: String?

  public val FLAVOUR: String?

  public val DEBUG: Boolean

  public val BUILD_VARIENT: String?
}
yshrsmz commented 9 months ago

check the exposeObjectWithName option. It will do the job.