Skip to content

Commit a1ebd67

Browse files
committed
Merge branch 'develop'
2 parents 4e6bc19 + cbcc139 commit a1ebd67

File tree

7 files changed

+202
-53
lines changed

7 files changed

+202
-53
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
验证码,密码输入框,文本支持明文和密码及透明三种形式展示,背景支持下划线,填充色块,边框,透明四种
33

44

5-
## jcenter 引入
5+
## 引入
66

77
```
8-
implementation 'com.github.lwjfork:CodeEditText:1.0.4'
8+
implementation 'io.github.lwjfork:CodeEditText:1.0.5'
99
1010
```
1111

build.gradle

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,29 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
def gradleVersion = "3.5.3"
5-
File propertiesFile = file('local.properties')
6-
if (propertiesFile.exists()) {
7-
Properties localProperties = new Properties()
8-
def stream = project.rootProject.file('local.properties').newDataInputStream()
9-
localProperties.load(stream)
10-
def localGradleVersion = localProperties.getProperty('LOCAL_GRADLE_VERSION')
11-
if (localGradleVersion != null) {
12-
gradleVersion = localGradleVersion
13-
}
14-
15-
stream.close();
16-
}
4+
def kotlin_version = "1.4.30"
175
repositories {
18-
jcenter()
6+
mavenCentral()
197
google()
8+
maven {
9+
url "https://plugins.gradle.org/m2/"
10+
}
2011
}
2112
dependencies {
22-
classpath "com.android.tools.build:gradle:$gradleVersion"
23-
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
24-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
13+
classpath "com.android.tools.build:gradle:4.1.2"
14+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15+
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
16+
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.4.30"
2517
}
2618
}
2719

2820
allprojects {
2921
repositories {
30-
jcenter()
22+
mavenCentral()
3123
google()
24+
maven {
25+
url "https://plugins.gradle.org/m2/"
26+
}
3227
}
3328
}
3429

@@ -39,4 +34,6 @@ ext {
3934
minSdkVersion = 14
4035
targetSdkVersion = 25
4136
supportLibVersion = "25.0.1"
42-
}
37+
}
38+
39+
apply from: "${rootDir}/scripts/publish-root.gradle"

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

library/build.gradle

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -36,35 +36,5 @@ dependencies {
3636
compileOnly "com.android.support:appcompat-v7:$SLVersion"
3737
}
3838

39-
// 这里改成groupId , 比如com.android.support
40-
rootProject.ext.PROJ_GROUP = "com.github.lwjfork"
41-
// 这里改成开发者id , 比如
42-
rootProject.ext.DEVELOPER_ID = "lwjfork"
43-
// 这里改成开发者名字 , 比如android
44-
rootProject.ext.DEVELOPER_NAME = "lwjfork"
45-
// 这里改成开发者邮箱,比如[email]someone@android.com[/email]
46-
rootProject.ext.DEVELOPER_EMAIL = "lwjfork@gmail.com"
47-
// 这里改成库版本 , 比如22.2.0
48-
rootProject.ext.PROJ_VERSION = "1.0.5"
49-
// 这里改成库名字 , 比如appcompat
50-
rootProject.ext.PROJ_NAME = "CodeEditText"
51-
// 这里改成github地址 , 比如https:github.com/android/appcompat
52-
rootProject.ext.PROJ_WEBSITEURL = "https://github.com/lwjfork/CodeEditText"
53-
// 这里改成issue地址 ,
54-
//比如https:github.com/android/appcompat/issues
55-
rootProject.ext.PROJ_ISSUEURL = "https://github.com/lwjfork/CodeEditText/issues"
56-
// 这里改成版本控制地主 ,
57-
// 比如https:github.com/android/appcompat.git
58-
rootProject.ext.PROJ_VCSURL = "https://github.com/lwjfork/CodeEditText.git"
59-
// 这里改成库的描述信息
60-
rootProject.ext.PROJ_DESCRIPTION = "Password Verify Code"
61-
// 这里改成库的标示 , 比如appcompat - v7
62-
rootProject.ext.PROJ_ARTIFACTID = "CodeEditText"
63-
// 发布时必须有值,建议写到 local.properties 里 或者环境变量中,local.properties 定义优先
64-
rootProject.ext.BINTRAY_APIKEY = System.getenv("BINTRAY_APIKEY") //
65-
rootProject.ext.BINTRAY_USER = System.getenv("BINTRAY_USER")
66-
rootProject.ext.PROJ_PACKAGING = "aar"
67-
rootProject.ext.PROJ_REPO = "maven"
6839

69-
70-
apply from: "https://raw.githubusercontent.com/lwjfork/scriptlib/master/gradle/bintray.gradle"
40+
apply from: "${rootDir}/scripts/publish-module.gradle"

library/gradle.properties

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
PUBLISH_GROUP_ID=io.github.lwjfork
2+
PUBLISH_ARTIFACT_ID=CodeEditText
3+
PUBLISH_VERSION=1.0.5
4+
5+
# pom
6+
POM_NAME=CodeEditText
7+
POM_DESCRIPTION=CodeEditText
8+
POM_URL=https://github.com/lwjfork/CodeEditText
9+
## pom.scm
10+
POM_SCM_CONNECTION=scm:git@github.com:lwjfork/CodeEditText.git
11+
POM_SCM_DEV_CONNECTION=scm:git@github.com:lwjfork/CodeEditText.git
12+
POM_SCM_URL=https://github.com/lwjfork/CodeEditText.git
13+
14+
## pom.licenses
15+
POM_LICENCE_NAME=The Apache Software License, Version 2.0
16+
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
17+
18+
## pom.developers
19+
POM_DEVELOPER_ID=lwjfork
20+
POM_DEVELOPER_NAME=lwjfork
21+
POM_DEVELOPER_EMAIL=lwjfork@gmail.com
22+
23+
PROJECT_NAME=CodeEditText
24+
25+

scripts/publish-module.gradle

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
apply plugin: 'maven-publish'
2+
apply plugin: 'signing'
3+
if (project.hasProperty("kotlin")) {
4+
apply plugin: "org.jetbrains.dokka"
5+
}
6+
7+
task androidSourcesJar(type: Jar) {
8+
archiveClassifier.set('sources')
9+
if (project.plugins.findPlugin("com.android.library")) {
10+
// For Android libraries
11+
from android.sourceSets.main.java.srcDirs
12+
if (project.hasProperty("kotlin")) {
13+
from android.sourceSets.main.kotlin.srcDirs
14+
}
15+
} else {
16+
// For pure Kotlin libraries, in case you have them
17+
from sourceSets.main.java.srcDirs
18+
if (project.hasProperty("kotlin")) {
19+
from sourceSets.main.kotlin.srcDirs
20+
}
21+
22+
}
23+
}
24+
25+
if (project.hasProperty("kotlin")) {
26+
tasks.withType(dokkaHtmlPartial.getClass()).configureEach {
27+
pluginsMapConfiguration.set(
28+
["org.jetbrains.dokka.base.DokkaBase": """{ "separateInheritedMembers": true}"""]
29+
)
30+
}
31+
task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
32+
archiveClassifier.set('javadoc')
33+
from dokkaJavadoc.outputDirectory
34+
}
35+
} else {
36+
37+
task javadoc(type: Javadoc) {
38+
options.encoding "UTF-8"
39+
options.charSet 'UTF-8'
40+
source = android.sourceSets.main.java.srcDirs
41+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
42+
options.links("http://docs.oracle.com/javase/7/docs/api/");
43+
options.linksOffline "http://d.android.com/reference","${android.sdkDirectory}/docs/reference"
44+
exclude '**/BuildConfig.java'
45+
exclude '**/R.java'
46+
failOnError = false
47+
}
48+
task javadocJar(type: Jar, dependsOn: javadoc) {
49+
classifier = 'javadoc'
50+
from javadoc.destinationDir
51+
}
52+
53+
tasks.withType(Javadoc) {
54+
options.addStringOption('Xdoclint:none', '-quiet')
55+
options.addStringOption('encoding', 'UTF-8')
56+
options.addStringOption('charSet ', 'UTF-8')
57+
options {
58+
encoding "UTF-8"
59+
charSet 'UTF-8'
60+
links "http://docs.oracle.com/javase/7/docs/api"
61+
}
62+
}
63+
}
64+
65+
66+
artifacts {
67+
archives androidSourcesJar
68+
archives javadocJar
69+
}
70+
71+
group = PUBLISH_GROUP_ID
72+
version = PUBLISH_VERSION
73+
74+
75+
76+
77+
78+
afterEvaluate {
79+
publishing {
80+
publications {
81+
release(MavenPublication) {
82+
groupId PUBLISH_GROUP_ID
83+
artifactId PUBLISH_ARTIFACT_ID
84+
version PUBLISH_VERSION
85+
// Two artifacts, the `aar` (or `jar`) and the sources
86+
if (project.plugins.findPlugin("com.android.library")) {
87+
from components.release
88+
} else {
89+
from components.java
90+
}
91+
artifact androidSourcesJar
92+
artifact javadocJar
93+
94+
// Mostly self-explanatory metadata
95+
pom {
96+
name = POM_NAME
97+
description = POM_DESCRIPTION
98+
url = POM_URL
99+
licenses {
100+
license {
101+
name = POM_LICENCE_NAME
102+
url = POM_LICENCE_URL
103+
}
104+
}
105+
developers {
106+
developer {
107+
id = POM_DEVELOPER_ID
108+
name = POM_DEVELOPER_NAME
109+
email = POM_DEVELOPER_EMAIL
110+
}
111+
// Add all other devs here...
112+
}
113+
114+
// Version control info - if you're using GitHub, follow the
115+
// format as seen here
116+
scm {
117+
connection = POM_SCM_CONNECTION
118+
developerConnection = POM_SCM_DEV_CONNECTION
119+
url = POM_SCM_URL
120+
}
121+
}
122+
}
123+
}
124+
}
125+
}
126+
127+
ext["signing.keyId"] = rootProject.ext["signing.keyId"]
128+
ext["signing.password"] = rootProject.ext["signing.password"]
129+
ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"]
130+
signing {
131+
sign publishing.publications
132+
}
133+

scripts/publish-root.gradle

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apply plugin: 'io.github.gradle-nexus.publish-plugin'
2+
3+
ext["signing.keyId"] = SIGNING_KEY_ID
4+
ext["signing.password"] = SIGNING_PASSWORD
5+
ext["signing.secretKeyRingFile"] = SIGNING_SECRET_KEY_RING_FILE
6+
ext["ossrhUsername"] = OSSRH_USERNAME
7+
ext["ossrhPassword"] = OSSRH_PASSWORD
8+
9+
10+
nexusPublishing {
11+
repositories {
12+
sonatype { //only for users registered in Sonatype after 24 Feb 2021
13+
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
14+
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
15+
stagingProfileId = STAGING_PRO_FILE_ID
16+
username = ossrhUsername
17+
password = ossrhPassword
18+
}
19+
}
20+
}
21+
22+
23+
24+

0 commit comments

Comments
 (0)