Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
[CHORE] Release configs for maven central. (#3)
Browse files Browse the repository at this point in the history
* [CHORE] Release configs for maven central.

Added configurations for releasing in maven central and updated the
ReadMe.md file with the respective integration changes.

[TESTING]

Tested the changes and released the library.
  • Loading branch information
naveenthontepu authored Jan 13, 2020
1 parent 6937f92 commit f49fdb9
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@ Android application.

### Usage:

Add the latest version of AppAnalyticsHub Android library in your applications `build.gradle` file:
Add Maven Central repository in project's `build.gradle` file:

```gradle
repositories {
mavenCentral()
}
```

Add the latest version of AppAnalyticsHub Android library in your application's `build.gradle` file:

```gradle
dependencies {
...
implementation 'com.amazon.appanalyticshub:appanalyticshub:1.0.0'
implementation 'com.amazon.appanalyticshub:appanalyticshub:0.0.1'
...
}
Expand Down
17 changes: 17 additions & 0 deletions app-analytics-hub-android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,20 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

VERSION_NAME=0.0.1
VERSION_CODE=1
GROUP=com.amazon.appanalyticshub

POM_DESCRIPTION=A library that does allows you to instrument your code with operational and behavioral metrics/analytics in your Android application.
POM_URL=https://github.com/amzn/app-analytics-hub
POM_SCM_URL=https://github.com/amzn/app-analytics-hub
POM_SCM_CONNECTION=scm:[email protected]:amzn/app-analytics-hub.git
POM_SCM_DEV_CONNECTION=scm:[email protected]:amzn/app-analytics-hub.git
POM_LICENCE_NAME=The MIT-0 Software License
POM_LICENCE_URL=https://github.com/amzn/app-analytics-hub/blob/master/LICENSE
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=naveenthontepu
POM_DEVELOPER_NAME=Naveen Thontepu
POM_DEVELOPER_ORGANIZATION=Amazon
RELEASE_REPOSITORY_URL=https://aws.oss.sonatype.org/service/local/staging/deploy/maven2/
SNAPSHOT_REPOSITORY_URL=https://aws.oss.sonatype.org/content/repositories/snapshots/
4 changes: 2 additions & 2 deletions app-analytics-hub-android/library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'com.android.library'
//apply from: 'maven-push.gradle'
apply from: 'maven-push.gradle'


android {
Expand All @@ -11,7 +11,7 @@ android {
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
versionName "0.0.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
Expand Down
4 changes: 2 additions & 2 deletions app-analytics-hub-android/library/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
POM_NAME=ProjectName
POM_ARTIFACT_ID=projectname
POM_NAME=AppAnalyticsHub
POM_ARTIFACT_ID=appanalyticshub
POM_PACKAGING=aar
41 changes: 28 additions & 13 deletions app-analytics-hub-android/library/maven-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,35 @@ def isReleaseBuild() {
}

def getReleaseRepositoryUrl() {
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
if (hasProperty('RELEASE_REPOSITORY_URL')) {
return RELEASE_REPOSITORY_URL
} else {
throw new GradleException('Release repository url is not present in gradle.properties')
}
}

def getSnapshotRepositoryUrl() {
return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
: "https://oss.sonatype.org/content/repositories/snapshots/"
if (hasProperty('SNAPSHOT_REPOSITORY_URL')) {
return SNAPSHOT_REPOSITORY_URL
} else {
throw new GradleException('Snapshot repository url is not present in gradle.properties')
}
}

def getRepositoryUsername() {
return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
if (hasProperty('NEXUS_USERNAME')) {
return NEXUS_USERNAME
} else {
throw new GradleException('Username for authentication is not provided')
}
}

def getRepositoryPassword() {
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
if (hasProperty('NEXUS_PASSWORD')) {
return NEXUS_PASSWORD
} else {
throw new GradleException('Password for authentication is not provided')
}
}

afterEvaluate { project ->
Expand Down Expand Up @@ -80,6 +94,7 @@ afterEvaluate { project ->
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
organization POM_DEVELOPER_ORGANIZATION
}
}
}
Expand All @@ -92,14 +107,14 @@ afterEvaluate { project ->
sign configurations.archives
}

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

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

task androidSourcesJar(type: Jar) {
classifier = 'sources'
Expand Down

0 comments on commit f49fdb9

Please sign in to comment.