Skip to content

Commit

Permalink
version 2.0.0, upload to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
lizhuogui committed Jun 2, 2019
1 parent c26c397 commit 5491a5b
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 6 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ A beautiful cover flow for android platform , base on ViewPager.
### Thanks
[vincent-paing](https://github.com/vincent-paing)

### AndroidX

```
dependencies {
implementation 'com.github.lizhuogui.android:coverflow:2.0.0'
}
```

### Build
##### Step 1. Add the JitPack repository to your build file
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ task clean(type: Delete) {
def androidxVersion = "1.0.0"
def materialVersion = "1.0.0"

ext{
ext {
legacySupportV4 = "androidx.legacy:legacy-support-v4:${androidxVersion}"
appCompat = "androidx.appcompat:appcompat:${androidxVersion}"
cardView = "androidx.cardview:cardview:${androidxVersion}"
materialDesign = "com.google.android.material:material:${materialVersion}"
cardView = "androidx.cardview:cardview:${androidxVersion}"
materialDesign = "com.google.android.material:material:${materialVersion}"

}
6 changes: 4 additions & 2 deletions coverflow/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 28
versionCode 2
versionName "1.0.2"
versionCode 200
versionName "2.0.0"
}
buildTypes {
release {
Expand All @@ -28,3 +28,5 @@ dependencies {
testImplementation 'junit:junit:4.12'
implementation rootProject.ext.legacySupportV4
}

apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
3 changes: 3 additions & 0 deletions coverflow/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_NAME=Android-Coverflow Library
POM_ARTIFACT_ID=coverflow
POM_PACKAGING=aar
16 changes: 15 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,19 @@
# 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
VERSION_NAME=2.0.0
VERSION_CODE=200
GROUP=com.github.lizhuogui.android
POM_DESCRIPTION=A beautiful cover flow for android platform , base on ViewPager.
POM_URL=https://github.com/lizhuogui/Android-Coverflow
POM_SCM_URL=https://github.com/lizhuogui/Android-Coverflow
POM_SCM_CONNECTION=scm:[email protected]:lizhuogui/Android-Coverflow.git
POM_SCM_DEV_CONNECTION=scm:[email protected]:lizhuogui/Android-Coverflow.git
POM_LICENCE_NAME=MIT License
POM_LICENCE_URL=https://github.com/lizhuogui/Android-Coverflow/blob/master/LICENSE
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=lizhuogui
POM_DEVELOPER_NAME=lizhuogui

android.enableJetifier=true
android.useAndroidX=true
android.useAndroidX=true
114 changes: 114 additions & 0 deletions gradle/gradle-mvn-push.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*
* 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.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

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

0 comments on commit 5491a5b

Please sign in to comment.