Skip to content

Commit

Permalink
Merge pull request #78 from st235/bump/maven_script
Browse files Browse the repository at this point in the history
fixed maven script. added gradle 7.0 support.
  • Loading branch information
st235 authored Oct 3, 2021
2 parents afac929 + da61f13 commit b6f3a68
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 78 deletions.
11 changes: 5 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 30
compileSdkVersion 31
defaultConfig {
applicationId "github.com.st235.expandablebottonbar"
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 31
versionCode 1
}

Expand All @@ -27,9 +26,9 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation project(':lib-expandablebottombar')

implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'

implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".ShowCaseActivity">
<activity
android:exported="true"
android:name=".ShowCaseActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package github.com.st235.expandablebottombar
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import github.com.st235.expandablebottombar.screens.*
import github.com.st235.expandablebottombar.screens.navigation.NavigationComponentActivity
import kotlinx.android.synthetic.main.activity_showcase.*

class ShowCaseActivity : AppCompatActivity() {

Expand Down Expand Up @@ -47,9 +48,16 @@ class ShowCaseActivity : AppCompatActivity() {
)
}

private lateinit var toolbar: Toolbar
private lateinit var recyclerView: RecyclerView

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_showcase)

toolbar = findViewById(R.id.toolbar)
recyclerView = findViewById(R.id.recyclerView)

setSupportActionBar(toolbar)

val adapter = ShowCaseAdapter(showCaseInfos) { info ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import android.text.method.LinkMovementMethod
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.content_showcase_item.view.*

typealias OnItemClickListener = (info: ShowCaseInfo) -> Unit

Expand All @@ -27,8 +27,8 @@ class ShowCaseAdapter(
override fun getItemCount(): Int = items.size

inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView), View.OnClickListener {
val title = itemView.title
val description = itemView.description
val title: TextView = itemView.findViewById(R.id.title)
val description: TextView = itemView.findViewById(R.id.description)

init {
itemView.isClickable = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ package github.com.st235.expandablebottombar.screens

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.google.android.material.snackbar.Snackbar
import github.com.st235.expandablebottombar.R
import kotlinx.android.synthetic.main.activity_coordinator_layout.*

class CoordinatorLayoutActivity : AppCompatActivity() {

private lateinit var fab: FloatingActionButton

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_coordinator_layout)


fab = findViewById(R.id.fab)

fab.setOnClickListener { view ->
Snackbar.make(view, "Meow", Snackbar.LENGTH_LONG).show()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,22 @@ import android.view.MenuItem
import android.view.View
import android.view.ViewAnimationUtils
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.core.graphics.ColorUtils
import github.com.st235.expandablebottombar.R
import github.com.st235.lib_expandablebottombar.ExpandableBottomBar
import kotlinx.android.synthetic.main.activity_xml_declared.*

class NotificationBadgeActivity : AppCompatActivity() {

private lateinit var toolbar: Toolbar
private lateinit var bottomBar: ExpandableBottomBar

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_notification_badge)

toolbar = findViewById(R.id.toolbar)

setSupportActionBar(toolbar)

val color: View = findViewById(R.id.color)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.AppCompatImageView
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.google.android.material.snackbar.Snackbar
import github.com.st235.expandablebottombar.R
import kotlinx.android.synthetic.main.activity_coordinator_layout.*

class ScrollableCoordinatorLayoutActivity : AppCompatActivity() {

private lateinit var fab: FloatingActionButton

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_scrollable_coordinator_layout)

fab = findViewById(R.id.fab)

val rc = findViewById<RecyclerView>(R.id.recycler_view)

rc.apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,21 @@ import android.view.Menu
import android.view.View
import android.view.ViewAnimationUtils
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.core.graphics.ColorUtils
import github.com.st235.expandablebottombar.R
import github.com.st235.lib_expandablebottombar.ExpandableBottomBar
import kotlinx.android.synthetic.main.activity_xml_declared.*

class XmlDeclaredActivity : AppCompatActivity() {

private lateinit var toolbar: Toolbar

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_xml_declared)

toolbar = findViewById(R.id.toolbar)

setSupportActionBar(toolbar)

val color: View = findViewById(R.id.color)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.Navigation
import github.com.st235.expandablebottombar.R
import github.com.st235.lib_expandablebottombar.ExpandableBottomBar
import github.com.st235.lib_expandablebottombar.navigation.ExpandableBottomBarNavigationUI
import kotlinx.android.synthetic.main.activiy_navigation.*

class NavigationComponentActivity: AppCompatActivity() {

private lateinit var bottomNavigation: ExpandableBottomBar

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activiy_navigation)

bottomNavigation = findViewById(R.id.bottomNavigation)
val navigationController = Navigation.findNavController(this, R.id.navigationHost)

/**
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
buildscript {
ext.kotlin_version = '1.5.21'
ext.kotlin_version = '1.5.31'

repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.android.tools.build:gradle:7.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ android.useAndroidX=true

GROUP=com.github.st235

VERSION_CODE=45
VERSION_NAME=1.4.0
VERSION_CODE=46
VERSION_NAME=1.4.1

POM_DESCRIPTION=A new way to improve navigation in your app.
POM_URL=https://github.com/st235/ExpandableBottomBar
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
93 changes: 36 additions & 57 deletions lib-expandablebottombar/maven.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
/*
* 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: 'maven-publish'
apply plugin: 'signing'

def isReleaseBuild() {
Expand All @@ -39,47 +23,52 @@ 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())
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release

groupId = GROUP
artifactId = project.name
version = VERSION_NAME

repositories {
maven {
var releaseUrl = getReleaseRepositoryUrl()
var snapshotUrl = getSnapshotRepositoryUrl()

url = isReleaseBuild() ? releaseUrl : snapshotUrl
credentials {
username getRepositoryUsername()
password getRepositoryPassword()
}
}
}

pom.project {
name POM_NAME
packaging POM_PACKAGING
description POM_DESCRIPTION
url POM_URL
pom {
name = project.name
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
}
}
}
Expand All @@ -88,17 +77,7 @@ afterEvaluate { project ->
}

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


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

artifacts {
archives androidSourcesJar
required { isReleaseBuild() }
sign publishing.publications.release
}
}

0 comments on commit b6f3a68

Please sign in to comment.