matomo-org / matomo-sdk-android

SDK for Android to measure your apps with Matomo. Works on Android phones, tablets, Fire TV sticks, and more!
BSD 3-Clause "New" or "Revised" License
388 stars 162 forks source link

Publish to Maven #17

Closed ClementHard closed 9 years ago

ClementHard commented 9 years ago

It would be great if this SDK could be available as a maven/gradle dependency.

Maybe you could use gradle-mvn-push to do it.

d4rken commented 9 years ago

I will look into this, but lets wait another month or few weeks.

The current implementation has changed quite a lot in the last 2 weeks and i expect to submit some more PR in the next weeks. We don't want to bloat the SDK with @deprecated or other things to keep compatibility with old implementations. Publishing it kinda makes it official :wink: .

ironjan commented 9 years ago

I'd also like this library via maven. Using the source was not possible in the way I'd like [0] but using unversioned binaries [1] also isn't a great solution. Publishing the library on maven does not make it "more official" as on github: as long as the major version is 0, the library is regarded as alpha/beta and may deprecate many things. As soon as the lib hits 1.0.0 it can be regarded as "public and stable" ;)

See http://semver.org/ for a reasonable way to manage version numbers. Quote from there about the 0.x.y-phase of applications:

Doesn't this [semantic versioning] discourage rapid development and fast iteration?

Major version zero is all about rapid development. If you're changing the API every day you should either still be in version 0.y.z or on a separate development branch working on the next major version."

[0] Adding this repo as a git submodule is supported - adding nested subprojects (the sdk) to a gradle multiproject (my app) isn't. [1] I changed the jars name to "piwik_android_sdk_YYYY-MM-DD.jar" to make identification of "version" possible without looking into the git log.

jitpack-io commented 9 years ago

Hi! If the build was using the android-maven plugin then it'd be very easy to publish on JitPack Maven repository https://jitpack.io. If you're interested happy to submit a PR for this

d4rken commented 9 years ago

I think we can tackle this now. The versioning approach @ironjan mentioned does sound good.

@jitpack-io I have no experience with the differences between maven repositories.

Is it not possible to publish this as easily on the apache maven repository that is by default included in Android Gradle projects?

@dotsbb What do you think?

jitpack-io commented 9 years ago

The different thing about JitPack is that you don't need to upload your jar:) It checks out your code, builds it and publishes automatically. All that's needed on the project side is a build file and a GitHub release. Gradle build files just need to have the android-maven plugin enabled.

dotsbb commented 9 years ago

@jitpack-io It sounds awesome. Looking forward for your PR.

@d4rken I have no experience with publishing jars to maven ether, so that's why this issue still labeled help wanted.

ironjan commented 9 years ago

@jitpack-io Your PR would be very nice :)

I've got one question for clarification: how is the build on jitpack.io triggered? Is it triggered by the publisher (e.g. by pushing specific tags) or by the "library user" (by requesting unbuilt versions)? I did not understand this point completely from the eplanation on the website.

@dotsbb @d4rken I looked into publishing on maven central out of interest. jitpack.io seems by far easier and less work.

Publishing to maven central needs some steps besides configuration. According to the Publishing manual, you would need to apply for a OSS Repository Hosting (= creating a JIRA account and a JIRA ticket).

Reviewing the requirements can be skipped when the setup of "deployment via gradle" is done thoroughly (i.e. all meta data is added etc.). After this, publishing would be reduced to gradlew uploadArchives.

Getting automatic releases on jitpack.io seems to be as easy as setting up [https://github.com/allegro/axion-release-plugin](a Gradle release & version management plugin) or the android-maven plugin mentioned (or accepting the PR).

jitpack-io commented 9 years ago

Hi all! You can already install from JitPack and here's a build for the latest commit: https://jitpack.io/#piwik/piwik-sdk-android/a03b536f31 With a new GitHub release it would be even easier

d4rken commented 9 years ago

jCenter isn't Maven, but jCenter replaced Maven as default Android repo, so #57 should resolve this. The current dev branch (soon to be master) will be available as version 0.0.2 with new versions being uploaded by me after they have been merged into master.