Skip to content

Commit d21758b

Browse files
committed
see 03/26 log
1 parent a6d3e4e commit d21758b

File tree

17 files changed

+178
-297
lines changed

17 files changed

+178
-297
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ local.properties
1010
.externalNativeBuild
1111
/apk
1212
*.phrof
13-
/maven
13+
/mavenLocal
1414
/reports
1515
*/reports

CHANGELOG.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
* `20/01/20` [upd] Publish v1.26.1.
2-
* `20/01/19` [add] Publish bus plugin v1.4.
3-
* `20/01/18` [add] Publish api plugin v2.6.
41
* `20/01/17` [upd] Leak Canary to v2.1.
5-
* `19/12/08` [add] Publish bus plugin v2.5.
6-
* `19/12/06` [add] Publish api plugin v1.3.
72
* `19/11/30` [add] Publish bus plugin v2.4. Publish api plugin v1.2.
83
* `19/11/28` [add] Publish v1.26.0.
94
* `19/11/27` [add] Shadow demo.

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
// use for debug plugin local
66
if (Config.depConfig.plugin_bus.useLocal || Config.depConfig.plugin_api.useLocal) {
77
maven() {
8-
url new File("maven")
8+
url new File("mavenLocal")
99
}
1010
}
1111
maven {
@@ -66,4 +66,4 @@ allprojects {
6666

6767
task clean(type: Delete) {
6868
delete rootProject.buildDir
69-
}
69+
}

buildSrc/src/main/groovy/Config.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Config {
1515
static minSdkVersion = 14
1616
static targetSdkVersion = 29
1717
static versionCode = 1_026_001
18-
static versionName = '1.26.1-alpha7'// E.g. 1.9.72 => 1,009,072
18+
static versionName = '1.26.1-alpha8'// E.g. 1.9.72 => 1,009,072
1919

2020
// lib version
2121
static gradlePluginVersion = '3.5.0'

buildSrc/src/main/groovy/ConfigUtils.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ConfigUtils {
2727
def configs = [:]
2828
for (Map.Entry<String, DepConfig> entry : Config.depConfig.entrySet()) {
2929
def (name, config) = [entry.key, entry.value]
30-
if (name.startsWith("plugin_")) {
30+
if (entry.value.pluginPath) {
3131
config.dep = config.pluginPath
3232
} else {
3333
if (config.useLocal) {
@@ -74,7 +74,7 @@ class ConfigUtils {
7474
static getApplyPlugins() {
7575
def plugins = [:]
7676
for (Map.Entry<String, DepConfig> entry : Config.depConfig.entrySet()) {
77-
if (entry.value.isApply && entry.value.pluginPath != null) {
77+
if (entry.value.isApply && entry.value.pluginPath) {
7878
plugins.put(entry.key, entry.value)
7979
}
8080
}

gradle/publish.gradle

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
apply plugin: Config.depConfig.plugin_maven.pluginId
2+
apply plugin: Config.depConfig.plugin_bintray.pluginId
3+
4+
def isAndroid() {
5+
return project.getPlugins().hasPlugin('com.android.application') ||
6+
project.getPlugins().hasPlugin('com.android.library')
7+
}
8+
9+
def configurePom(pom) {
10+
pom.project {
11+
name project.ext.name
12+
groupId = project.ext.groupId
13+
artifactId = project.ext.artifactId
14+
version = project.ext.versionName
15+
packaging isAndroid() ? "aar" : "jar"
16+
description project.ext.name
17+
url project.ext.siteUrl
18+
19+
scm {
20+
url project.ext.siteUrl
21+
connection project.ext.siteUrl
22+
developerConnection project.ext.siteUrl + ".git"
23+
}
24+
25+
licenses {
26+
license {
27+
name 'The Apache Software License, Version 2.0'
28+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
29+
}
30+
}
31+
32+
developers {
33+
developer {
34+
id "Blankj"
35+
name "Blankj"
36+
}
37+
}
38+
}
39+
}
40+
41+
tasks.create("mavenLocal", Upload) {
42+
configuration = configurations.archives
43+
44+
repositories {
45+
mavenDeployer {
46+
repository(url: uri(new File(project.rootDir.getPath() + "/mavenLocal")))
47+
48+
configurePom(pom)
49+
}
50+
}
51+
}
52+
53+
install {
54+
repositories.mavenInstaller {
55+
configurePom(pom)
56+
}
57+
}
58+
59+
if (isAndroid()) {
60+
// This generates sources.jar
61+
task sourcesJar(type: Jar) {
62+
classifier = 'sources'
63+
from android.sourceSets.main.java.source
64+
}
65+
66+
task javadoc(type: Javadoc) {
67+
source = android.sourceSets.main.java.source
68+
classpath += configurations.compile
69+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
70+
}
71+
72+
task javadocJar(type: Jar, dependsOn: javadoc) {
73+
classifier = 'javadoc'
74+
from javadoc.destinationDir
75+
}
76+
} else {
77+
task sourcesJar(type: Jar, dependsOn: classes) {
78+
classifier = 'sources'
79+
from sourceSets.main.allSource
80+
}
81+
82+
task javadocJar(type: Jar, dependsOn: javadoc) {
83+
classifier = 'javadoc'
84+
from javadoc.destinationDir
85+
}
86+
}
87+
88+
if (project.hasProperty("kotlin")) {
89+
// Disable creating javadocs
90+
tasks.withType(Javadoc) {
91+
enabled = false
92+
}
93+
}
94+
95+
// javadoc configuration
96+
javadoc {
97+
options {
98+
encoding "UTF-8"
99+
charSet 'UTF-8'
100+
author true
101+
version project.ext.versionName
102+
links "http://docs.oracle.com/javase/7/docs/api"
103+
title "${project.ext.name} ${project.ext.versionName}"
104+
}
105+
}
106+
107+
artifacts {
108+
archives javadocJar
109+
archives sourcesJar
110+
}
111+
112+
113+
Properties properties = new Properties()
114+
File localPropertiesFile = project.rootProject.file("local.properties");
115+
if (localPropertiesFile.exists()) {
116+
properties.load(localPropertiesFile.newDataInputStream())
117+
}
118+
119+
def bintrayUser = properties.getProperty("bintrayUser")
120+
def bintrayKey = properties.getProperty("bintrayKey")
121+
122+
// bintray configuration
123+
bintray {
124+
user = bintrayUser
125+
key = bintrayKey
126+
configurations = ['archives']
127+
override = false
128+
pkg {
129+
repo = "maven"
130+
name = project.ext.name
131+
websiteUrl = project.ext.siteUrl
132+
vcsUrl = project.ext.siteUrl + '.git'
133+
licenses = ["Apache-2.0"]
134+
}
135+
}

gradle/upload/bintrayUploadAndroid.gradle

Lines changed: 0 additions & 121 deletions
This file was deleted.

0 commit comments

Comments
 (0)