-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gradle logic to publish to Binary
closes #19
- Loading branch information
1 parent
a41b4b6
commit 948493f
Showing
5 changed files
with
160 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'jacoco' | ||
apply plugin: 'com.getkeepsafe.dexcount' | ||
apply plugin: "com.github.dcendents.android-maven" | ||
|
||
group = 'com.isupatches' | ||
version = '1.0.4' | ||
group = rootProject.ext.GROUP | ||
version = rootProject.ext.VERSION_NAME | ||
|
||
def coverageSourceDirs = [ | ||
'../app/src/main/java' | ||
|
@@ -100,57 +99,6 @@ dependencies { | |
testCompile 'junit:junit:4.12' | ||
} | ||
|
||
install { | ||
repositories.mavenInstaller { | ||
pom { | ||
project { | ||
artifactId 'wisefy' | ||
packaging 'aar' | ||
|
||
name 'WiseFy' | ||
url 'https://github.com/isuPatches/WiseFy' | ||
|
||
licenses { | ||
license { | ||
name 'The Apache Software License, Version 2.0' | ||
url 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id 'isuPatches' | ||
name 'Sarah Klinefelter' | ||
email '[email protected]' | ||
} | ||
} | ||
scm { | ||
connection 'https://github.com/isuPatches/WiseFy.git' | ||
developerConnection 'https://github.com/isuPatches/WiseFy.git' | ||
url 'https://github.com/isuPatches/WiseFy' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
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)) | ||
destinationDir = file("../javadoc/") | ||
failOnError false | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: javadoc) { | ||
classifier = 'javadoc' | ||
from javadoc.destinationDir | ||
} | ||
|
||
artifacts { | ||
archives javadocJar | ||
archives sourcesJar | ||
} | ||
apply from: rootProject.file('gradle/gradle-bintray-install.gradle') | ||
apply from: rootProject.file('gradle/gradle-bintray-upload.gradle') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ buildscript { | |
classpath 'com.android.tools.build:gradle:2.2.2' | ||
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.5.6' | ||
classpath "com.github.dcendents:android-maven-gradle-plugin:1.5" | ||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.2' | ||
classpath "org.jacoco:org.jacoco.core:0.7.7.201606060606" | ||
classpath "org.jacoco:org.jacoco.agent:0.7.7.201606060606" | ||
classpath "org.jacoco:org.jacoco.report:0.7.7.201606060606" | ||
|
@@ -41,4 +42,32 @@ subprojects { | |
} | ||
} | ||
} | ||
} | ||
|
||
ext { | ||
GROUP = "com.isupatches" | ||
VERSION_NAME = "1.0.5" | ||
|
||
BINTRAY_REPO = "Maven" | ||
BINTRAY_NAME = "wisefy" | ||
|
||
LIBRARY_DESCRIPTION = "Wrapper around WifiManager and ConfigurationManager for Android" | ||
|
||
POM_PACKAGING = "aar" | ||
POM_DESCRIPTION = "wisefy" | ||
POM_URL = "https://github.com/isuPatches/WiseFy" | ||
|
||
POM_SCM_URL = "https://github.com/isuPatches/WiseFy" | ||
POM_SCM_ISSUE_URL = 'https://github.com/isuPatches/WiseFy/issues' | ||
POM_SCM_CONNECTION = "scm:git:https://github.com/isuPatches/WiseFy.git" | ||
POM_SCM_DEV_CONNECTION = "scm:git:[email protected]:isuPatches/WiseFy.git" | ||
|
||
POM_LICENSE_NAME = "The Apache Software License, Version 2.0" | ||
POM_LICENSE_URL = "http://www.apache.org/licenses/LICENSE-2.0.txt" | ||
POM_LICENSE_DIST = "repo" | ||
ALL_LICENSES = ["Apache-2.0"] | ||
|
||
POM_DEVELOPER_ID = "isuPatches" | ||
POM_DEVELOPER_NAME = "Patches Klinefelter" | ||
POM_DEVELOPER_EMAIL = "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Source: https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle | ||
|
||
apply plugin: 'com.github.dcendents.android-maven' | ||
|
||
group = GROUP // Maven Group ID for the artifact | ||
|
||
install { | ||
repositories.mavenInstaller { | ||
// This generates POM.xml with proper parameters | ||
pom.project { | ||
packaging POM_PACKAGING | ||
groupId GROUP | ||
artifactId BINTRAY_NAME | ||
|
||
name POM_DESCRIPTION | ||
description LIBRARY_DESCRIPTION | ||
url POM_URL | ||
|
||
// Set your license | ||
licenses { | ||
license { | ||
name POM_LICENSE_NAME | ||
url POM_LICENSE_URL | ||
} | ||
} | ||
developers { | ||
developer { | ||
id POM_DEVELOPER_ID | ||
name POM_DEVELOPER_NAME | ||
email POM_DEVELOPER_EMAIL | ||
} | ||
} | ||
scm { | ||
url POM_SCM_URL | ||
connection POM_SCM_CONNECTION | ||
developerConnection POM_SCM_DEV_CONNECTION | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Source: https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle | ||
|
||
apply plugin: 'com.jfrog.bintray' | ||
|
||
version = VERSION_NAME | ||
|
||
if (project.hasProperty("android")) { // Android libraries | ||
task sourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from android.sourceSets.main.java.srcDirs | ||
} | ||
|
||
task javadoc(type: Javadoc) { | ||
source = android.sourceSets.main.java.srcDirs | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
} | ||
} else { // Java libraries | ||
task sourcesJar(type: Jar, dependsOn: classes) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
} | ||
|
||
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") | ||
|
||
println("user: " + user) | ||
println("key: " + key) | ||
|
||
|
||
configurations = ['archives'] | ||
pkg { | ||
repo = BINTRAY_REPO | ||
name = BINTRAY_NAME | ||
desc = LIBRARY_DESCRIPTION | ||
websiteUrl = POM_URL | ||
vcsUrl = POM_SCM_URL | ||
issueTrackerUrl = POM_SCM_ISSUE_URL | ||
licenses = ALL_LICENSES | ||
labels = ['Wifi', 'WifiManager', 'ConnectivityManager', 'Android', 'isuPatches', 'Patches'] | ||
publish = true | ||
publicDownloadNumbers = true | ||
version { | ||
desc = LIBRARY_DESCRIPTION | ||
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' | ||
} | ||
} | ||
} | ||
} |