Skip to content

Commit

Permalink
增加JCenter配置
Browse files Browse the repository at this point in the history
  • Loading branch information
l123456789jy committed Dec 24, 2015
1 parent 90ce601 commit cededaf
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 49 deletions.
13 changes: 4 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha2'

classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
repositories {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
100 changes: 90 additions & 10 deletions lazylibrary/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
apply plugin: 'com.android.library'

apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
// 这个version是区分library版本的,因此当我们需要更新library时记得修改这个version
version = "1.0.0"
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

compileSdkVersion 17
buildToolsVersion "21.1.1"
resourcePrefix "1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
minSdkVersion 9
targetSdkVersion 21
versionCode 1
versionName "1.0"
versionName version
}
buildTypes {
release {
Expand All @@ -18,9 +21,86 @@ android {
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
}
def siteUrl = 'https://github.com/saymagic/AndroidUtils'
// 项目的主页
def gitUrl = 'https://github.com/l123456789jy/Lazy'
// Git仓库的url
group = "com.github.lazylibrary" // Maven Group ID for the artifact,一般填你唯一的包名
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
// Add your description here
name 'Android Commonly used utils' //项目描述
url siteUrl
// Set your license
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'lazy' //填写开发者基本信息
name 'lazy'
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) {
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.apikey")
configurations = ['archives']
pkg {
repo = "maven" //发布到Bintray的那个仓库里,默认账户有四个库,我们这里上传到maven库
name = "utils" //发布到Bintray上的项目名字
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
javadoc {
options{
encoding "UTF-8"
charSet 'UTF-8'
author true
version true
links "http://docs.oracle.com/javase/7/docs/api"
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,6 @@ public static boolean copyAssetToSDCard(AssetManager assetManager, String fileNa
is.close();
}
} catch (IOException e) {
Log.e(TAG, e + "");
return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.support.v4.app.ActivityCompat;

/**
* 手机组件调用工具类
Expand Down Expand Up @@ -55,32 +54,4 @@ public static void sendMessage(Context activity, String phoneNumber, String smsC
}


/**
* 调用系统打电话界面
*
* @param context 上下文
* @param phoneNumber 手机号码
*/
public static void callPhones(Context context, String phoneNumber) {
if (phoneNumber == null || phoneNumber.length() < 1) {
return;
}
Uri uri = Uri.parse("tel:" + phoneNumber);
Intent intent = new Intent(Intent.ACTION_CALL, uri);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (ActivityCompat.checkSelfPermission(context,
Manifest.permission.CALL_PHONE) !=
PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return;
}
context.startActivity(intent);
}

}

0 comments on commit cededaf

Please sign in to comment.