Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-salehi committed Sep 7, 2016
1 parent 0b5747e commit 9a92489
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 51 deletions.
52 changes: 52 additions & 0 deletions gradle/bintray-android-v1.gradle
Original file line number Diff line number Diff line change
@@ -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'
// }
}
}
}
44 changes: 44 additions & 0 deletions gradle/install-v1.gradle
Original file line number Diff line number Diff line change
@@ -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
111 changes: 60 additions & 51 deletions valueselectorlib/build.gradle
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 = '[email protected]'
// 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 = '[email protected]'

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')
//}

0 comments on commit 9a92489

Please sign in to comment.