Skip to content

Commit e776c59

Browse files
committed
Release to maven central.
1 parent 8b7eff3 commit e776c59

File tree

7 files changed

+130
-5
lines changed

7 files changed

+130
-5
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,8 @@ proguard/
2929
.idea/
3030

3131
.gradle/
32+
gradle/
33+
gradlew
34+
gradlew.bat
3235
build/
3336
.DS_Store

ResideMenu/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ repositories {
77
android {
88
compileSdkVersion rootProject.ext.compileSdkVersion
99
buildToolsVersion rootProject.ext.buildToolsVersion
10-
useOldManifestMerger true
1110
defaultConfig {
1211
minSdkVersion rootProject.ext.minSdkVersion
1312
targetSdkVersion rootProject.ext.targetSdkVersion
1413
}
1514
buildTypes {
1615
release {
17-
runProguard false
1816
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
1917
}
2018
}
@@ -30,4 +28,6 @@ android {
3028

3129
dependencies {
3230
compile fileTree(dir: 'libs', include: ['*.jar'])
33-
}
31+
}
32+
33+
apply from: '../maven_push.gradle'

ResideMenu/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
POM_NAME=AndroidResideMenu
2+
POM_ARTIFACT_ID=residemenu
3+
POM_PACKAGING=aar

ResideMenuDemo/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ dependencies {
1919
android {
2020
compileSdkVersion rootProject.ext.compileSdkVersion
2121
buildToolsVersion rootProject.ext.buildToolsVersion
22-
useOldManifestMerger true
2322

2423
dexOptions {
2524
jumboMode = true

gradle.properties

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
VERSION_NAME=1.6
2+
VERSION_CODE=8
3+
POM_GROUP_ID=com.specyci
4+
POM_DESCRIPTION=The idea of ResideMenu is from Dribbble 1 and 2. It has come true and run in iOS devices. iOS ResideMenu This project is the RefsideMenu Android version. The visual effect is partly referred to iOS version of ResideMenu. And thanks to the authors for the above idea and contribution.
5+
POM_URL=https://github.com/SpecialCyCi/AndroidResideMenu
6+
POM_SCM_URL=https://github.com/SpecialCyCi/AndroidResideMenu
7+
POM_SCM_CONNECTION=scm:[email protected]:survivingwithandroid/weatherlib.git
8+
POM_SCM_DEV_CONNECTION=scm:[email protected]:SpecialCyCi/AndroidResideMenu.git
9+
POM_LICENCE_NAME=The MIT License (MIT)
10+
POM_LICENCE_URL=https://raw.githubusercontent.com/SpecialCyCi/AndroidResideMenu/master/LICENSE
11+
POM_LICENCE_DIST=repo
12+
POM_DEVELOPER_ID=specialcyci
13+
POM_DEVELOPER_NAME=Special Leung
14+
POM_INCEPTION_YEAR=2013

maven_push.gradle

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
apply plugin: 'maven'
2+
apply plugin: 'signing'
3+
4+
def isReleaseBuild() {
5+
return VERSION_NAME.contains("SNAPSHOT") == false
6+
}
7+
8+
def sonatypeRepositoryUrl
9+
if (isReleaseBuild()) {
10+
println 'RELEASE BUILD'
11+
sonatypeRepositoryUrl = hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
12+
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
13+
} else {
14+
println 'SNAPSHOT BUILD'
15+
sonatypeRepositoryUrl = hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
16+
: "https://oss.sonatype.org/content/repositories/snapshots/"
17+
18+
}
19+
20+
def getRepositoryUsername() {
21+
return hasProperty('nexusUsername') ? nexusUsername : ""
22+
}
23+
24+
def getRepositoryPassword() {
25+
return hasProperty('nexusPassword') ? nexusPassword : ""
26+
}
27+
28+
afterEvaluate { project ->
29+
uploadArchives {
30+
repositories {
31+
mavenDeployer {
32+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
33+
34+
pom.artifactId = POM_ARTIFACT_ID
35+
36+
repository(url: sonatypeRepositoryUrl) {
37+
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
38+
}
39+
40+
pom.project {
41+
name POM_NAME
42+
groupId POM_GROUP_ID
43+
version VERSION_NAME
44+
packaging POM_PACKAGING
45+
description POM_DESCRIPTION
46+
url POM_URL
47+
inceptionYear POM_INCEPTION_YEAR
48+
49+
scm {
50+
url POM_SCM_URL
51+
connection POM_SCM_CONNECTION
52+
developerConnection POM_SCM_DEV_CONNECTION
53+
}
54+
55+
licenses {
56+
license {
57+
name POM_LICENCE_NAME
58+
url POM_LICENCE_URL
59+
distribution POM_LICENCE_DIST
60+
}
61+
}
62+
63+
developers {
64+
developer {
65+
id POM_DEVELOPER_ID
66+
name POM_DEVELOPER_NAME
67+
}
68+
}
69+
}
70+
}
71+
}
72+
}
73+
74+
signing {
75+
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
76+
sign configurations.archives
77+
}
78+
79+
task androidJavadocs(type: Javadoc) {
80+
failOnError false
81+
source = android.sourceSets.main.java.source
82+
options {
83+
links "http://docs.oracle.com/javase/7/docs/api/"
84+
linksOffline "http://d.android.com/reference", "${android.sdkDirectory}/docs/reference"
85+
}
86+
classpath += project.android.libraryVariants.toList().first().javaCompile.classpath
87+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
88+
}
89+
90+
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
91+
classifier = 'javadoc'
92+
//basename = artifact_id
93+
from androidJavadocs.destinationDir
94+
}
95+
96+
task androidSourcesJar(type: Jar) {
97+
classifier = 'sources'
98+
from android.sourceSets.main.java.srcDirs
99+
}
100+
101+
artifacts {
102+
//archives packageReleaseJar
103+
archives androidSourcesJar
104+
archives androidJavadocsJar
105+
}
106+
}

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ if (!System.properties['buildToolsVersion']) {
77
}
88

99
if (!System.properties['androidGradlePluginVersion']) {
10-
System.properties['androidGradlePluginVersion'] = "0.12.+"
10+
System.properties['androidGradlePluginVersion'] = "1.0.+"
1111
}

0 commit comments

Comments
 (0)