Skip to content

Commit

Permalink
Bintray release scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
maltaisn committed Jan 5, 2020
1 parent 768d68a commit 6aa43d6
Show file tree
Hide file tree
Showing 13 changed files with 249 additions and 90 deletions.
24 changes: 11 additions & 13 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,18 @@ mockitoAndroidVersion=3.2.0
dokkaVersion=0.10.0

# Publishing
bintrayRepo=icon-dialog
bintrayName=icon-dialog
publishGroupId=com.maltaisn
publishDeveloperId=maltaisn

publishedGroupId=com.maltaisn
libraryName=icondialog
artifact=icondialog
publishDescription=Icon dialog for Android

libraryDescription=Icon dialog for Android
publishGithubRepo=maltaisn/icondialoglib
publishGithubReadme=README.md

siteUrl=https://github.com/maltaisn/icondialoglib
gitUrl=https://github.com/maltaisn/icondialoglib.git
publishRepoUrl=https://github.com/maltaisn/icondialoglib
publishRepoConnection=scm:[email protected]:maltaisn/icondialoglib.git
publishRepoIssues=https://github.com/maltaisn/icondialoglib/issues

developerId=maltaisn

license=Apache-2.0
licenseName=The Apache Software License, Version 2.0
licenseUrl=http://www.apache.org/licenses/LICENSE-2.0.txt
publishLicense=Apache-2.0
publishLicenseName=The Apache Software License, Version 2.0
publishLicenseUrl=http://www.apache.org/licenses/LICENSE-2.0.txt
96 changes: 96 additions & 0 deletions iconpacks/iconpack-default/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
Copyright (c) 2014, Austin Andrews (http://materialdesignicons.com/),
with Reserved Font Name Material Design Icons.
Copyright (c) 2014, Google (http://www.google.com/design/)
uses the license at https://github.com/google/material-design-icons/blob/master/LICENSE

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
8 changes: 8 additions & 0 deletions iconpacks/iconpack-default/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation "androidx.annotation:annotation:$annotationsVersion"
}

tasks.withType(Javadoc).all {
enabled = false
}

if (project.hasProperty("publishAll") || project.hasProperty("publishDefaultPack")) {
apply from: "../../release.gradle"
}
2 changes: 2 additions & 0 deletions iconpacks/iconpack-default/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
publishName=Default icon pack
publishArtifactId=iconpack-default
4 changes: 4 additions & 0 deletions iconpacks/iconpack-fa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation "androidx.annotation:annotation:$annotationsVersion"
}

if (project.hasProperty("publishAll") || project.hasProperty("publishFaPack")) {
apply from: "../../release.gradle"
}
2 changes: 2 additions & 0 deletions iconpacks/iconpack-fa/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
publishName=Font Awesome icon pack
publishArtifactId=iconpack-font-awesome
4 changes: 4 additions & 0 deletions iconpacks/iconpack-mdi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation "androidx.annotation:annotation:$annotationsVersion"
}

if (project.hasProperty("publishAll") || project.hasProperty("publishMdiPack")) {
apply from: "../../release.gradle"
}
2 changes: 2 additions & 0 deletions iconpacks/iconpack-mdi/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
publishName=Community Material Design Icons pack
publishArtifactId=iconpack-community-material
32 changes: 0 additions & 32 deletions lib/bintray.gradle

This file was deleted.

11 changes: 2 additions & 9 deletions lib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
plugins {
id "com.android.library"
id "kotlin-android"
id "org.jetbrains.dokka"
}

ext {
// Auto generate version code based on version name
libVersionCode = versionToCode(libVersion)
allLicenses = [license]
}

android {
Expand Down Expand Up @@ -55,11 +53,6 @@ dependencies {
androidTestImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:$kotlinMockitoVersion"
}

dokka {
outputFormat = "html"
outputDirectory = "${rootProject.projectDir}/docs/"
if (project.hasProperty("publishAll") || project.hasProperty("publishLib")) {
apply from: "../release.gradle"
}
tasks.withType(Javadoc).all { enabled = false }

apply from: "maven-install.gradle"
apply from: "bintray.gradle"
2 changes: 2 additions & 0 deletions lib/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
publishName=Icon dialog library
publishArtifactId=icon-dialog
36 changes: 0 additions & 36 deletions lib/maven-install.gradle

This file was deleted.

116 changes: 116 additions & 0 deletions release.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
apply plugin: "com.jfrog.bintray"

afterEvaluate { project ->
apply plugin: "maven-publish"
apply plugin: "com.github.dcendents.android-maven"

def versionName = android.defaultConfig.versionName

task androidJavadocs(type: Javadoc) {
failOnError = false
source = android.sourceSets.main.java.source
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.source
}

bintray {
dryRun = false
publish = true
override = true
user = project.property("bintray.user")
key = project.property("bintray.apikey")

publications("release")

pkg {
publish = true

repo = "icon-dialog"
name = publishGroupId + ":" + publishArtifactId
desc = publishDescription

websiteUrl = publishRepoUrl
issueTrackerUrl = publishRepoIssues
vcsUrl = publishRepoUrl

githubRepo = publishGithubRepo
githubReleaseNotesFile = publishGithubReadme

publicDownloadNumbers = true
licenses = [publishLicense]
version {
name = versionName
vcsTag = versionName
released = new Date()

mavenCentralSync {
sync = true
user = project.property("ossrhUsername")
password = project.property("ossrhPassword")
close = "1"
}
}
}
}

def pomConfig = {
licenses {
license {
name publishLicenseName
url publishLicenseUrl
}
}
developers {
developer {
id publishDeveloperId
}
}
scm {
url publishRepoUrl
connection publishRepoConnection
developerConnection publishRepoConnection
}
}

publishing {
publications {
release(MavenPublication) {
groupId publishGroupId
artifactId publishArtifactId
version versionName
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
artifact androidSourcesJar
artifact androidJavadocsJar

pom.withXml {
asNode().appendNode("name", publishName)
asNode().appendNode("description", publishDescription)
asNode().appendNode("url", publishRepoUrl)
def dependenciesNode = asNode().appendNode("dependencies")
configurations.implementation.allDependencies.each {
// Ensure dependencies such as fileTree are not included.
if (it.name != "unspecified") {
def dependencyNode = dependenciesNode.appendNode("dependency")
if (it.version != "unspecified") {
dependencyNode.appendNode("groupId", it.group)
dependencyNode.appendNode("artifactId", it.name)
dependencyNode.appendNode("version", it.version)
dependencyNode.appendNode("scope", "compile")
}
}
}
asNode().children().last() + pomConfig
}
}
}
}
}

0 comments on commit 6aa43d6

Please sign in to comment.