Skip to content

Commit

Permalink
Initial setup for maven artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
Etienne Lawlor committed Jun 27, 2015
1 parent d582746 commit 52cf6a2
Show file tree
Hide file tree
Showing 233 changed files with 172 additions and 22 deletions.
28 changes: 25 additions & 3 deletions .gitignore
@@ -1,6 +1,3 @@
**/*.iml


# [Android] ========================
# Built application files
*.apk
Expand All @@ -20,6 +17,9 @@ gen/
.gradle/
build/

# Gradle configuration file
gradle.properties

# Local configuration file (sdk path, etc)
local.properties

Expand Down Expand Up @@ -65,3 +65,25 @@ release.properties

# Ignore Gradle GUI config
gradle-app.setting

# Gradle Signing
signing.properties
quickreturn.keystore

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# Misc
/.idea/workspace.xml
.DS_Store
/captures
**/*.iml
*.class
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.1'
classpath 'com.android.tools.build:gradle:1.2.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
17 changes: 16 additions & 1 deletion gradle.properties
Expand Up @@ -15,4 +15,19 @@
# 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

VERSION_NAME=0.0.1
VERSION_CODE=1
GROUP=com.github.quickreturn

POM_DESCRIPTION=Showcases QuickReturn UI Pattern as either a header, footer, or both header and footer
POM_URL=https://github.com/lawloretienne/QuickReturn
POM_SCM_URL=https://github.com/lawloretienne/QuickReturn
POM_SCM_CONNECTION=scm:git@github.com:lawloretienne/QuickReturn.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:lawloretienne/QuickReturn.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=lawloretienne
POM_DEVELOPER_NAME=Etienne Lawlor
11 changes: 6 additions & 5 deletions library/build.gradle
@@ -1,14 +1,15 @@
apply plugin: 'com.android.library'
apply from: 'maven-push.gradle'

android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
minSdkVersion 14
targetSdkVersion 21
targetSdkVersion 22
versionCode 1
versionName "1.0"
versionName "0.0.1"
}
buildTypes {
release {
Expand All @@ -19,6 +20,6 @@ android {
}

dependencies {
compile 'com.android.support:recyclerview-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
112 changes: 112 additions & 0 deletions library/maven-push.gradle
@@ -0,0 +1,112 @@
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

apply plugin: 'maven'
apply plugin: 'signing'

def isReleaseBuild() {
return VERSION_NAME.contains("SNAPSHOT") == false
}

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('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
}

def getRepositoryPassword() {
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
}

afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

pom.groupId = GROUP
pom.artifactId = POM_ARTIFACT_ID
pom.version = VERSION_NAME

repository(url: getReleaseRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
snapshotRepository(url: getSnapshotRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}

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
}
}
}
}
}
}

signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}

//task androidJavadocs(type: Javadoc) {
//source = android.sourceSets.main.allJava
//}

//task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
//classifier = 'javadoc'
//from androidJavadocs.destinationDir
//}

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

artifacts {
archives androidSourcesJar
}
}
File renamed without changes.
22 changes: 11 additions & 11 deletions app/build.gradle → sample/build.gradle
@@ -1,15 +1,15 @@
apply plugin: 'android'
apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion '21.1.2'
compileSdkVersion 22
buildToolsVersion '22.0.1'

defaultConfig {
applicationId 'com.etiennelawlor.quickreturn'
minSdkVersion 14
targetSdkVersion 21
versionCode 20
versionName '0.0.20'
targetSdkVersion 22
versionCode 1
versionName '0.0.1'
}
signingConfigs {
release {
Expand Down Expand Up @@ -39,11 +39,11 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])

compile 'com.android.support:support-v13:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.3'
compile 'com.android.support:palette-v7:21.0.3'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:cardview-v7:21.0.3'
compile 'com.android.support:support-v13:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.android.support:palette-v7:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'

compile 'com.astuetz:pagerslidingtabstrip:1.0.1'

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion settings.gradle
@@ -1 +1 @@
include ':app', ':library'
include ':sample', ':library'

0 comments on commit 52cf6a2

Please sign in to comment.