Skip to content

Commit

Permalink
update gradle scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
liyujiang-gzu committed Jan 19, 2016
1 parent b91444c commit e390559
Show file tree
Hide file tree
Showing 14 changed files with 247 additions and 250 deletions.
14 changes: 14 additions & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Change Log

## [1.0.3] - 2016.01.19
* 日期时间、地址、单项、数字等选择器支持伪循环滚动。

## [1.0.2] - 2016.01.15
* 年或月变动时,保持之前选择的日不动:如果之前选择的日是之前年月的最大日,则日自动为该年月的最大日。

## [1.0.1] - 2016.01.14
* 精简文件选择器的数据适配器;
* 添加选择器顶部确定、取消按钮所在容器的背景色设置。

## [1.0.0] - 2016.01.13
* 发布到jcenter,支持远程maven依赖。
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Summary
[![API](https://img.shields.io/badge/API-8%2B-green.svg)](https://github.com/gzu-liyujiang/AndroidPicker)
[![Download](https://api.bintray.com/packages/gzu-liyujiang/maven/AndroidPicker/images/download.svg)](https://bintray.com/gzu-liyujiang/maven/AndroidPicker/_latestVersion)
[Jcenter版本列表](http://jcenter.bintray.com/cn/qqtheme/framework/AndroidPicker/)
[Jcenter版本列表](http://jcenter.bintray.com/cn/qqtheme/framework/AndroidPicker/) [版本迭代日志](/CHANGE.md)
安卓选择器类库,包括日期选择器、时间选择器、单项选择器、城市选择器、颜色选择器、文件选择器、目录选择器、数字选择器、星座选择器、生肖选择器等。
欢迎大伙儿在[issues](https://github.com/gzu-liyujiang/AndroidPicker/issues)提交你的意见或建议

项目分支说明:
[Branch_OldAndroidPicker](https://github.com/gzu-liyujiang/AndroidPicker/tree/Branch_OldAndroidPicker)-基于android-wheel的旧版选择器,不再维护;
[release_0.9](https://github.com/gzu-liyujiang/AndroidPicker/tree/release_0.9)-WheelPicker、ColorPicker、FilePicker是分开的三个模块
[master](https://github.com/gzu-liyujiang/AndroidPicker/tree/master)-默认的最新分支,release_0.9之后支持maven库依赖
[Branch_MultiPart](https://github.com/gzu-liyujiang/AndroidPicker/tree/Branch_MultiPart)-WheelPicker、ColorPicker及FilePicker是分开的三个模块
[master](https://github.com/gzu-liyujiang/AndroidPicker/tree/master)-默认的最新分支,WheelPicker、ColorPicker及FilePicker合并为一个模块

# Install
“app”是测试用例;“library”包括WheelPicker、ColorPicker、FilePicker,
Expand Down
25 changes: 2 additions & 23 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,8 @@ apply plugin: 'com.android.application'

android {

compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOL_VERSION

defaultConfig {
minSdkVersion MIN_SDK_VERSION as int
targetSdkVersion COMPILE_SDK_VERSION as int
versionCode VERSION_CODE as int
versionName VERSION_NAME
}

buildTypes {
release {
//是否调试模式
debuggable false
//是否zip优化
zipAlignEnabled true
//是否移除无用的资源
Expand All @@ -25,21 +13,12 @@ android {
//混淆配置文件
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
minifyEnabled false
}
}

lintOptions {
//忽略lint错误
abortOnError false
}

}

dependencies {
compile 'com.alibaba:fastjson:1.1.46.android'
compile project(':library')
//compile 'cn.qqtheme.framework:AndroidPicker:1.0.2'
//compile project(':library')
compile 'cn.qqtheme.framework:AndroidPicker:latest.integration'
}
2 changes: 0 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
xmlns:tools="http://schemas.android.com/tools"
package="cn.qqtheme.androidpicker">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Expand All @@ -20,7 +19,6 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".GithubActivity" />
</application>

</manifest>
18 changes: 0 additions & 18 deletions app/src/main/java/cn/qqtheme/androidpicker/GithubActivity.java

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/java/cn/qqtheme/androidpicker/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,6 @@ public void onFilePicked(String currentPath) {
picker.show();
}

public void onGithub(View view) {
Intent intent = new Intent(this, GithubActivity.class);
startActivity(intent);
}

public void onContact(View view) {
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setData(Uri.parse("mailto:[email protected]"));
Expand Down
12 changes: 0 additions & 12 deletions app/src/main/res/layout/activity_github.xml

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,6 @@
android:onClick="onDirPicker"
android:text="目录选择" />

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onGithub"
android:text="开源代码主页" />

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
213 changes: 208 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,223 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
//参考:https://raw.github.com/dm77/barcodescanner/master/build.gradle

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.5"
classpath "com.android.tools.build:gradle:${GRADLE_BUILD_VERSION}"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:${GRADLE_BINTRAY_VERSION}"
}
}

allprojects {
group = PROJ_GROUP
version = PROJ_VERSION

repositories {
jcenter()
jcenter() //bintray的maven库
mavenCentral() //sonatype的maven库
mavenLocal() //本地maven库
flatDir {
dirs 'libs' //this way we can find the .aar file in libs folder
dirs 'libs' //本地.aar文件
}
}

ext {
isLibrary = false
pomGroup = PROJ_GROUP
pomArtifactId = "library"
pomVersion = PROJ_VERSION
pomDescription = 'This is library description'
}

}

subprojects {
afterEvaluate { Project project ->
ext.pluginContainer = project.getPlugins()
def hasAppPlugin = ext.pluginContainer.hasPlugin("com.android.application")
def hasLibPlugin = ext.pluginContainer.hasPlugin("com.android.library")
if (hasAppPlugin || hasLibPlugin) {
android {
compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOL_VERSION

defaultConfig {
minSdkVersion MIN_SDK_VERSION as int
targetSdkVersion COMPILE_SDK_VERSION as int
versionCode VERSION_CODE as int
versionName VERSION_NAME
}

buildTypes {
release {
debuggable false
minifyEnabled false
proguardFile getDefaultProguardFile('proguard-android.txt')
}
debug {
debuggable true
minifyEnabled false
}
}

lintOptions {
abortOnError false
}

packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/ASL2.0'
}

}

dependencies {
compile "com.android.support:support-v4:${BUILD_TOOL_VERSION}"
compile "com.android.support:support-annotations:${BUILD_TOOL_VERSION}"
}
}

if (project.isLibrary) {
configure(project) {
// 这个脚本是用来发布库项目到jcenter
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'

version = project.pomVersion //版本号
group = PROJ_GROUP // 包名
project.archivesBaseName = project.pomArtifactId

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))
exclude '**/BuildConfig.java'
exclude '**/R.java'
failOnError = false
}

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

javadoc {
options {
encoding "UTF-8"
charSet 'UTF-8'
author true
version true
links "http://docs.oracle.com/javase/7/docs/api"
title project.pomArtifactId
}
}

publishing {
publications {
mavenJava(MavenPublication) {
artifactId project.pomArtifactId
artifact "${buildDir}/outputs/aar/${project.name}-release.aar"
artifact javadocJar
artifact sourcesJar

pom.withXml {
Node root = asNode()
root.appendNode('name', project.pomArtifactId)
root.appendNode('description', project.pomDescription)
root.appendNode('url', PROJ_WEBSITE_URL)

def issues = root.appendNode('issueManagement')
issues.appendNode('system', 'github')
issues.appendNode('url', PROJ_ISSUE_URL)

def scm = root.appendNode('scm')
scm.appendNode('url', PROJ_GIT_URL)
scm.appendNode('connection', "scm:git:${PROJ_GIT_URL}")
scm.appendNode('developerConnection', "scm:git:${PROJ_GIT_URL}")

def license = root.appendNode('licenses').appendNode('license')
license.appendNode('name', "The Apache Software License, Version 2.0")
license.appendNode('url', "http://www.apache.org/licenses/LICENSE-2.0.txt")
license.appendNode('distribution', "repo")

def developer = root.appendNode('developers').appendNode('developer')
developer.appendNode('id', DEVELOPER_ID)
developer.appendNode('name', DEVELOPER_NAME)
developer.appendNode('email', DEVELOPER_EMAIL)

def dependenciesNode = root.appendNode('dependencies')
configurations.compile.allDependencies.each {
if (it.group && it.name && it.version) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
}

afterEvaluate {
publishing.publications.mavenJava.artifact(bundleRelease)
}

bintray {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")

publications = ['mavenJava']
publish = true //是否发布

pkg {
repo = "maven" //上传的中央仓库名称
name = project.pomArtifactId //发布到中央仓库上的项目名字
desc = project.pomDescription
websiteUrl = PROJ_WEBSITE_URL //项目主页
issueTrackerUrl = PROJ_ISSUE_URL //项目讨论页
vcsUrl = PROJ_GIT_URL //项目GIT仓库
licenses = ["Apache-2.0"]
publicDownloadNumbers = true
version {
name = project.pomVersion
desc = project.pomDescription
gpg {
sign = true //是否GPG签名,可使用Gpg4win创建密钥文件
passphrase = properties.getProperty("bintray.gpg.password")
//GPG签名所用密钥
}
mavenCentralSync {
sync = false //是否同步到Maven Central
user = properties.getProperty("sonatype.user") //sonatype用户名
password = properties.getProperty("sonatype.password")
//sonatype密码
close = '1'
}
}
}
}

}
}
}
}

Loading

0 comments on commit e390559

Please sign in to comment.