Skip to content

Commit a962d86

Browse files
author
liujianyue
committed
Upload to jcenter
1 parent 4c66947 commit a962d86

File tree

7 files changed

+137
-2
lines changed

7 files changed

+137
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ junit/
1919

2020
# Local configuration file (sdk path, etc)
2121
local.properties
22+
deploy.properties
2223

2324
# Local Eclipse settings files
2425
*.settings

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ A ViewPager that can scroll automatically. Compatible with ViewPagerIndicator.
55

66
![](art/demo.gif)
77

8+
Setup
9+
========
10+
11+
```
12+
allprojects {
13+
repositories {
14+
jcenter()
15+
}
16+
}
17+
```
18+
19+
```
20+
dependencies {
21+
compile 'me.angeldevil:AutoScrollViewPager:1.0.1'
22+
}
23+
```
24+
825
Usage
926
========
1027

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ buildscript {
66
}
77
dependencies {
88
classpath 'com.android.tools.build:gradle:2.3.3'
9+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
10+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.2'
911

1012
// NOTE: Do not place your application dependencies here; they belong
1113
// in the individual module build.gradle files

gradlew

100644100755
File mode changed.

library/build.gradle

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
apply plugin: 'com.android.library'
22

3+
group = 'me.angeldevil'
4+
version = "1.0.1"
5+
36
android {
47
compileSdkVersion 26
58
buildToolsVersion "25.0.2"
69

710
defaultConfig {
811
minSdkVersion 14
912
targetSdkVersion 26
10-
versionCode 1
11-
versionName "1.0"
13+
versionCode 2
14+
versionName "1.0.1"
1215
}
1316
buildTypes {
1417
release {
@@ -22,3 +25,10 @@ dependencies {
2225
compile fileTree(dir: 'libs', include: ['*.jar'])
2326
provided 'com.android.support:support-v4:26.0.2'
2427
}
28+
29+
// deploy
30+
File deployConfig = project.file('deploy.properties')
31+
if (deployConfig.exists()) {
32+
apply from: "deployBintray.gradle"
33+
}
34+

library/deployBintray.gradle

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
apply plugin: 'com.github.dcendents.android-maven'
2+
apply plugin: 'com.jfrog.bintray'
3+
4+
Properties properties = new Properties()
5+
File projectPropertiesFile = project.file('project.properties')
6+
if (projectPropertiesFile.exists()) {
7+
properties.load(projectPropertiesFile.newDataInputStream())
8+
} else {
9+
throw new Error("Cannot find project.properties file in " + project.name + " folder")
10+
}
11+
12+
File localPropertiesFile = project.file("deploy.properties")
13+
if (localPropertiesFile.exists()) {
14+
properties.load(localPropertiesFile.newDataInputStream())
15+
} else {
16+
throw new Error("Cannot find deploy.properties file in " + project.name + " folder")
17+
}
18+
19+
install {
20+
repositories.mavenInstaller {
21+
// This generates POM.xml with proper parameters
22+
pom {
23+
project {
24+
packaging properties.getProperty("project.packaging")
25+
name properties.getProperty("project.name")
26+
groupId properties.getProperty("project.groupId")
27+
artifactId properties.getProperty("project.artifactId")
28+
url properties.getProperty("project.siteUrl")
29+
licenses {
30+
license {
31+
name properties.getProperty("license.name")
32+
url properties.getProperty("license.url")
33+
}
34+
}
35+
developers {
36+
developer {
37+
id properties.getProperty("developer.id")
38+
name properties.getProperty("developer.name")
39+
email properties.getProperty("developer.email")
40+
}
41+
}
42+
scm {
43+
connection properties.getProperty("project.gitUrl")
44+
developerConnection properties.getProperty("project.gitUrl")
45+
url properties.getProperty("project.siteUrl")
46+
}
47+
}
48+
}
49+
}
50+
}
51+
52+
task sourcesJar(type: Jar) {
53+
from android.sourceSets.main.java.srcDirs
54+
classifier = 'sources'
55+
}
56+
57+
task javadoc(type: Javadoc) {
58+
failOnError false
59+
source = android.sourceSets.main.java.srcDirs
60+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
61+
}
62+
63+
task javadocJar(type: Jar, dependsOn: javadoc) {
64+
classifier = 'javadoc'
65+
from javadoc.destinationDir
66+
}
67+
68+
artifacts {
69+
archives javadocJar
70+
archives sourcesJar
71+
}
72+
73+
bintray {
74+
user = properties.getProperty("bintray.user")
75+
key = properties.getProperty("bintray.apikey")
76+
configurations = ['archives']
77+
pkg {
78+
repo = properties.getProperty("project.repo")
79+
name = properties.getProperty("project.name")
80+
websiteUrl = properties.getProperty("project.siteUrl")
81+
vcsUrl = properties.getProperty("project.gitUrl")
82+
licenses = ["Apache-2.0"]
83+
publish = true
84+
}
85+
}
86+
javadoc {
87+
options{
88+
encoding "UTF-8"
89+
charSet "UTF-8"
90+
}
91+
}

library/project.properties

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#project
2+
project.repo=Maven
3+
project.name=AutoScrollViewPager
4+
project.groupId=me.angeldevil
5+
project.artifactId=AutoScrollViewPager
6+
project.packaging=aar
7+
project.siteUrl=https://github.com/angeldevil/AutoScrollViewPager
8+
project.gitUrl=https://github.com/angeldevil/AutoScrollViewPager.git
9+
10+
#javadoc
11+
javadoc.name=AutoScrollViewPager
12+
13+
license.name=The Apache Software License, Version 2.0
14+
license.url=http://www.apache.org/licenses/LICENSE-2.0

0 commit comments

Comments
 (0)