Skip to content

Commit

Permalink
[library] add: publishing stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoslacz committed Aug 22, 2016
1 parent 8d35258 commit dfc031c
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0.0

### Initial release
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ This library is built on top of a great [Mosby](https://github.com/sockeqwe/mosb

I've also used a Lucas Urbas Interactor implementation idea presented in his [Search viper architecture example](https://github.com/lurbas/Search).

I have followed [Publish AAR to jCenter and Maven Central](https://gist.github.com/lopspower/6f62fe1492726d848d6d) by Lopez Mikhael to publish Moviper to jCenter.

## License
```
Copyright 2016 Mateusz Koślacz
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ buildscript {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'me.tatarka:gradle-retrolambda:3.2.5'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
99 changes: 98 additions & 1 deletion moviper/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "com.jfrog.bintray"

// This is the library version used when deploying the artifact
version = "1.0.0"

android {
compileSdkVersion 24
Expand All @@ -8,7 +13,7 @@ android {
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
versionName "1.0.0"
}
buildTypes {
release {
Expand All @@ -25,3 +30,95 @@ dependencies {
compile 'com.hannesdorfmann.mosby:mvp:2.0.1'
compile 'com.hannesdorfmann.mosby:viewstate:2.0.1'
}


def siteUrl = 'https://github.com/mkoslacz/Moviper' // Homepage URL of the library
def gitUrl = 'https://github.com/mkoslacz/Moviper.git' // Git repository URL
group = "com.mateuszkoslacz.moviper" // Maven Group ID for the artifact

install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'

// Add your description here
name 'com.mateuszkoslacz.moviper:moviper'
description = 'A Mosby based VIPER library for Android'
url siteUrl

// Set your license
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'mkoslacz'
name 'Mateusz Koslacz'
email '[email protected]'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

afterEvaluate {
javadoc.classpath += files(android.libraryVariants.collect { variant ->
variant.javaCompile.classpath.files
})
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

// https://github.com/bintray/gradle-bintray-plugin
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")

configurations = ['archives']
pkg {
repo = "Moviper"
// it is the name that appears in bintray when logged
name = "com.mateuszkoslacz.moviper"
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
version {
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = properties.getProperty("bintray.gpg.password") //Optional. The passphrase for GPG signing'
}
}
}
}

0 comments on commit dfc031c

Please sign in to comment.