Skip to content

Commit ccfdea8

Browse files
committed
add maven publish plugin
1 parent 704e6ab commit ccfdea8

File tree

6 files changed

+29
-33
lines changed

6 files changed

+29
-33
lines changed

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ buildscript {
1313
classpath ClassPaths.gradlePlugin
1414
classpath ClassPaths.bytex
1515
classpath ClassPaths.hugoByteX
16+
classpath ClassPaths.mavenPlugin
17+
classpath ClassPaths.dokaa
1618
}
1719
}
1820

buildSrc/src/main/java/wtf/s1rius/ptr/buildsrc/Configs.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,6 @@ object ClassPaths {
5757
const val kotlinPlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"
5858
const val bytex = "com.bytedance.android.byteX:base-plugin:${Versions.bytex}"
5959
const val hugoByteX = "wtf.s1.pudge:hugo2-bytex:0.1.4"
60+
const val mavenPlugin = "com.vanniktech:gradle-maven-publish-plugin:0.14.0"
61+
const val dokaa = "org.jetbrains.dokka:dokka-gradle-plugin:1.4.10.2"
6062
}

ptr-demo/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import wtf.s1rius.ptr.buildsrc.*
22

33
apply plugin: "com.android.application"
44
apply plugin: 'kotlin-android'
5-
apply plugin: 'kotlin-android-extensions'
65

76
android {
87
compileSdkVersion(Versions.compileSdkVersion)

ptr-demo/src/main/java/wtf/s1/android/ptr/demo/md/CheeseDetailActivity.kt

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
package wtf.s1.android.ptr.demo.md
1818

1919
import android.os.Bundle
20+
import android.widget.ImageView
2021
import androidx.appcompat.app.AppCompatActivity
2122
import com.bumptech.glide.Glide
22-
import kotlinx.android.synthetic.main.activity_detail.*
23+
import com.google.android.material.appbar.CollapsingToolbarLayout
2324
import wtf.s1.android.ptr.demo.SwipeToRefreshLayout
2425
import wtf.s1.android.ptr_support_design.R
2526

@@ -32,21 +33,25 @@ class CheeseDetailActivity : AppCompatActivity() {
3233
val intent = intent
3334
val cheeseName = intent.getStringExtra(EXTRA_NAME)
3435

35-
setSupportActionBar(toolbar)
36-
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
36+
setSupportActionBar(findViewById(R.id.toolbar))
37+
supportActionBar?.setDisplayHomeAsUpEnabled(true)
3738

38-
collapsing_toolbar.title = cheeseName
39-
ptr_layout.setPTRListener(object: SwipeToRefreshLayout.OnPtrRefreshListener {
40-
override fun onRefresh() {
41-
ptr_layout.postDelayed({ ptr_layout.isRefreshing = false }, 3000)
42-
}
43-
})
39+
findViewById<CollapsingToolbarLayout>(R.id.collapsing_toolbar).title = cheeseName
40+
findViewById<SwipeToRefreshLayout>(R.id.ptr_layout).let {
41+
it.setPTRListener(object: SwipeToRefreshLayout.OnPtrRefreshListener {
42+
override fun onRefresh() {
43+
it.postDelayed({ it.isRefreshing = false }, 3000)
44+
}
45+
})
46+
}
4447

4548
loadBackdrop()
4649
}
4750

4851
private fun loadBackdrop() {
49-
Glide.with(this).load(Cheeses.randomCheeseDrawable).centerCrop().into(backdrop)
52+
findViewById<ImageView>(R.id.backdrop)?.let {
53+
Glide.with(this).load(Cheeses.randomCheeseDrawable).centerCrop().into(it)
54+
}
5055
}
5156

5257
companion object {

ptr-lib/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import wtf.s1rius.ptr.buildsrc.*
22

33
apply plugin: 'com.android.library'
44
apply plugin: 'kotlin-android'
5+
apply plugin: "com.vanniktech.maven.publish"
56

67

78
android {
@@ -26,3 +27,6 @@ dependencies {
2627
implementation Deps.AndroidX.Core.ktx
2728
implementation Deps.AndroidX.appcompat
2829
}
30+
31+
version = VERSION_NAME
32+
group = GROUP

ptr-lib/gradle.properties

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
1-
VERSION_NAME=1.0.11
2-
3-
POM_GROUP=in.srain.cube
4-
POM_ARTIFACT_ID=ultra-ptr
5-
POM_PACKAGING=aar
6-
7-
POM_NAME=Android Ultra Pull to Refresh
8-
POM_DESCRIPTION=Ultra Pull to Refresh Solution.
9-
10-
POM_URL=https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh
11-
POM_SCM_URL=https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh
12-
POM_SCM_CONNECTION=scm:https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh.git
13-
POM_SCM_DEV_CONNECTION=scm:https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh.git
14-
15-
POM_LICENCE_NAME=MIT
16-
POM_LICENCE_URL=http://opensource.org/licenses/MIT
17-
POM_LICENCE_DIST=repo
18-
POM_DEVELOPER_ID=liaohuqiu
19-
POM_DEVELOPER_NAME=liaohuqiu
20-
21-
POM_ISSUE_SYSTEM=GitHub Issues
22-
POM_ISSUE_URL=https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh/issues
1+
VERSION_NAME=0.0.1
2+
GROUP=wtf.s1.ptr
3+
POM_NAME=nsptr
4+
POM_DESCRIPTION=nsptr
5+
POM_ARTIFACT_ID=nsptr
6+
POM_PACKAGING=aar

0 commit comments

Comments
 (0)