From 52594b7c59f29c38ca3fbea947f02ab603c89f9d Mon Sep 17 00:00:00 2001 From: Nipun Birla Date: Sun, 18 Jun 2017 21:45:34 +0530 Subject: [PATCH] changes --- .gitignore | 89 ++++++++++++++++++++++++++-- .idea/misc.xml | 2 +- boxloader2/build.gradle | 1 + boxloader2/gradle.properties | 3 + boxloader2/maven-push.gradle | 112 +++++++++++++++++++++++++++++++++++ gradle.properties | 15 +++++ 6 files changed, 215 insertions(+), 7 deletions(-) create mode 100644 boxloader2/gradle.properties create mode 100644 boxloader2/maven-push.gradle diff --git a/.gitignore b/.gitignore index 39fb081..fe2e20b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,86 @@ -*.iml -.gradle -/local.properties +# [Android] ======================== +# Built application files +*.apk +*.ap_ + +# Files for the Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ + +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + + +## Directory-based project format: +.idea/ + +## File-based project format: +*.ipr +*.iws + +## Plugin-specific files: + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml + + +# [Maven] ======================== +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties + + +# [Gradle-Android] ======================== + +# Ignore Gradle GUI config +gradle-app.setting + +# Gradle Signing +signing.properties +trestle.keystore + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# Misc /.idea/workspace.xml -/.idea/libraries .DS_Store -/build /captures -.externalNativeBuild +**/*.iml +*.class \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 66e797c..6657542 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -59,7 +59,7 @@ - + diff --git a/boxloader2/build.gradle b/boxloader2/build.gradle index ab0d055..25ef474 100644 --- a/boxloader2/build.gradle +++ b/boxloader2/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'com.android.library' +apply from: 'maven-push.gradle' android { compileSdkVersion 25 diff --git a/boxloader2/gradle.properties b/boxloader2/gradle.properties new file mode 100644 index 0000000..243ddc3 --- /dev/null +++ b/boxloader2/gradle.properties @@ -0,0 +1,3 @@ +POM_NAME=BoxLoaderView +POM_ARTIFACT_ID=BoxLoaderView +POM_PACKAGING=aar \ No newline at end of file diff --git a/boxloader2/maven-push.gradle b/boxloader2/maven-push.gradle new file mode 100644 index 0000000..2f96fe1 --- /dev/null +++ b/boxloader2/maven-push.gradle @@ -0,0 +1,112 @@ +/* + * 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 + } + + //task androidJavadocs(type: Javadoc) { + //source = android.sourceSets.main.allJava + //} + + //task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { + //classifier = 'javadoc' + //from androidJavadocs.destinationDir + //} + + task androidSourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.sourceFiles + } + + artifacts { + archives androidSourcesJar + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index aac7c9b..1462660 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,3 +15,18 @@ org.gradle.jvmargs=-Xmx1536m # 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 + +VERSION_NAME=0.0.1 +VERSION_CODE=1 +GROUP=com.github.nipun-birla + +POM_DESCRIPTION=A library that does X, Y, and Z +POM_URL=https://github.com/nipun-birla/BoxLoaderView +POM_SCM_URL=https://github.com/nipun-birla/BoxLoaderView +POM_SCM_CONNECTION=scm:git@github.com:nipun-birla/BoxLoaderView.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:nipun-birla/BoxLoaderView.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=nipun-birla +POM_DEVELOPER_NAME=Nipun Birla \ No newline at end of file