Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into add_workflow
Browse files Browse the repository at this point in the history
# Conflicts:
#	gradle/publish-lib.gradle
#	gradle/wrapper/gradle-wrapper.properties
  • Loading branch information
i.o.novikov committed Feb 22, 2022
2 parents 75e06e1 + 2e16fd9 commit 9b3c6ef
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 114 deletions.
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
def useMavenLocal = project.hasProperty("useMavenLocal")

buildscript {

Expand All @@ -13,6 +13,7 @@ buildscript {

allprojects {
repositories {
if (useMavenLocal) mavenLocal()
google()
jcenter()
}
Expand All @@ -27,8 +28,11 @@ ext {
compileSdk = 28
targetSdk = 28

appCompatVersion = "1.1.0"
constraintLayoutVersion = "1.1.3"
isRelease = project.hasProperty('release')
versionName = isRelease ? VERSION_NAME : "$VERSION_NAME-SNAPSHOT"

appCompatVersion = "1.2.0"
constraintLayoutVersion = "2.0.4"
viewPagerVersion = "1.0.0"
viewPager2Version = "1.0.0"
cardViewVersion = "1.0.0"
Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## 1.2.1

#### Fixes
#### Changes
-[scrollingpagerindicator] updated android gradle plugin to 3.6.4
-[scrollingpagerindicator] changed publishing plugin to maven-publish
#### Additions
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

android.useAndroidX=true
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
Expand Down
161 changes: 52 additions & 109 deletions gradle/publish-lib.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,155 +13,98 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply plugin: 'maven-publish'

apply plugin: 'maven'
apply plugin: 'signing'

version = VERSION_NAME
group = GROUP

def isReleaseBuild() {
return VERSION_NAME.contains("SNAPSHOT") == false
def getEnvValueOrEmpty(String key) {
String value = System.getenv(key)
return value != null ? value : ""
}

def getReleaseRepositoryUrl() {
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def getReleaseRepository() {
return getEnvValueOrEmpty("PRIVATE_NEXUS_RELEASE_URL")
}

def getSnapshotRepositoryUrl() {
return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
: "https://oss.sonatype.org/content/repositories/snapshots/"
def getSnapshotRepository() {
return getEnvValueOrEmpty("PRIVATE_NEXUS_SNAPSHOT_URL")
}

def getRepositoryUsername() {
return hasProperty('ossrhUsername') ? ossrhUsername : ''
return getEnvValueOrEmpty("PRIVATE_NEXUS_USER")
}

def getRepositoryPassword() {
return hasProperty('ossrhPassword') ? ossrhPassword : ''
return getEnvValueOrEmpty("PRIVATE_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())
publishing {
publications {
mavenAar(MavenPublication) {
from components.release
groupId GROUP
version versionName
afterEvaluate {
artifact sourcesJar
artifact javadocJar
}
snapshotRepository(url: getSnapshotRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}

pom.project {
name POM_NAME
packaging POM_PACKAGING
description POM_DESCRIPTION
url POM_URL

pom {
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
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
name = POM_LICENCE_NAME
url = POM_LICENCE_URL
distribution = POM_LICENCE_DIST
}
}

developers {
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
id = POM_DEVELOPER_ID
name = POM_DEVELOPER_NAME
}
}
}
}
}
}

signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}

task install(type: Upload, dependsOn: assemble) {
repositories.mavenInstaller {
configuration = configurations.archives

pom.groupId = GROUP
pom.artifactId = POM_ARTIFACT_ID
pom.version = VERSION_NAME

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
}
repositories {
maven {
url isRelease ? getReleaseRepository() : getSnapshotRepository()
credentials {
username = getRepositoryUsername()
password = getRepositoryPassword()
}
}
}
}

task androidJavadocs(type: Javadoc, dependsOn: preBuild) {
tasks.register('sourcesJar', Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}

tasks.register('androidJavadocJar', Javadoc) {
dependsOn(preBuild)
if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
}
source = android.sourceSets.main.java.source
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += files(android.libraryVariants.collect { variant ->
variant.javaCompile.classpath.files
})
}

task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.source
}

if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}

artifacts {
archives androidSourcesJar
archives androidJavadocsJar

tasks.register('javadocJar', Jar) {
dependsOn(tasks.named('androidJavadocJar'))
archiveClassifier.set('javadoc')
from "$buildDir/docs/javadoc"
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Fri Jun 22 12:47:41 MSK 2018
#Mon Dec 07 17:17:41 MSK 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion scrollingpagerindicator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {
}

libraryVariants.all {
it.generateBuildConfig.enabled = false
it.getGenerateBuildConfigProvider().get().enabled = false
}
}

Expand Down

0 comments on commit 9b3c6ef

Please sign in to comment.