This repository was archived by the owner on Oct 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add publish.gradle script and release v0.1.0
- Loading branch information
Showing
5 changed files
with
135 additions
and
2 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 |
---|---|---|
|
@@ -19,13 +19,37 @@ buildscript { | |
deps.test = "com.android.support.test:runner:1.0.2" | ||
deps.espresso = "com.android.support.test.espresso:espresso-core:3.0.2" | ||
|
||
def pub = [:] | ||
ext.pub = pub | ||
|
||
pub.packaging = 'aar' | ||
pub.groupId = 'com.samelody.modapter' | ||
pub.artifactId = 'modapter' | ||
pub.libraryRepo = 'maven' | ||
pub.libraryId = 'modapter' | ||
pub.libraryName = 'Modapter' | ||
pub.libraryDescription = 'Modular adapter for Android RecyclerView.' | ||
pub.libraryVersion = deps.libVersionName | ||
pub.libraryVersionCode = deps.libVersionCode | ||
pub.siteUrl = 'https://github.com/samelody/modapter' | ||
pub.gitUrl = 'https://github.com/samelody/modapter.git' | ||
pub.issueUrl = 'https://github.com/samelody/modapter/issues' | ||
pub.developerId = 'belinwu' | ||
pub.developerName = 'Belin Wu' | ||
pub.developerEmail = '[email protected]' | ||
pub.licenseName = 'Apache License 2.0' | ||
pub.licenseUrl = 'https://raw.githubusercontent.com/samelody/modapter/master/LICENSE' | ||
pub.licenses = ["Apache-2.0"] | ||
|
||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:3.2.1' | ||
|
||
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' | ||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0' | ||
|
||
// NOTE: Do not place your application dependencies here; they belong | ||
// in the individual module build.gradle files | ||
|
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 |
---|---|---|
@@ -0,0 +1,104 @@ | ||
apply plugin: 'com.github.dcendents.android-maven' | ||
|
||
group = pub.groupId | ||
version = pub.libraryVersion | ||
|
||
install { | ||
repositories.mavenInstaller { | ||
pom { | ||
project { | ||
packaging pub.packaging | ||
groupId pub.groupId | ||
artifactId pub.artifactId | ||
version pub.libraryVersion | ||
|
||
// Add your description here | ||
name pub.libraryName | ||
description pub.libraryDescription | ||
url pub.siteUrl | ||
|
||
// Set your license | ||
licenses { | ||
license { | ||
name pub.licenseName | ||
url pub.licenseUrl | ||
} | ||
} | ||
developers { | ||
developer { | ||
id pub.developerId | ||
name pub.developerName | ||
email pub.developerEmail | ||
} | ||
} | ||
scm { | ||
connection pub.gitUrl | ||
developerConnection pub.gitUrl | ||
url pub.siteUrl | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
apply plugin: 'com.jfrog.bintray' | ||
|
||
task sourcesJar(type: Jar) { | ||
from android.sourceSets.main.java.srcDirs | ||
baseName = pub.libraryId | ||
classifier = "sources" | ||
} | ||
|
||
task javadoc(type: Javadoc) { | ||
source = android.sourceSets.main.java.srcDirs | ||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) | ||
description pub.libraryName + " Javadoc" | ||
source = android.libraryVariants["release"].javaCompile.source | ||
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar" | ||
classpath = files(android.libraryVariants["release"].javaCompile.classpath.files) + files(ext.androidJar) | ||
options.links("http://docs.oracle.com/javase/7/docs/api/") | ||
options.links("http://d.android.com/reference/") | ||
exclude '**/BuildConfig.java' | ||
exclude '**/R.java' | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: javadoc) { | ||
classifier = "javadoc" | ||
baseName = pub.libraryId | ||
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 = pub.libraryRepo | ||
name = pub.libraryId | ||
desc = pub.libraryDescription | ||
websiteUrl = pub.siteUrl | ||
vcsUrl = pub.gitUrl | ||
issueTrackerUrl = pub.issueUrl | ||
licenses = pub.licenses | ||
publish = true | ||
publicDownloadNumbers = true | ||
version { | ||
desc = pub.libraryDescription | ||
// gpg { | ||
// sign = false //Determines whether to GPG sign the files. The default is false | ||
// passphrase = properties.getProperty("bintray.gpg.password") | ||
// //Optional. The passphrase for GPG signing' | ||
// } | ||
} | ||
} | ||
} |
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