AndroidDeveloperLB / MaterialPreferenceLibrary

Allows to have an ActionBar on PreferenceActivity
Apache License 2.0
406 stars 69 forks source link

Nexus workflow aka. publish to maven #11

Closed victorhaggqvist closed 9 years ago

victorhaggqvist commented 9 years ago

I noticed issue https://github.com/AndroidDeveloperLB/MaterialPreferenceLibrary/issues/4 about publishing the library to maven. I would really appreciate if you do this. JitPack is not a good long term solution.

I have added some boilerplate configuration here for publishing to sonatype oss using the nexus-workflow plugin.

What you need to do on your part is a one time setup with sonatype. After that publishing is just two clicks inside Android Studio.

You go to http://central.sonatype.org/pages/ossrh-guide.html and look under the "Initial setup"-section. Follow the like so create a JIRA account and then open a Project Ticket.

After that the boilerplate config will expect a file at ~/gradle/gradle.properties containing credentials for sonatype. Please refer to my blog post about this config, https://victorhaggqvist.com/blog/2015/how-to-publish-an-android-library-to-maven.html. I wrote that post as a future reference when I did my setup.

AndroidDeveloperLB commented 9 years ago

What's wrong with JitPack ? It's much easier than the other solutions as I've seen. Also it's free

victorhaggqvist commented 9 years ago

It relies on the Github repo being available. You may read a couple other reasons here https://news.ycombinator.com/item?id=9028271.

FYI, https://oss.sonatype.org/ is very much free too. Supposedly Bintray's solution may me easier, though I have experience with that https://bintray.com/bintray/jcenter.

AndroidDeveloperLB commented 9 years ago

Well since the project is on Github, I don't see what's wrong with that. What are the steps for publishing the repo on the other websites? on JitPack, all I need to do is to put the URL of the github repo. It can't be any easier than that...

victorhaggqvist commented 9 years ago

"What are the steps for publishing the repo on the other websites?" Well, that was the first thing I said in https://github.com/AndroidDeveloperLB/MaterialPreferenceLibrary/pull/11#issue-96924273.

But I guess it won't happen then, feel free to close this PR if that's the case.

AndroidDeveloperLB commented 9 years ago

hmmm... actually I did have to add something for JitPack . I think those:

  1. Add classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' to root build.gradle under buildscript { dependencies {

    It should look like this: https://github.com/jitpack/android-example/blob/master/build.gradle

  2. Add apply plugin: 'com.github.dcendents.android-maven' to the library/build.gradle

    2.1. Like this: https://github.com/jitpack/android-example/blob/master/library/build.gradle#L2

    2.2. Apply the plugin to only those modules that you want to serve using JitPack. Normally the library