-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from prolificinteractive/plugin
Added plugin implementation in gradle
- Loading branch information
Showing
3 changed files
with
139 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,23 @@ | |
# When configured, Gradle will run in incubating parallel mode. | ||
# This option should only be used with decoupled projects. More details, visit | ||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
# org.gradle.parallel=true | ||
# org.gradle.parallel=true | ||
|
||
GROUP=com.prolificinteractive | ||
VERSION_NAME=0.0.1 | ||
VERSION_CODE=1 | ||
|
||
POM_PACKAGING=aar | ||
POM_NAME=Swipe Action Layout | ||
POM_ARTIFACT_ID=swipe-action-layout | ||
POM_URL=https://github.com/prolificinteractive/swipe-action-layout | ||
POM_DESCRIPTION=A nice swipe layout that provides new actions with a material design look and feel. | ||
POM_SCM_URL=https://github.com/prolificinteractive/swipe-action-layout | ||
POM_SCM_CONNECTION=scm:[email protected]:prolificinteractive/swipe-action-layout.git | ||
POM_SCM_DEV_CONNECTION=scm:[email protected]:prolificinteractive/swipe-action-layout.git | ||
POM_LICENCE_NAME=The Apache Software License, Version 2.0 | ||
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt | ||
POM_LICENCE_DIST=repo | ||
POM_DEVELOPER_ID=prolificinteractive | ||
POM_DEVELOPER_NAME=Prolific Interactive | ||
POM_DEVELOPER_EMAIL=[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,119 @@ | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'maven' | ||
apply plugin: 'signing' | ||
|
||
android { | ||
compileSdkVersion 23 | ||
buildToolsVersion "23.0.1" | ||
|
||
defaultConfig { | ||
minSdkVersion 16 | ||
targetSdkVersion 23 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
compileSdkVersion 23 | ||
buildToolsVersion "23.0.2" | ||
|
||
defaultConfig { | ||
minSdkVersion 16 | ||
targetSdkVersion 23 | ||
versionCode project.ext.versionCodeInt | ||
versionName version | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
testCompile 'junit:junit:4.12' | ||
compile 'com.android.support:appcompat-v7:23.0.1' | ||
compile 'com.android.support:recyclerview-v7:23.0.1' | ||
testCompile 'junit:junit:4.12' | ||
compile 'com.android.support:appcompat-v7:23.3.0' | ||
compile 'com.android.support:recyclerview-v7:23.3.0' | ||
} | ||
|
||
|
||
task sourcesJar(type: Jar) { | ||
from android.sourceSets.main.java.srcDirs | ||
classifier = 'sources' | ||
} | ||
|
||
artifacts { | ||
archives sourcesJar | ||
} | ||
|
||
signing { | ||
required { gradle.taskGraph.hasTask("uploadArchives") } | ||
sign configurations.archives | ||
} | ||
|
||
def getReleaseRepositoryUrl() { | ||
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL | ||
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
} | ||
|
||
def getSnapshotRepositoryUrl() { | ||
return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL | ||
: "https://oss.sonatype.org/content/repositories/snapshots/" | ||
} | ||
|
||
def getRepositoryUsername() { | ||
return hasProperty('sonatypeUsername') ? sonatypeUsername : "" | ||
} | ||
|
||
def getRepositoryPassword() { | ||
return hasProperty('sonatypePassword') ? sonatypePassword : "" | ||
} | ||
|
||
uploadArchives { | ||
repositories.mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
repository(url: getReleaseRepositoryUrl()) { | ||
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) | ||
} | ||
|
||
snapshotRepository(url: getSnapshotRepositoryUrl()) { | ||
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) | ||
} | ||
|
||
pom.groupId = GROUP | ||
pom.version = version | ||
pom.artifactId = POM_ARTIFACT_ID | ||
|
||
pom { | ||
project { | ||
name POM_NAME | ||
packaging POM_PACKAGING | ||
description POM_DESCRIPTION | ||
url POM_URL | ||
|
||
scm { | ||
url POM_SCM_URL | ||
connection POM_SCM_CONNECTION | ||
developerConnection POM_SCM_DEV_CONNECTION | ||
} | ||
|
||
licenses { | ||
license { | ||
name POM_LICENCE_NAME | ||
url POM_LICENCE_URL | ||
distribution POM_LICENCE_DIST | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id POM_DEVELOPER_ID | ||
name POM_DEVELOPER_NAME | ||
email POM_DEVELOPER_EMAIL | ||
} | ||
} | ||
|
||
} | ||
} | ||
} | ||
} | ||
|
||
android.libraryVariants.all { variant -> | ||
task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) { | ||
title "Swipe Action Layout${version}" | ||
description "Generates Javadoc for $variant.name." | ||
source = variant.javaCompile.source | ||
classpath = files(variant.javaCompile.classpath.files, project.android.getBootClasspath()) | ||
exclude '**/BuildConfig.java' | ||
exclude '**/R.java' | ||
options { | ||
links "http://docs.oracle.com/javase/7/docs/api/" | ||
linksOffline "http://d.android.com/reference", "${android.sdkDirectory}/docs/reference" | ||
} | ||
} | ||
} |