Skip to content

Commit

Permalink
Release v2.1.0
Browse files Browse the repository at this point in the history
Gave new API interface methods a default implemenation using java 8 features
Also fixed some issues caused by newer gradle versions
Pulled the maven release script locally, so we can build the project without internet access
  • Loading branch information
wdullaer committed Mar 10, 2018
1 parent ba027fc commit b2d7d24
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 7 deletions.
5 changes: 5 additions & 0 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ android {
minifyEnabled false
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

VERSION_NAME=2.0.0
VERSION_CODE=13
VERSION_NAME=2.1.0
VERSION_CODE=14
GROUP=com.wdullaer

ANDROID_BUILD_MIN_SDK_VERSION=14
Expand Down
7 changes: 6 additions & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ android {
minifyEnabled false
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

task jar(type: Jar) {
Expand All @@ -28,4 +33,4 @@ dependencies {
api 'com.android.support:support-annotations:27.1.0'
}

apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'
apply from: 'gradle-mvn-push.gradle'
114 changes: 114 additions & 0 deletions library/gradle-mvn-push.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*
* 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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void onSwipeEnded(ListView listView, int position, SwipeDirection directi
/**
* Set whether items should have a fadeOut animation
*
* @param mFadeOut true makes items fade out with a swipe (opacity -> 0)
* @param mFadeOut true makes items fade out with a swipe (opacity to 0)
* @return A reference to the current instance so that commands can be chained
*/
@SuppressWarnings("unused")
Expand Down Expand Up @@ -263,7 +263,9 @@ public interface SwipeActionListener{
boolean hasActions(int position, SwipeDirection direction);
boolean shouldDismiss(int position, SwipeDirection direction);
void onSwipe(int[] position, SwipeDirection[] direction);
void onSwipeStarted(ListView listView, int position, SwipeDirection direction);
void onSwipeEnded(ListView listView, int position, SwipeDirection direction);
@SuppressWarnings("unused")
default void onSwipeStarted(ListView listView, int position, SwipeDirection direction) {};
@SuppressWarnings("unused")
default void onSwipeEnded(ListView listView, int position, SwipeDirection direction) {};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public void setEnabled(boolean enabled) {
* ListView} using {@link ListView#setOnScrollListener(AbsListView.OnScrollListener)}.
* If a scroll listener is already assigned, the caller should still pass scroll changes through
* to this listener. This will ensure that this {@link SwipeActionTouchListener} is
* paused during list view scrolling.</p>
* paused during list view scrolling.
*
* @see SwipeActionTouchListener
*/
Expand Down

0 comments on commit b2d7d24

Please sign in to comment.