Skip to content

Commit

Permalink
更换bintray插件
Browse files Browse the repository at this point in the history
  • Loading branch information
mylhyl committed Apr 25, 2018
1 parent b0631ce commit 0af65bd
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 88 deletions.
94 changes: 14 additions & 80 deletions acp/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven'
apply plugin: 'com.novoda.bintray-release'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
buildToolsVersion "25.0.0"
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName version
versionName '1.2.0'
}
buildTypes {
release {
Expand All @@ -19,85 +19,19 @@ android {
}
lintOptions {
abortOnError false
checkReleaseBuilds false
}
}

def siteUrl = 'https://github.com/mylhyl/AndroidAcp'
def gitUrl = 'https://github.com/mylhyl/AndroidAcp.git'

group = "com.mylhyl"
version = "1.2.0"

install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
artifactId 'acp'
name 'Simplify Android 6.0 complex permissions operation'
url siteUrl

licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}

developers {
developer {
id 'mylhyl'
name 'mylhylAndroid'
email '[email protected]'
}
}

scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
options.encoding = "UTF-8"
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives javadocJar
archives sourcesJar
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("BINTRAY_USER")
key = properties.getProperty("BINTRAY_KEY")
configurations = ['archives']
pkg {
repo = "maven"
name = "acp"
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true //是否发布
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.4.0'
}

publish {
userOrg = 'mylhyl'
groupId = 'com.mylhyl'
artifactId = 'acp'
version = '1.2.0'
description = 'Simplify Android 6.0 complex permissions operation'
website = "https://github.com/mylhyl/AndroidAcp"
}
15 changes: 12 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,23 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.novoda:bintray-release:0.3.4'
}
}

allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}

tasks.withType(Javadoc) {
options {
encoding "UTF-8"
charSet 'UTF-8'
links "http://docs.oracle.com/javase/7/docs/api"
failOnError false
}
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Wed Apr 25 16:27:49 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
9 changes: 7 additions & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
buildToolsVersion "25.0.0"

defaultConfig {
applicationId "com.mylhyl.acp.sample"
Expand All @@ -17,12 +17,17 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':acp')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.4'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
}
7 changes: 6 additions & 1 deletion sample/src/main/java/com/mylhyl/acp/sample/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
/**
* Created by hupei on 2016/9/5.
*/
public class App extends Application{
public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
if (LeakCanary.isInAnalyzerProcess(this)) {
// This process is dedicated to LeakCanary for heap analysis.
// You should not init your app in this process.
return;
}
LeakCanary.install(this);
}
}

0 comments on commit 0af65bd

Please sign in to comment.