提交 d21758b0 编写于 作者: B Blankj

see 03/26 log

上级 a6d3e4e8
......@@ -10,6 +10,6 @@ local.properties
.externalNativeBuild
/apk
*.phrof
/maven
/mavenLocal
/reports
*/reports
\ No newline at end of file
* `20/01/20` [upd] Publish v1.26.1.
* `20/01/19` [add] Publish bus plugin v1.4.
* `20/01/18` [add] Publish api plugin v2.6.
* `20/01/17` [upd] Leak Canary to v2.1.
* `19/12/08` [add] Publish bus plugin v2.5.
* `19/12/06` [add] Publish api plugin v1.3.
* `19/11/30` [add] Publish bus plugin v2.4. Publish api plugin v1.2.
* `19/11/28` [add] Publish v1.26.0.
* `19/11/27` [add] Shadow demo.
......
......@@ -5,7 +5,7 @@ buildscript {
// use for debug plugin local
if (Config.depConfig.plugin_bus.useLocal || Config.depConfig.plugin_api.useLocal) {
maven() {
url new File("maven")
url new File("mavenLocal")
}
}
maven {
......@@ -66,4 +66,4 @@ allprojects {
task clean(type: Delete) {
delete rootProject.buildDir
}
}
\ No newline at end of file
......@@ -15,7 +15,7 @@ class Config {
static minSdkVersion = 14
static targetSdkVersion = 29
static versionCode = 1_026_001
static versionName = '1.26.1-alpha7'// E.g. 1.9.72 => 1,009,072
static versionName = '1.26.1-alpha8'// E.g. 1.9.72 => 1,009,072
// lib version
static gradlePluginVersion = '3.5.0'
......
......@@ -27,7 +27,7 @@ class ConfigUtils {
def configs = [:]
for (Map.Entry<String, DepConfig> entry : Config.depConfig.entrySet()) {
def (name, config) = [entry.key, entry.value]
if (name.startsWith("plugin_")) {
if (entry.value.pluginPath) {
config.dep = config.pluginPath
} else {
if (config.useLocal) {
......@@ -74,7 +74,7 @@ class ConfigUtils {
static getApplyPlugins() {
def plugins = [:]
for (Map.Entry<String, DepConfig> entry : Config.depConfig.entrySet()) {
if (entry.value.isApply && entry.value.pluginPath != null) {
if (entry.value.isApply && entry.value.pluginPath) {
plugins.put(entry.key, entry.value)
}
}
......
apply plugin: Config.depConfig.plugin_maven.pluginId
apply plugin: Config.depConfig.plugin_bintray.pluginId
def isAndroid() {
return project.getPlugins().hasPlugin('com.android.application') ||
project.getPlugins().hasPlugin('com.android.library')
}
def configurePom(pom) {
pom.project {
name project.ext.name
groupId = project.ext.groupId
artifactId = project.ext.artifactId
version = project.ext.versionName
packaging isAndroid() ? "aar" : "jar"
description project.ext.name
url project.ext.siteUrl
scm {
url project.ext.siteUrl
connection project.ext.siteUrl
developerConnection project.ext.siteUrl + ".git"
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id "Blankj"
name "Blankj"
}
}
}
}
tasks.create("mavenLocal", Upload) {
configuration = configurations.archives
repositories {
mavenDeployer {
repository(url: uri(new File(project.rootDir.getPath() + "/mavenLocal")))
configurePom(pom)
}
}
}
install {
repositories.mavenInstaller {
configurePom(pom)
}
}
if (isAndroid()) {
// This generates sources.jar
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.source
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.source
classpath += configurations.compile
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
} else {
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
}
if (project.hasProperty("kotlin")) {
// Disable creating javadocs
tasks.withType(Javadoc) {
enabled = false
}
}
// javadoc configuration
javadoc {
options {
encoding "UTF-8"
charSet 'UTF-8'
author true
version project.ext.versionName
links "http://docs.oracle.com/javase/7/docs/api"
title "${project.ext.name} ${project.ext.versionName}"
}
}
artifacts {
archives javadocJar
archives sourcesJar
}
Properties properties = new Properties()
File localPropertiesFile = project.rootProject.file("local.properties");
if (localPropertiesFile.exists()) {
properties.load(localPropertiesFile.newDataInputStream())
}
def bintrayUser = properties.getProperty("bintrayUser")
def bintrayKey = properties.getProperty("bintrayKey")
// bintray configuration
bintray {
user = bintrayUser
key = bintrayKey
configurations = ['archives']
override = false
pkg {
repo = "maven"
name = project.ext.name
websiteUrl = project.ext.siteUrl
vcsUrl = project.ext.siteUrl + '.git'
licenses = ["Apache-2.0"]
}
}
\ No newline at end of file
// load properties
Properties properties = new Properties()
File localPropertiesFile = project.file("local.properties");
if (localPropertiesFile.exists()) {
properties.load(localPropertiesFile.newDataInputStream())
}
File projectPropertiesFile = project.file("project.properties");
if (projectPropertiesFile.exists()) {
properties.load(projectPropertiesFile.newDataInputStream())
}
// read properties
def projectName = properties.getProperty("project.name")
def projectGroupId = properties.getProperty("project.groupId")
def projectArtifactId = properties.getProperty("project.artifactId")
def projectVersionName = android.defaultConfig.versionName
def projectPackaging = properties.getProperty("project.packaging")
def projectSiteUrl = properties.getProperty("project.siteUrl")
def projectGitUrl = properties.getProperty("project.gitUrl")
def developerId = properties.getProperty("developer.id")
def developerName = properties.getProperty("developer.name")
def developerEmail = properties.getProperty("developer.email")
def bintrayUser = properties.getProperty("bintray.user")
def bintrayApikey = properties.getProperty("bintray.apikey")
def javadocName = properties.getProperty("javadoc.name")
group = projectGroupId
// This generates POM.xml with proper parameters
install {
repositories.mavenInstaller {
pom {
project {
name projectName
groupId projectGroupId
artifactId projectArtifactId
version projectVersionName
packaging projectPackaging
url projectSiteUrl
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id developerId
name developerName
email developerEmail
}
}
scm {
connection projectGitUrl
developerConnection projectGitUrl
url projectSiteUrl
}
}
}
}
}
if (project.hasProperty("kotlin")) {
// Disable creating javadocs
tasks.withType(Javadoc) {
enabled = false
}
}
// This generates sources.jar
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += configurations.compile
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
// This generates javadoc.jar
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
// javadoc configuration
javadoc {
options {
encoding "UTF-8"
charSet 'UTF-8'
author true
version projectVersionName
links "http://docs.oracle.com/javase/7/docs/api"
title javadocName
}
}
// bintray configuration
bintray {
user = bintrayUser
key = bintrayApikey
configurations = ['archives']
pkg {
repo = "maven"
name = projectName
websiteUrl = projectSiteUrl
vcsUrl = projectGitUrl
licenses = ["Apache-2.0"]
publish = true
}
}
\ No newline at end of file
// load properties
Properties properties = new Properties()
File localPropertiesFile = project.file("local.properties");
if (localPropertiesFile.exists()) {
properties.load(localPropertiesFile.newDataInputStream())
}
File projectPropertiesFile = project.file("project.properties");
if (projectPropertiesFile.exists()) {
properties.load(projectPropertiesFile.newDataInputStream())
}
// read properties
def projectName = properties.getProperty("project.name")
def projectSiteUrl = properties.getProperty("project.siteUrl")
def projectGitUrl = properties.getProperty("project.gitUrl")
def developerId = properties.getProperty("developer.id")
def developerName = properties.getProperty("developer.name")
def developerEmail = properties.getProperty("developer.email")
def bintrayUser = properties.getProperty("bintray.user")
def bintrayApikey = properties.getProperty("bintray.apikey")
def javadocName = properties.getProperty("javadoc.name")
// This generates POM.xml with proper parameters
install.repositories.mavenInstaller.pom.project {
name projectName
url projectSiteUrl
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id developerId
name developerName
email developerEmail
}
}
scm {
connection projectGitUrl
developerConnection projectGitUrl
url projectSiteUrl
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
// bintray configuration
bintray {
user = bintrayUser
key = bintrayApikey
configurations = ['archives']
pkg {
repo = "maven"
name = projectName
websiteUrl = projectSiteUrl
vcsUrl = projectGitUrl
licenses = ["Apache-2.0"]
publish = true
}
}
\ No newline at end of file
apply {
plugin Config.depConfig.plugin_traute.pluginId
plugin Config.depConfig.plugin_maven.pluginId
plugin Config.depConfig.plugin_bintray.pluginId
plugin "readme-sub"
}
......
apply {
plugin Config.depConfig.plugin_traute.pluginId
plugin Config.depConfig.plugin_maven.pluginId
plugin Config.depConfig.plugin_bintray.pluginId
plugin "readme-core"
from "${rootDir.path}/gradle/upload/bintrayUploadAndroid.gradle"
}
readme {
......@@ -27,10 +24,6 @@ android {
consumerProguardFiles 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
dependencies {
......@@ -44,4 +37,15 @@ dependencies {
testImplementation Config.depConfig.gson.dep
testImplementation Config.depConfig.support_appcompat_v7.dep
testImplementation Config.depConfig.eventbus_lib.dep
}
\ No newline at end of file
}
ext {
name = "UtilCode"
groupId = Config.depConfig.lib_utilcode.groupId
artifactId = Config.depConfig.lib_utilcode.artifactId
versionName = Config.depConfig.lib_utilcode.version
siteUrl = "https://github.com/Blankj/AndroidUtilCode"
}
apply from: "${rootDir.path}/gradle/publish.gradle"
......@@ -3,7 +3,4 @@ project.name=UtilCode
project.groupId=com.blankj
project.artifactId=utilcode
project.packaging=aar
project.siteUrl=https://github.com/Blankj/AndroidUtilCode
project.gitUrl=https://github.com/Blankj/AndroidUtilCode.git
#javadoc
javadoc.name=UtilCode
\ No newline at end of file
project.siteUrl=https://github.com/Blankj/AndroidUtilCode
\ No newline at end of file
apply {
plugin "com.github.dcendents.android-maven"
plugin "com.jfrog.bintray"
from "${rootDir.path}/gradle/upload/bintrayUploadAndroid.gradle"
}
dependencies {
......
apply {
plugin "com.github.dcendents.android-maven"
plugin "com.jfrog.bintray"
from "${rootDir.path}/gradle/upload/bintrayUploadAndroid.gradle"
}
dependencies {
implementation Config.depConfig.lib_utilcode.dep
implementation Config.depConfig.swipe_panel.dep
......
......@@ -5,13 +5,6 @@ plugins {
apply {
plugin "groovy"
plugin "java-gradle-plugin"
if (Config.depConfig.plugin_api.useLocal) {
plugin "maven"
} else {
plugin Config.depConfig.plugin_maven.pluginId
plugin Config.depConfig.plugin_bintray.pluginId
from "${rootDir.path}/gradle/upload/bintrayUploadJava.gradle"
}
}
gradlePlugin {
......@@ -40,19 +33,6 @@ sourceSets {
}
}
group = Config.depConfig.plugin_api.groupId
version = Config.depConfig.plugin_api.version
if (Config.depConfig.plugin_api.useLocal) {
uploadArchives {
repositories {
mavenDeployer {
repository(url: uri(new File(project.rootDir.getPath() + "/maven")))
}
}
}
}
pluginBundle {
website = 'https://github.com/Blankj/AndroidUtilCode'
vcsUrl = 'https://github.com/Blankj/AndroidUtilCode.git'
......@@ -67,6 +47,15 @@ pluginBundle {
}
}
//./gradlew plugin:api-gradle-plugin:uploadArchives // 上传到本地 maven
//./gradlew plugin:api-gradle-plugin:bintrayUpload // 上传到 jcenter
//./gradlew plugin:api-gradle-plugin:publishPlugins // 上传到 gradle 插件库中
ext {
name = "ApiPlugin"
groupId = Config.depConfig.plugin_api.groupId
artifactId = Config.depConfig.plugin_api.artifactId
versionName = Config.depConfig.plugin_api.version
siteUrl = "https://github.com/Blankj/AndroidUtilCode"
}
apply from: "${rootDir.path}/gradle/publish.gradle"
//./gradlew plugin:plugin_api-gradle-plugin:mavenLocal // 上传到本地 mavenLocal
//./gradlew plugin:plugin_api-gradle-plugin:bintrayUpload // 上传到 jcenter
//./gradlew plugin:plugin_api-gradle-plugin:publishPlugins // 上传到 gradle 插件库中
#project
project.name=ApiPlugin
project.groupId=com.blankj
project.artifactId=api-gradle-plugin
project.packaging=aar
project.siteUrl=https://github.com/Blankj/AndroidUtilCode
project.gitUrl=https://github.com/Blankj/AndroidUtilCode.git
#javadoc
javadoc.name=ApiPlugin
\ No newline at end of file
......@@ -5,13 +5,6 @@ plugins {
apply {
plugin "groovy"
plugin "java-gradle-plugin"
if (Config.depConfig.plugin_bus.useLocal) {
plugin "maven"
} else {
plugin Config.depConfig.plugin_maven.pluginId
plugin Config.depConfig.plugin_bintray.pluginId
from "${rootDir.path}/gradle/upload/bintrayUploadJava.gradle"
}
}
gradlePlugin {
......@@ -40,19 +33,6 @@ sourceSets {
}
}
group = Config.depConfig.plugin_bus.groupId
version = Config.depConfig.plugin_bus.version
if (Config.depConfig.plugin_bus.useLocal) {
uploadArchives {
repositories {
mavenDeployer {
repository(url: uri(new File(project.rootDir.getPath() + "/maven")))
}
}
}
}
pluginBundle {
website = 'https://github.com/Blankj/AndroidUtilCode'
vcsUrl = 'https://github.com/Blankj/AndroidUtilCode.git'
......@@ -67,6 +47,15 @@ pluginBundle {
}
}
//./gradlew plugin:bus-gradle-plugin:uploadArchives // 上传到本地 maven
//./gradlew plugin:bus-gradle-plugin:bintrayUpload // 上传到 jcenter
//./gradlew plugin:bus-gradle-plugin:publishPlugins // 上传到 gradle 插件库中
ext {
name = "BusPlugin"
groupId = Config.depConfig.plugin_bus.groupId
artifactId = Config.depConfig.plugin_bus.artifactId
versionName = Config.depConfig.plugin_bus.version
siteUrl = "https://github.com/Blankj/AndroidUtilCode"
}
apply from: "${rootDir.path}/gradle/publish.gradle"
//./gradlew plugin:lib_bus-gradle-plugin:mavenLocal // 上传到本地 mavenLocal
//./gradlew plugin:lib_bus-gradle-plugin:bintrayUpload // 上传到 jcenter
//./gradlew plugin:lib_bus-gradle-plugin:publishPlugins // 上传到 gradle 插件库中
\ No newline at end of file
#project
project.name=BusPlugin
project.groupId=com.blankj
project.artifactId=bus-gradle-plugin
project.packaging=aar
project.siteUrl=https://github.com/Blankj/AndroidUtilCode
project.gitUrl=https://github.com/Blankj/AndroidUtilCode.git
#javadoc
javadoc.name=BusPlugin
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册