18
18
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
19
*/
20
20
21
+ import com.android.builder.core.BuilderConstants
22
+
21
23
apply plugin : ' com.android.library'
22
24
25
+ version = " 0.0.1"
26
+
23
27
dependencies {
24
28
compile ' com.parse:parse-android:1.10.3'
25
29
@@ -36,5 +40,103 @@ android {
36
40
defaultConfig {
37
41
minSdkVersion 9
38
42
targetSdkVersion 21
43
+ versionName project. version
44
+ versionCode 1
45
+ }
46
+ }
47
+
48
+ android. libraryVariants. all { variant ->
49
+ def name = variant. buildType. name
50
+
51
+ def javadocTask = task(" javadoc${ variant.name.capitalize()} " , type : Javadoc ) {
52
+ description " Generates Javadoc for $variant . name . "
53
+ source = variant. javaCompile. source
54
+ ext. androidJar = " ${ android.sdkDirectory} /platforms/${ android.compileSdkVersion} /android.jar"
55
+ classpath = files(variant. javaCompile. classpath. files) + files(ext. androidJar)
56
+
57
+ options. linksOffline(" http://d.android.com/reference" , " ${ android.sdkDirectory} /docs/reference" )
58
+ options. links(" http://boltsframework.github.io/docs/android/" )
59
+
60
+ exclude ' **/BuildConfig.java'
61
+ exclude ' **/R.java'
62
+ exclude ' **/internal/**'
63
+ exclude ' **/oauth/**'
64
+ }
65
+
66
+ def javadocJarTask = task(" javadocJar${ variant.name.capitalize()} " , type : Jar , dependsOn : " javadoc${ variant.name.capitalize()} " ) {
67
+ classifier = ' javadoc'
68
+ from javadocTask. destinationDir
69
+ }
70
+
71
+ if (name. equals(BuilderConstants . RELEASE )) {
72
+ artifacts. add(' archives' , javadocJarTask);
39
73
}
40
74
}
75
+
76
+ // region Maven
77
+
78
+ apply plugin : ' maven'
79
+ apply plugin : ' signing'
80
+
81
+ def isSnapshot = version. endsWith(' -SNAPSHOT' )
82
+ def ossrhUsername = hasProperty(' NEXUS_USERNAME' ) ? NEXUS_USERNAME : System . getenv(' CI_NEXUS_USERNAME' )
83
+ def ossrhPassword = hasProperty(' NEXUS_PASSWORD' ) ? NEXUS_PASSWORD : System . getenv(' CI_NEXUS_PASSWORD' )
84
+
85
+ uploadArchives {
86
+ repositories. mavenDeployer {
87
+ beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
88
+
89
+ repository(url : " https://oss.sonatype.org/service/local/staging/deploy/maven2/" ) {
90
+ authentication(userName : ossrhUsername, password : ossrhPassword)
91
+ }
92
+
93
+ snapshotRepository(url : " https://oss.sonatype.org/content/repositories/snapshots/" ) {
94
+ authentication(userName : ossrhUsername, password : ossrhPassword)
95
+ }
96
+
97
+ pom. project {
98
+ name ' ParseUI-Widget-Android'
99
+ artifactId = ' parseui-widget-android'
100
+ packaging ' aar'
101
+ description ' A library contains ui widgets for building apps with the Parse Android SDK.'
102
+ url ' https://github.com/ParsePlatform/ParseUI-Android'
103
+
104
+ scm {
105
+ connection
' scm:[email protected] :ParsePlatform/ParseUI-Android.git'
106
+ developerConnection
' scm:[email protected] :ParsePlatform/ParseUI-Android.git'
107
+ url ' https://github.com/ParsePlatform/ParseUI-Android'
108
+ }
109
+
110
+ licenses {
111
+ license {
112
+ name ' BSD License'
113
+ url ' https://github.com/ParsePlatform/ParseUI-Android/blob/master/LICENSE'
114
+ distribution ' repo'
115
+ }
116
+ }
117
+
118
+ developers {
119
+ developer {
120
+ id ' parse'
121
+ name ' Parse'
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+
128
+ signing {
129
+ required { ! isSnapshot && gradle. taskGraph. hasTask(" uploadArchives" ) }
130
+ sign configurations. archives
131
+ }
132
+
133
+ task androidSourcesJar (type : Jar ) {
134
+ classifier = ' sources'
135
+ from android. sourceSets. main. java. sourceFiles
136
+ }
137
+
138
+ artifacts {
139
+ archives androidSourcesJar
140
+ }
141
+
142
+ // endregion
0 commit comments