Triple-T / gradle-play-publisher

GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.
MIT License
4.13k stars 341 forks source link

Support for artifactDir does not explain if GPP can be used without Android plugin #800

Closed snlehton closed 4 years ago

snlehton commented 4 years ago

I'm trying to get a Gradle build system to work where I'd like to have a separate project for publishing our APK to Google Play. I already have a test where GPP is in the project that builds the APK, and it works. In the documentation there is a segment that describes how to use artifactDir for publishing arbitrary artifacts.

However, I'm unable to create a project which would not have com.android.application and only reference the artifact from another project. Is this possible? Can I somehow make my publishing project depend on the actual Android project?

I'm an amateur what comes to Gradle, so if this is something you can already trivially do, I apologize. If possible, it would be awesome to have a clarification over this in the documentation for noobs like me.

SUPERCILEX commented 4 years ago

No, you're correct: you still have to apply the Android Gradle Plugin. See this discussion: https://github.com/Triple-T/gradle-play-publisher/issues/748.

I'm not sure I understand the use case, why do you want a separate Gradle project for publishing? We rely on the application ID and variant information provided by AGP. This could potentially change in the future, but I feel like that would be straying from GPP's mission of giving you the best integrated publishing experience.

Maybe you can use the Android Publisher API directly? https://developers.google.com/android-publisher Or maybe our internal-but-public APIs can be useful for something quick and dirty? https://github.com/Triple-T/gradle-play-publisher/tree/master/play/android-publisher/src/main/kotlin/com/github/triplet/gradle/androidpublisher

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

snlehton commented 4 years ago

Hi, thanks for your reply. Totally missed the notification from Github.

The background for the issue is that we're using Unity to make Android builds, and Unity can export Gradle project which you can then use to build the actual Android apk/bundle. I have been augmenting the Gradle template Unity provides with GPP plugin, and it works now wonderfully after all issues were solved.

Now we wanted to separate the building of the Android app from publishing it in our CI, and was thinking of writing a separate Gradle script to do the publishing with GPP but quickly learnt that this isn't immediately possible. This would also allowed me to skip the Unity Gradle template tweaking, as currently GPP is the only reason we need to have the custom template in the first place. Also GPP (we're using version 2.6.1) requires a newer Gradle plugin (3.5) than what Unity is using (3.4), and using 3.5 with Unity caused some issues which I was luckily able to fix.

Separating publishing from building is currently possible just by invoking the Gradle without publish in the build step, and only with publishing in the publish step, so that is already doable. I just wished I'd be able to do it without the template modification.

So, we're currently happy. The reason I'm hesitant of switching away from GPP is simply that it is so damn convenient 😊 So little tweaking, and it just works. I haven't done much Android development myself, so doing something from the Publisher API would require much more work. So, case closed. Thanks for the info!