Skip to content

Commit

Permalink
see 03/26 log
Browse files Browse the repository at this point in the history
  • Loading branch information
Blankj committed Mar 26, 2020
1 parent a6d3e4e commit d21758b
Show file tree
Hide file tree
Showing 17 changed files with 178 additions and 297 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ local.properties
.externalNativeBuild
/apk
*.phrof
/maven
/mavenLocal
/reports
*/reports
5 changes: 0 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
* `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.
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -66,4 +66,4 @@ allprojects {

task clean(type: Delete) {
delete rootProject.buildDir
}
}
2 changes: 1 addition & 1 deletion buildSrc/src/main/groovy/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/groovy/ConfigUtils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
}
}
Expand Down
135 changes: 135 additions & 0 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
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"]
}
}
121 changes: 0 additions & 121 deletions gradle/upload/bintrayUploadAndroid.gradle

This file was deleted.

Loading

0 comments on commit d21758b

Please sign in to comment.