diff --git a/build.gradle b/build.gradle index 596bd8c..d885473 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,32 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + + Properties properties = new Properties() + def localPropertiesPath = 'local.properties' + if (file(localPropertiesPath).exists()) { + properties.load(file(localPropertiesPath).newDataInputStream()) + } + + gradle.ext { + nexusUrl = properties.getProperty("nexusUrl") ?: "" + nexusUsername = properties.getProperty("nexusUsername") + nexusPassword = properties.getProperty("nexusPassword") + gitHash = { -> + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'rev-parse', '--short', 'HEAD' + standardOutput = stdout + } + return stdout.toString().trim() + } + } + ext.kotlin_version = '1.3.72' repositories { - jcenter() - maven { url 'https://jitpack.io' } google() + maven { url gradle.nexusUrl } + jcenter() } dependencies { classpath 'com.android.tools.build:gradle:4.0.0' @@ -19,10 +40,8 @@ buildscript { allprojects { repositories { - jcenter() mavenCentral() maven { url 'https://jitpack.io' } - maven { url "https://maven.google.com" } google() } } diff --git a/omegarecyclerview/build.gradle b/omegarecyclerview/build.gradle index ce4dee3..230a45e 100644 --- a/omegarecyclerview/build.gradle +++ b/omegarecyclerview/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'maven-publish' android { compileSdkVersion rootProject.compileSdkVersion @@ -17,6 +17,29 @@ android { } } + +publishing { + publications { + release(MavenPublication) { + groupId 'com.github.Omega-R.OmegaRecyclerView' + artifactId project.name + version project.hasProperty('version') ? project.version : gradle.gitHash() + afterEvaluate { + from components.release + } + } + } + repositories { + maven { + url gradle.nexusUrl + credentials { + username gradle.nexusUsername + password gradle.nexusPassword + } + } + } +} + dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:' + rootProject.appcompatVersion diff --git a/omegarecyclerview/src/main/java/com/omega_r/libs/omegarecyclerview/OmegaRecyclerView.java b/omegarecyclerview/src/main/java/com/omega_r/libs/omegarecyclerview/OmegaRecyclerView.java index fbd7de6..2bb1bab 100644 --- a/omegarecyclerview/src/main/java/com/omega_r/libs/omegarecyclerview/OmegaRecyclerView.java +++ b/omegarecyclerview/src/main/java/com/omega_r/libs/omegarecyclerview/OmegaRecyclerView.java @@ -654,6 +654,10 @@ public void hidePagination() { } } + public void resetPagination() { + mPageRequester.reset(); + } + public void setHeadersVisibility(boolean visible) { RecyclerView.Adapter adapter = getAdapter(); if (adapter instanceof HeaderFooterWrapperAdapter) { diff --git a/omegarecyclerview_expandable/build.gradle b/omegarecyclerview_expandable/build.gradle index ea9bc83..ca8f491 100644 --- a/omegarecyclerview_expandable/build.gradle +++ b/omegarecyclerview_expandable/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'maven-publish' android { compileSdkVersion rootProject.compileSdkVersion @@ -17,6 +17,28 @@ android { } } +publishing { + publications { + release(MavenPublication) { + groupId 'com.github.Omega-R.OmegaRecyclerView' + artifactId project.name + version project.hasProperty('version') ? project.version : gradle.gitHash() + afterEvaluate { + from components.release + } + } + } + repositories { + maven { + url gradle.nexusUrl + credentials { + username gradle.nexusUsername + password gradle.nexusPassword + } + } + } +} + dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation project(':omegarecyclerview') diff --git a/omegarecyclerview_fastscroll/build.gradle b/omegarecyclerview_fastscroll/build.gradle index 17465ba..b065f40 100644 --- a/omegarecyclerview_fastscroll/build.gradle +++ b/omegarecyclerview_fastscroll/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'maven-publish' android { compileSdkVersion rootProject.compileSdkVersion @@ -17,6 +17,28 @@ android { } } +publishing { + publications { + release(MavenPublication) { + groupId 'com.github.Omega-R.OmegaRecyclerView' + artifactId project.name + version project.hasProperty('version') ? project.version : gradle.gitHash() + afterEvaluate { + from components.release + } + } + } + repositories { + maven { + url gradle.nexusUrl + credentials { + username gradle.nexusUsername + password gradle.nexusPassword + } + } + } +} + dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation project(':omegarecyclerview')