Skip to content

Commit

Permalink
merge from dev
Browse files Browse the repository at this point in the history
  • Loading branch information
liaohuqiu committed Dec 5, 2014
2 parents 6a26057 + aa43d36 commit 73dd170
Show file tree
Hide file tree
Showing 202 changed files with 3,601 additions and 7,566 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
*.class

# libs
libs/

# generated files
bin/
.idea/
.gradle/
gen/
target/
build/

# Local configuration file (sdk path, etc)
local.properties
Expand Down
2 changes: 0 additions & 2 deletions .settings/org.eclipse.core.resources.prefs

This file was deleted.

4 changes: 0 additions & 4 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

46 changes: 46 additions & 0 deletions README-cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Cube-SDK 是一个开发框架。这个框架致力于快速实现需求,解放生产力。

![Screen Shot](https://raw.githubusercontent.com/etao-open-source/cube-sdk/dev/screen-shot.png)

文档: http://cube-sdk.liaohuqiu.net/cn

Demo 项目移到了这里: https://github.com/liaohuqiu/android-cube-app

### 在项目中引入


项目现在已经发布到了maven中央库,有 `aar` and `apklib` 和两种格式

##### 在 pom.xml 中

引用apklib:

```xml
<dependency>
<groupId>in.srain.cube</groupId>
<artifactId>cube-sdk</artifactId>
<type>apklib</type>
<version>1.0.42</version>
</dependency>
```

或者引入aar:

```
<dependency>
<groupId>in.srain.cube</groupId>
<artifactId>cube-sdk</artifactId>
<type>aar</type>
<version>1.0.42</version>
</dependency>
```

##### 在 Gradle / Android Studio

``` gradle
compile 'in.srain.cube:cube-sdk:1.0.42@aar'
`````
##### eclipse
直接将core文件夹下的内容作为一个类库加载,然后在项目中引用
42 changes: 31 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,48 @@
`Cube` is a light package for Android development.
##[中文说明](https://github.com/etao-open-source/cube-sdk/blob/master/README-cn.md)


`Cube` is a light package for Android development.

![Screen Shot](https://raw.githubusercontent.com/etao-open-source/cube-sdk/dev/screen-shot.png)

DEMO project has been moved to [HERE](https://github.com/liaohuqiu/android-cube-app).

All of the `readme` content and document are moved to Github Pages, please visit the Github Pages for more imformation:

### Usage
http://cube-sdk.liaohuqiu.net

It's in Maven Central:
### Import to your project

Cube-SDK has been pushed to Maven Central, both in `aar` and `apklib` format.

##### Using in pom.xml

```xml
<dependency>
<groupId>in.srain.cube</groupId>
<artifactId>cube-sdk</artifactId>
<type>apklib</type>
<version>1.0.34</version>
<version>1.0.42</version>
</dependency>
```

###[`Github Pages`](http://cube-sdk.liaohuqiu.net)
or:

```
<dependency>
<groupId>in.srain.cube</groupId>
<artifactId>cube-sdk</artifactId>
<type>aar</type>
<version>1.0.42</version>
</dependency>
```

###[`中文版文档`](http://cube-sdk.liaohuqiu.net/cn)
###### Gradle / Android Studio

---
``` gradle
compile 'in.srain.cube:cube-sdk:1.0.42@aar'
`````
* srain@php.net
* twitter: https://twitter.com/liaohuqiu
* weibo: http://weibo.com/liaohuqiu
* QQ交流群: 271918140
###### Eclipse
Load the content into you eclipse, it's library project. Then use it in your application project.
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
}
}

allprojects {
repositories {
jcenter()
}
}
4 changes: 0 additions & 4 deletions core/README.md

This file was deleted.

91 changes: 91 additions & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
}
}

allprojects {
repositories {
jcenter()
mavenCentral();
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION

defaultConfig {
applicationId "in.srain.cube"
minSdkVersion 8
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
}

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['resources']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
// aidl.srcDirs = ['src']
// renderscript.srcDirs = ['src']
}

androidTest.setRoot('tests')
}
}

task copyLibs << {

// copy jars
copy {
from configurations.compile
into "libs"

// exclude: apkilib, aar, support-v*
eachFile { file ->
if (file.name.contains("apklib") || file.name.contains("aar")) {
file.exclude()
}
}
}

// copy source
copy {

def sourceList = configurations.compile.incoming.dependencies.collect { dependency ->
dependency.artifact { artifact ->
artifact.name = dependency.name
artifact.type = 'source'
artifact.extension = 'jar'
artifact.classifier = 'sources'
}
dependency
}
from(configurations.detachedConfiguration(sourceList as Dependency[]).resolvedConfiguration.
resolvedConfiguration.lenientConfiguration.getFiles(Specs.SATISFIES_ALL)) {
}

into("libs")

// exclude: apkilib, aar, support-v*
eachFile { file ->
if (file.name.contains("apklib") || file.name.contains("aar") || file.name.contains("support-v4")) {
file.exclude()
}
}
}
}

dependencies {
compile 'in.srain.cube:clog:1.0.2'
// compile 'com.android.support:support-v4:20.0.0'
compile 'com.google.android:support-v4:r7'
}
apply from: './gradle-mvn-push.gradle'
125 changes: 125 additions & 0 deletions core/gradle-mvn-push.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
apply plugin: 'maven'
apply plugin: 'signing'

def isReleaseBuild() {
return VERSION_NAME.contains("SNAPSHOT") == false
}

def getReleaseRepositoryUrl() {
if (VERSION_NAME.contains("-ali") == true) {
return 'http://mvnrepo.taobao.ali.com/mvn/repository';
}
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
}

def getSnapshotRepositoryUrl() {
// only publish to snapshots
if (VERSION_NAME.contains("-ali") == true) {
return 'http://mvnrepo.taobao.ali.com/mvn/snapshots/';
}
return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
: "https://oss.sonatype.org/content/repositories/snapshots/"
}

def getRepositoryUsername() {
if (VERSION_NAME.contains("-ali") == true) {
return ALI_USERNAME
}
return hasProperty('OSS_USERNAME') ? OSS_USERNAME : ''
}

def getRepositoryPassword() {
if (VERSION_NAME.contains("-ali") == true) {
return ALI_PWD
}
return hasProperty('OSS_PWD') ? OSS_PWD : ''
}

afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

pom.groupId = POM_GROUP
pom.artifactId = POM_ARTIFACT_ID
pom.version = VERSION_NAME

repository(url: getReleaseRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
snapshotRepository(url: getSnapshotRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}

pom.project {
name POM_NAME
packaging POM_PACKAGING
description POM_DESCRIPTION
url POM_URL

scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEV_CONNECTION
}

licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
distribution POM_LICENCE_DIST
}
}

developers {
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
}
}
}
}
}
}

signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}

task apklib(type: Zip) {

appendix = extension = 'apklib'

from 'AndroidManifest.xml'
into('res') {
from 'res'
}
into('src') {
from 'src'
}
}

task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

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

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

artifacts {
archives androidSourcesJar
archives androidJavadocsJar
archives apklib
}
}
24 changes: 24 additions & 0 deletions core/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
VERSION_NAME=1.0.42

ANDROID_BUILD_MIN_SDK_VERSION=8
ANDROID_BUILD_TARGET_SDK_VERSION=16
ANDROID_BUILD_SDK_VERSION=19
ANDROID_BUILD_TOOLS_VERSION=20.0.0

POM_GROUP=in.srain.cube
POM_ARTIFACT_ID=cube-sdk
POM_PACKAGING=aar

POM_NAME=Cube SDK
POM_DESCRIPTION=Cube SDK, library for Android development

POM_URL=https://github.com/etao-open-source/cube-sdk
POM_SCM_URL=https://github.com/etao-open-source/cube-sdk
POM_SCM_CONNECTION=scm:https://github.com/etao-open-source/cube-sdk.git
POM_SCM_DEV_CONNECTION=scm:https://github.com/etao-open-source/cube-sdk.git

POM_LICENCE_NAME=Apache 2
POM_LICENCE_URL=
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=liaohuqiu
POM_DEVELOPER_NAME=liaohuqiu
Binary file removed core/libs/android-support-v4.jar
Binary file not shown.
Binary file added core/libs/clog-1.0.2-sources.jar
Binary file not shown.
Binary file added core/libs/clog-1.0.2.jar
Binary file not shown.
Binary file added core/libs/support-v4-r7.jar
Binary file not shown.
Loading

0 comments on commit 73dd170

Please sign in to comment.