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

Properly export enums in public API #1039

Open
SUPERCILEX opened this issue Feb 17, 2022 · 4 comments
Open

Properly export enums in public API #1039

SUPERCILEX opened this issue Feb 17, 2022 · 4 comments
Labels
bug Indicates an unexpected problem or unintended behavior feature:other Involves a feature that doesn't fit in existing categories

Comments

@SUPERCILEX
Copy link
Collaborator

Ideally we can just use a type alias, but I don't think groovy will understand that. If the type alias doesn't work, we can pull resolution strategy and release status into their own module under the existing package name and export that.

@SUPERCILEX SUPERCILEX added bug Indicates an unexpected problem or unintended behavior feature:other Involves a feature that doesn't fit in existing categories labels Feb 17, 2022
@SUPERCILEX
Copy link
Collaborator Author

Other thoughts.

We could keep this for 4.0 and have the package name match the module name, though that seems like unnecessary import breakage.

We could also duplicate those enums in the plugin module and map them to the backend enums. That's probably the nicest solution for users in the long run, but might be a pain to deal with and also requires 4.0 breakage.

@JavierSegoviaCordoba
Copy link

I have seen as common practice to have a -api module (kotlin and android Gradle plugins for example), maybe that approach will scale better.

@JavierSegoviaCordoba
Copy link

@SUPERCILEX I can open a PR creating this module and moving this part as a non breaking change so you don't need to jump to 4 yet. Later rest of public APIs can be moved gradually.

@SUPERCILEX
Copy link
Collaborator Author

Can you try a type alias first and see what happens in Groovy?

@Test
fun `Groovy configuration options`() {
// language=gradle
val config = """
play {
enabled = true
serviceAccountCredentials = file('creds.json')
defaultToAppBundles = false
commit = true
fromTrack = 'from'
track = 'track'
promoteTrack = 'promote'
userFraction = 0.5d
updatePriority = 3
releaseStatus = ReleaseStatus.COMPLETED
releaseName = 'name'
resolutionStrategy = ResolutionStrategy.AUTO
artifactDir = file('.')
retain {
artifacts = [1l, 2l, 3l]
mainObb = 8
patchObb = 8
}
}
"""
execute(config, "help")
}
. You need to remove these imports:
import com.github.triplet.gradle.androidpublisher.ReleaseStatus
import com.github.triplet.gradle.androidpublisher.ResolutionStrategy

If it doesn't work, then I'm happy to accept a PR that creates an api module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior feature:other Involves a feature that doesn't fit in existing categories
Projects
None yet
Development

No branches or pull requests

2 participants