From 9a92489ef5b0c80a2ca82b43c0fd3bc271df0615 Mon Sep 17 00:00:00 2001 From: barakat_4065 Date: Wed, 7 Sep 2016 16:52:09 +0430 Subject: [PATCH] init --- gradle/bintray-android-v1.gradle | 52 +++++++++++++++ gradle/install-v1.gradle | 44 ++++++++++++ valueselectorlib/build.gradle | 111 +++++++++++++++++-------------- 3 files changed, 156 insertions(+), 51 deletions(-) create mode 100644 gradle/bintray-android-v1.gradle create mode 100644 gradle/install-v1.gradle diff --git a/gradle/bintray-android-v1.gradle b/gradle/bintray-android-v1.gradle new file mode 100644 index 0000000..641be4c --- /dev/null +++ b/gradle/bintray-android-v1.gradle @@ -0,0 +1,52 @@ +apply plugin: 'com.jfrog.bintray' + +version = libraryVersion + +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} + +task javadoc(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} +artifacts { + archives javadocJar + archives sourcesJar +} + +// Bintray +Properties properties = new Properties() +properties.load(project.rootProject.file('local.properties').newDataInputStream()) + +bintray { + user = properties.getProperty("bintray.user") + key = properties.getProperty("bintray.apikey") + + configurations = ['archives'] + pkg { + repo = bintrayRepo + name = bintrayName + desc = libraryDescription + userOrg = orgName + websiteUrl = siteUrl + vcsUrl = gitUrl + licenses = allLicenses + publish = true + publicDownloadNumbers = true + version { + desc = libraryDescription +// gpg { +// sign = true //Determines whether to GPG sign the files. The default is false +// passphrase = properties.getProperty("bintray.gpg.password") +// //Optional. The passphrase for GPG signing' +// } + } + } +} \ No newline at end of file diff --git a/gradle/install-v1.gradle b/gradle/install-v1.gradle new file mode 100644 index 0000000..79980d1 --- /dev/null +++ b/gradle/install-v1.gradle @@ -0,0 +1,44 @@ +apply plugin: 'com.github.dcendents.android-maven' + +group = publishedGroupId // Maven Group ID for the artifact + +install { + repositories.mavenInstaller { + // This generates POM.xml with proper parameters + pom { + project { + packaging 'aar' + groupId publishedGroupId + artifactId artifact + + // Add your description here + name libraryName + description libraryDescription + url siteUrl + + // Set your license + licenses { + license { + name licenseName + url licenseUrl + } + } + developers { + developer { + id developerId + name developerName + email developerEmail + } + } + scm { + connection gitUrl + developerConnection gitUrl + url siteUrl + + } + } + } + } +} + +//from https://github.com/workarounds/bundler/blob/master/gradle/install-v1.gradle \ No newline at end of file diff --git a/valueselectorlib/build.gradle b/valueselectorlib/build.gradle index 799f216..05675e1 100644 --- a/valueselectorlib/build.gradle +++ b/valueselectorlib/build.gradle @@ -1,5 +1,8 @@ apply plugin: 'com.android.library' apply plugin: 'maven' +apply plugin: 'com.github.dcendents.android-maven' + +group='com.github.mehdi-salehi' android { compileSdkVersion 24 @@ -25,56 +28,62 @@ dependencies { compile 'com.android.support:appcompat-v7:24.2.0' } -uploadArchives { - repositories.mavenDeployer { - pom.groupId = 'com.narvancomputer' - pom.artifactId = 'ValueSelectorLib' - pom.version = '1.0.0' - // Add other pom properties here if you want (developer details / licenses) - repository(url: "file:///c:/test/") - } -} +//uploadArchives { +// repositories.mavenDeployer { +// pom.groupId = 'com.github.mehdi-salehi' +// pom.artifactId = 'ValueSelectorLib' +// pom.version = '1.0.0' +// // Add other pom properties here if you want (developer details / licenses) +// repository(url: "file:///c:/test/") +// } +//} +// +//task androidJavadocs(type: Javadoc) { +// source = android.sourceSets.main.java.srcDirs +// classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) +//} +// +//task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { +// classifier = 'javadoc' +// from androidJavadocs.destinationDir +//} +// +//task androidSourcesJar(type: Jar) { +// classifier = 'sources' +// from android.sourceSets.main.java.srcDirs +//} +// +//artifacts { +// archives androidSourcesJar +// archives androidJavadocsJar +//} -task androidJavadocs(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) -} +//ext { +// bintrayRepo = 'maven' +// bintrayName = 'ValueSelectorLib' +// +// publishedGroupId = 'https://github.com/mehdi-salehi/ValueSelectorLib' +// libraryName = 'ValueSelectorLib' +// artifact = 'valueselectorlib' +// +// libraryDescription = 'Numeric TextView with add & minus btn for android' +// +// siteUrl = 'https://github.com/mehdi-salehi/ValueSelectorLib' +// gitUrl = 'https://github.com/mehdi-salehi/ValueSelectorLib.git' +// +// libraryVersion = '1.0.0' +// +// developerId = 'mehdi-salehi' +// developerName = 'mehdi salehi' +// developerEmail = 'meh2fari@gmail.com' +// orgName = 'NarvanComputer' +// +// licenseName = 'AGPL-V3' +// licenseUrl = 'http://www.opensource.org/licenses/agpl-v3.html' +// allLicenses = ["AGPL-V3"] +//} -task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { - classifier = 'javadoc' - from androidJavadocs.destinationDir -} - -task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs -} - -artifacts { - archives androidSourcesJar - archives androidJavadocsJar -} - -ext { - bintrayRepo = 'maven' - bintrayName = 'ValueSelectorLib' - - publishedGroupId = 'com.narvancomputer' - libraryName = 'ValueSelectorLib' - artifact = 'ValueSelectorLib' - - libraryDescription = 'Numeric TextView with add & minus btn' - - siteUrl = 'https://github.com/mehdi-salehi/ValueSelectorLib' - gitUrl = 'https://github.com/mehdi-salehi/ValueSelectorLib.git' - - libraryVersion = '1.0.0' - - developerId = 'mehdi-salehi' - developerName = 'mehdi salehi' - developerEmail = 'meh2fari@gmail.com' - - licenseName = 'AGPL-V3' - licenseUrl = 'http://www.opensource.org/licenses/agpl-v3.html' - allLicenses = ["AGPL-V3"] -} +//if (project.rootProject.file('local.properties').exists()) { +// apply from: rootProject.file('gradle/install-v1.gradle') +// apply from: rootProject.file('gradle/bintray-android-v1.gradle') +//} \ No newline at end of file