diff --git a/AndroidBootstrap/build.gradle b/AndroidBootstrap/build.gradle index d0d7793..bbf2dfa 100644 --- a/AndroidBootstrap/build.gradle +++ b/AndroidBootstrap/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'com.android.library' -apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle' +apply from: 'push.gradle' android { compileSdkVersion 23 diff --git a/AndroidBootstrap/push.gradle b/AndroidBootstrap/push.gradle new file mode 100644 index 0000000..9b116f0 --- /dev/null +++ b/AndroidBootstrap/push.gradle @@ -0,0 +1,113 @@ +/* + * Copyright 2013 Chris Banes + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +apply plugin: 'maven' +apply plugin: 'signing' + +def isReleaseBuild() { + return VERSION_NAME.contains("SNAPSHOT") == false +} + +def getReleaseRepositoryUrl() { + return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL + : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" +} + +def getSnapshotRepositoryUrl() { + return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL + : "https://oss.sonatype.org/content/repositories/snapshots/" +} + +def getRepositoryUsername() { + return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "" +} + +def getRepositoryPassword() { + return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "" +} + +afterEvaluate { project -> + uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + pom.groupId = GROUP + pom.artifactId = POM_ARTIFACT_ID + pom.version = VERSION_NAME + + repository(url: getReleaseRepositoryUrl()) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + snapshotRepository(url: getSnapshotRepositoryUrl()) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + + pom.project { + name POM_NAME + packaging POM_PACKAGING + description POM_DESCRIPTION + url POM_URL + + scm { + url POM_SCM_URL + connection POM_SCM_CONNECTION + developerConnection POM_SCM_DEV_CONNECTION + } + + licenses { + license { + name POM_LICENCE_NAME + url POM_LICENCE_URL + distribution POM_LICENCE_DIST + } + } + + developers { + developer { + id POM_DEVELOPER_ID + name POM_DEVELOPER_NAME + } + } + } + } + } + } + + signing { + required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } + sign configurations.archives + } + + 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.sourceFiles + } + + artifacts { + archives androidSourcesJar + archives androidJavadocsJar + } +} \ No newline at end of file diff --git a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapBaseThumbnail.java b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapBaseThumbnail.java index 0643a37..cf93ce9 100644 --- a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapBaseThumbnail.java +++ b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapBaseThumbnail.java @@ -28,8 +28,8 @@ import static android.widget.ImageView.ScaleType.CENTER_CROP; /** - * Parent class of Circle & Square Thumbnails - contains boilerplate code required to get - * BootstrapBrand & borders working via getters/setters. Also overrides ImageView so that only + * Parent class of Circle and Square Thumbnails - contains boilerplate code required to get + * BootstrapBrand and borders working via getters/setters. Also overrides ImageView so that only * CENTER_CROP is allowed, and a callback is fired whenever the image source changes. */ abstract class BootstrapBaseThumbnail extends ImageView implements BootstrapBrandView, diff --git a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapCircleThumbnail.java b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapCircleThumbnail.java index 7df9095..e907efc 100644 --- a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapCircleThumbnail.java +++ b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapCircleThumbnail.java @@ -20,7 +20,7 @@ /** * BootstrapCircleThumbnails display a circular image with an optional border, that can be themed - * using BootstrapBrand colors. The view extends ImageView, and will automatically center crop & + * using BootstrapBrand colors. The view extends ImageView, and will automatically center crop and * scale images. */ public class BootstrapCircleThumbnail extends BootstrapBaseThumbnail { @@ -72,11 +72,9 @@ protected void initialise(AttributeSet attrs) { /** * This method is called when the Circle Image needs to be recreated due to changes in size etc. - *

* A Paint object uses a BitmapShader to draw a center-cropped, circular image onto the View * Canvas. A Matrix on the BitmapShader scales the original Bitmap to match the current view * bounds, avoiding any inefficiencies in duplicating Bitmaps. - *

* * Further reading */ diff --git a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/api/defaults/DefaultBootstrapHeading.java b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/api/defaults/DefaultBootstrapHeading.java index d0197ee..479bcef 100644 --- a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/api/defaults/DefaultBootstrapHeading.java +++ b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/api/defaults/DefaultBootstrapHeading.java @@ -8,7 +8,7 @@ import com.beardedhen.androidbootstrap.utils.DimenUtils; /** - * Bootstrap provides styling for elements H1-H6, and sets their text size & padding using the + * Bootstrap provides styling for elements H1-H6, and sets their text size and padding using the * values supplied here. */ public enum DefaultBootstrapHeading implements BootstrapHeading { diff --git a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/api/view/BootstrapHeadingView.java b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/api/view/BootstrapHeadingView.java index d5da082..882889d 100644 --- a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/api/view/BootstrapHeadingView.java +++ b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/api/view/BootstrapHeadingView.java @@ -5,7 +5,7 @@ import com.beardedhen.androidbootstrap.api.attributes.BootstrapHeading; /** - * Views which implement this interface change their text size & padding according to the + * Views which implement this interface change their text size and padding according to the * given Bootstrap Heading */ public interface BootstrapHeadingView { @@ -13,7 +13,7 @@ public interface BootstrapHeadingView { String KEY = "com.beardedhen.androidbootstrap.api.attributes.BootstrapHeading"; /** - * Sets this view to use the given Bootstrap Heading, changing its text size & padding + * Sets this view to use the given Bootstrap Heading, changing its text size and padding * * @param bootstrapHeading the Bootstrap Heading */ diff --git a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/font/Typicon.java b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/font/Typicon.java index a63e750..9498251 100644 --- a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/font/Typicon.java +++ b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/font/Typicon.java @@ -10,7 +10,7 @@ /** * Maps Typicons Icon Codes to unicode characters, allowing its use in AwesomeTextView. * See the Cheatsheet for icon - * code reference. Please note that icon codes have been prefixed with "ty_". + * code reference. Please note that icon codes have been prefixed with "ty_". * For example, "adjust_brightness" would become "ty_adjust_brightness". */ public class Typicon implements IconSet {