diff --git a/gradle.properties b/gradle.properties index 5d08ba75b..640868a75 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,4 +15,19 @@ # When configured, Gradle will run in incubating parallel mode. # 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 \ No newline at end of file +# org.gradle.parallel=true + +VERSION_NAME=0.5.0-SNAPSHOT +VERSION_CODE=50 +GROUP=com.tundem.holokitkatdrawer + +POM_DESCRIPTION=HoloKitKatDrawer Library +POM_URL=https://github.com/mikepenz/HoloKitKatDrawer +POM_SCM_URL=https://github.com/mikepenz/HoloKitKatDrawer +POM_SCM_CONNECTION=scm:git@github.com:mikepenz/HoloKitKatDrawer.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:mikepenz/HoloKitKatDrawer.git +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo +POM_DEVELOPER_ID=mikepenz +POM_DEVELOPER_NAME=Mike Penz \ No newline at end of file diff --git a/library/gradle-mvn-push.gradle b/library/gradle-mvn-push.gradle new file mode 100644 index 000000000..6eea7b4b5 --- /dev/null +++ b/library/gradle-mvn-push.gradle @@ -0,0 +1,129 @@ +/* + * 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 + } + + android.libraryVariants.all { variant -> + def javadocTask = task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) { + description "Generates Javadoc for $variant.name." + source = variant.javaCompile.source + try { + ext.androidJar = project.files(android.getBootClasspath().join(File.pathSeparator)) + } catch (Exception e) { + ext.androidJar = project.files(android.plugin.getRuntimeJarList().join(File.pathSeparator)) + } + classpath = files(variant.javaCompile.classpath.files) + files(ext.androidJar) + exclude '**/BuildConfig.java' + exclude '**/R.java' + } + + javadocTask.dependsOn variant.javaCompile + + def jarJavadocTask = task("jar${variant.name.capitalize()}Javadoc", type: Jar) { + description "Generate Javadoc Jar for $variant.name" + classifier = 'javadoc' + from javadocTask.destinationDir + } + + jarJavadocTask.dependsOn javadocTask + artifacts.add('archives', jarJavadocTask) + + def jarSourceTask = task("jar${variant.name.capitalize()}Sources", type: Jar) { + description "Generates Java Sources for $variant.name." + classifier = 'sources' + from variant.javaCompile.source + } + + jarSourceTask.dependsOn variant.javaCompile + artifacts.add('archives', jarSourceTask) + } +} diff --git a/library/gradle.properties b/library/gradle.properties new file mode 100755 index 000000000..f88acb3fd --- /dev/null +++ b/library/gradle.properties @@ -0,0 +1,22 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Settings specified in this file will override any Gradle settings +# configured through the IDE. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# 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 + +POM_NAME=HoloKitKatDrawer Library +POM_ARTIFACT_ID=library +POM_PACKAGING=aar \ No newline at end of file diff --git a/library/proguard-rules.txt b/library/proguard-rules.txt new file mode 100644 index 000000000..98272064a --- /dev/null +++ b/library/proguard-rules.txt @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /Entwicklung/android-sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} \ No newline at end of file