diff --git a/.gitignore b/.gitignore index 62f33f2..a597fa0 100644 --- a/.gitignore +++ b/.gitignore @@ -29,5 +29,8 @@ proguard/ .idea/ .gradle/ +gradle/ +gradlew +gradlew.bat build/ .DS_Store diff --git a/ResideMenu/build.gradle b/ResideMenu/build.gradle index 3f9e78e..0d26fa4 100644 --- a/ResideMenu/build.gradle +++ b/ResideMenu/build.gradle @@ -7,14 +7,12 @@ repositories { android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion - useOldManifestMerger true defaultConfig { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion } buildTypes { release { - runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } @@ -30,4 +28,6 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) -} \ No newline at end of file +} + +apply from: '../maven_push.gradle' diff --git a/ResideMenu/gradle.properties b/ResideMenu/gradle.properties new file mode 100644 index 0000000..c29dafd --- /dev/null +++ b/ResideMenu/gradle.properties @@ -0,0 +1,3 @@ +POM_NAME=AndroidResideMenu +POM_ARTIFACT_ID=residemenu +POM_PACKAGING=aar \ No newline at end of file diff --git a/ResideMenuDemo/build.gradle b/ResideMenuDemo/build.gradle index 6ffe5e1..10a9ea8 100644 --- a/ResideMenuDemo/build.gradle +++ b/ResideMenuDemo/build.gradle @@ -19,7 +19,6 @@ dependencies { android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion - useOldManifestMerger true dexOptions { jumboMode = true diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..a507936 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,14 @@ +VERSION_NAME=1.6 +VERSION_CODE=8 +POM_GROUP_ID=com.specyci +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. +POM_URL=https://github.com/SpecialCyCi/AndroidResideMenu +POM_SCM_URL=https://github.com/SpecialCyCi/AndroidResideMenu +POM_SCM_CONNECTION=scm:git@github.com:survivingwithandroid/weatherlib.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:SpecialCyCi/AndroidResideMenu.git +POM_LICENCE_NAME=The MIT License (MIT) +POM_LICENCE_URL=https://raw.githubusercontent.com/SpecialCyCi/AndroidResideMenu/master/LICENSE +POM_LICENCE_DIST=repo +POM_DEVELOPER_ID=specialcyci +POM_DEVELOPER_NAME=Special Leung +POM_INCEPTION_YEAR=2013 diff --git a/maven_push.gradle b/maven_push.gradle new file mode 100644 index 0000000..fce968c --- /dev/null +++ b/maven_push.gradle @@ -0,0 +1,106 @@ +apply plugin: 'maven' +apply plugin: 'signing' + +def isReleaseBuild() { + return VERSION_NAME.contains("SNAPSHOT") == false +} + +def sonatypeRepositoryUrl +if (isReleaseBuild()) { + println 'RELEASE BUILD' + sonatypeRepositoryUrl = hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL + : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" +} else { + println 'SNAPSHOT BUILD' + sonatypeRepositoryUrl = hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL + : "https://oss.sonatype.org/content/repositories/snapshots/" + +} + +def getRepositoryUsername() { + return hasProperty('nexusUsername') ? nexusUsername : "" +} + +def getRepositoryPassword() { + return hasProperty('nexusPassword') ? nexusPassword : "" +} + +afterEvaluate { project -> + uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + pom.artifactId = POM_ARTIFACT_ID + + repository(url: sonatypeRepositoryUrl) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + + pom.project { + name POM_NAME + groupId POM_GROUP_ID + version VERSION_NAME + packaging POM_PACKAGING + description POM_DESCRIPTION + url POM_URL + inceptionYear POM_INCEPTION_YEAR + + 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) { + failOnError false + source = android.sourceSets.main.java.source + options { + links "http://docs.oracle.com/javase/7/docs/api/" + linksOffline "http://d.android.com/reference", "${android.sdkDirectory}/docs/reference" + } + classpath += project.android.libraryVariants.toList().first().javaCompile.classpath + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + } + + task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { + classifier = 'javadoc' + //basename = artifact_id + from androidJavadocs.destinationDir + } + + task androidSourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.srcDirs + } + + artifacts { + //archives packageReleaseJar + archives androidSourcesJar + archives androidJavadocsJar + } +} diff --git a/settings.gradle b/settings.gradle index 78f7e3d..3db9ac1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,5 +7,5 @@ if (!System.properties['buildToolsVersion']) { } if (!System.properties['androidGradlePluginVersion']) { - System.properties['androidGradlePluginVersion'] = "0.12.+" + System.properties['androidGradlePluginVersion'] = "1.0.+" } \ No newline at end of file