Skip to content

Commit 73dd170

Browse files
committed
merge from dev
2 parents 6a26057 + aa43d36 commit 73dd170

File tree

202 files changed

+3601
-7566
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+3601
-7566
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
*.class
1111

1212
# libs
13-
libs/
1413

1514
# generated files
1615
bin/
16+
.idea/
17+
.gradle/
1718
gen/
1819
target/
20+
build/
1921

2022
# Local configuration file (sdk path, etc)
2123
local.properties

.settings/org.eclipse.core.resources.prefs

Lines changed: 0 additions & 2 deletions
This file was deleted.

.settings/org.eclipse.jdt.core.prefs

Lines changed: 0 additions & 4 deletions
This file was deleted.

README-cn.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Cube-SDK 是一个开发框架。这个框架致力于快速实现需求,解放生产力。
2+
3+
![Screen Shot](https://raw.githubusercontent.com/etao-open-source/cube-sdk/dev/screen-shot.png)
4+
5+
文档: http://cube-sdk.liaohuqiu.net/cn
6+
7+
Demo 项目移到了这里: https://github.com/liaohuqiu/android-cube-app
8+
9+
### 在项目中引入
10+
11+
12+
项目现在已经发布到了maven中央库,有 `aar` and `apklib` 和两种格式
13+
14+
##### 在 pom.xml 中
15+
16+
引用apklib:
17+
18+
```xml
19+
<dependency>
20+
<groupId>in.srain.cube</groupId>
21+
<artifactId>cube-sdk</artifactId>
22+
<type>apklib</type>
23+
<version>1.0.42</version>
24+
</dependency>
25+
```
26+
27+
或者引入aar:
28+
29+
```
30+
<dependency>
31+
<groupId>in.srain.cube</groupId>
32+
<artifactId>cube-sdk</artifactId>
33+
<type>aar</type>
34+
<version>1.0.42</version>
35+
</dependency>
36+
```
37+
38+
##### 在 Gradle / Android Studio
39+
40+
``` gradle
41+
compile 'in.srain.cube:cube-sdk:1.0.42@aar'
42+
`````
43+
44+
##### eclipse
45+
46+
直接将core文件夹下的内容作为一个类库加载,然后在项目中引用

README.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,48 @@
1-
`Cube` is a light package for Android development.
1+
##[中文说明](https://github.com/etao-open-source/cube-sdk/blob/master/README-cn.md)
2+
3+
4+
`Cube` is a light package for Android development.
5+
6+
![Screen Shot](https://raw.githubusercontent.com/etao-open-source/cube-sdk/dev/screen-shot.png)
7+
8+
DEMO project has been moved to [HERE](https://github.com/liaohuqiu/android-cube-app).
29

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

5-
### Usage
12+
http://cube-sdk.liaohuqiu.net
613

7-
It's in Maven Central:
14+
### Import to your project
15+
16+
Cube-SDK has been pushed to Maven Central, both in `aar` and `apklib` format.
17+
18+
##### Using in pom.xml
819

920
```xml
1021
<dependency>
1122
<groupId>in.srain.cube</groupId>
1223
<artifactId>cube-sdk</artifactId>
1324
<type>apklib</type>
14-
<version>1.0.34</version>
25+
<version>1.0.42</version>
1526
</dependency>
1627
```
1728

18-
###[`Github Pages`](http://cube-sdk.liaohuqiu.net)
29+
or:
30+
31+
```
32+
<dependency>
33+
<groupId>in.srain.cube</groupId>
34+
<artifactId>cube-sdk</artifactId>
35+
<type>aar</type>
36+
<version>1.0.42</version>
37+
</dependency>
38+
```
1939

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

22-
---
42+
``` gradle
43+
compile 'in.srain.cube:cube-sdk:1.0.42@aar'
44+
`````
2345
24-
* srain@php.net
25-
* twitter: https://twitter.com/liaohuqiu
26-
* weibo: http://weibo.com/liaohuqiu
27-
* QQ交流群: 271918140
46+
###### Eclipse
2847
48+
Load the content into you eclipse, it's library project. Then use it in your application project.

build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
buildscript {
2+
repositories {
3+
jcenter()
4+
}
5+
dependencies {
6+
classpath 'com.android.tools.build:gradle:0.12.+'
7+
}
8+
}
9+
10+
allprojects {
11+
repositories {
12+
jcenter()
13+
}
14+
}

core/README.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

core/build.gradle

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
buildscript {
2+
repositories {
3+
jcenter()
4+
}
5+
dependencies {
6+
classpath 'com.android.tools.build:gradle:0.12.+'
7+
}
8+
}
9+
10+
allprojects {
11+
repositories {
12+
jcenter()
13+
mavenCentral();
14+
}
15+
}
16+
17+
apply plugin: 'com.android.library'
18+
19+
android {
20+
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
21+
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
22+
23+
defaultConfig {
24+
applicationId "in.srain.cube"
25+
minSdkVersion 8
26+
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
27+
}
28+
29+
sourceSets {
30+
main {
31+
manifest.srcFile 'AndroidManifest.xml'
32+
java.srcDirs = ['src']
33+
resources.srcDirs = ['resources']
34+
res.srcDirs = ['res']
35+
assets.srcDirs = ['assets']
36+
// aidl.srcDirs = ['src']
37+
// renderscript.srcDirs = ['src']
38+
}
39+
40+
androidTest.setRoot('tests')
41+
}
42+
}
43+
44+
task copyLibs << {
45+
46+
// copy jars
47+
copy {
48+
from configurations.compile
49+
into "libs"
50+
51+
// exclude: apkilib, aar, support-v*
52+
eachFile { file ->
53+
if (file.name.contains("apklib") || file.name.contains("aar")) {
54+
file.exclude()
55+
}
56+
}
57+
}
58+
59+
// copy source
60+
copy {
61+
62+
def sourceList = configurations.compile.incoming.dependencies.collect { dependency ->
63+
dependency.artifact { artifact ->
64+
artifact.name = dependency.name
65+
artifact.type = 'source'
66+
artifact.extension = 'jar'
67+
artifact.classifier = 'sources'
68+
}
69+
dependency
70+
}
71+
from(configurations.detachedConfiguration(sourceList as Dependency[]).resolvedConfiguration.
72+
resolvedConfiguration.lenientConfiguration.getFiles(Specs.SATISFIES_ALL)) {
73+
}
74+
75+
into("libs")
76+
77+
// exclude: apkilib, aar, support-v*
78+
eachFile { file ->
79+
if (file.name.contains("apklib") || file.name.contains("aar") || file.name.contains("support-v4")) {
80+
file.exclude()
81+
}
82+
}
83+
}
84+
}
85+
86+
dependencies {
87+
compile 'in.srain.cube:clog:1.0.2'
88+
// compile 'com.android.support:support-v4:20.0.0'
89+
compile 'com.google.android:support-v4:r7'
90+
}
91+
apply from: './gradle-mvn-push.gradle'

core/gradle-mvn-push.gradle

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
apply plugin: 'maven'
2+
apply plugin: 'signing'
3+
4+
def isReleaseBuild() {
5+
return VERSION_NAME.contains("SNAPSHOT") == false
6+
}
7+
8+
def getReleaseRepositoryUrl() {
9+
if (VERSION_NAME.contains("-ali") == true) {
10+
return 'http://mvnrepo.taobao.ali.com/mvn/repository';
11+
}
12+
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
13+
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
14+
}
15+
16+
def getSnapshotRepositoryUrl() {
17+
// only publish to snapshots
18+
if (VERSION_NAME.contains("-ali") == true) {
19+
return 'http://mvnrepo.taobao.ali.com/mvn/snapshots/';
20+
}
21+
return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
22+
: "https://oss.sonatype.org/content/repositories/snapshots/"
23+
}
24+
25+
def getRepositoryUsername() {
26+
if (VERSION_NAME.contains("-ali") == true) {
27+
return ALI_USERNAME
28+
}
29+
return hasProperty('OSS_USERNAME') ? OSS_USERNAME : ''
30+
}
31+
32+
def getRepositoryPassword() {
33+
if (VERSION_NAME.contains("-ali") == true) {
34+
return ALI_PWD
35+
}
36+
return hasProperty('OSS_PWD') ? OSS_PWD : ''
37+
}
38+
39+
afterEvaluate { project ->
40+
uploadArchives {
41+
repositories {
42+
mavenDeployer {
43+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
44+
45+
pom.groupId = POM_GROUP
46+
pom.artifactId = POM_ARTIFACT_ID
47+
pom.version = VERSION_NAME
48+
49+
repository(url: getReleaseRepositoryUrl()) {
50+
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
51+
}
52+
snapshotRepository(url: getSnapshotRepositoryUrl()) {
53+
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
54+
}
55+
56+
pom.project {
57+
name POM_NAME
58+
packaging POM_PACKAGING
59+
description POM_DESCRIPTION
60+
url POM_URL
61+
62+
scm {
63+
url POM_SCM_URL
64+
connection POM_SCM_CONNECTION
65+
developerConnection POM_SCM_DEV_CONNECTION
66+
}
67+
68+
licenses {
69+
license {
70+
name POM_LICENCE_NAME
71+
url POM_LICENCE_URL
72+
distribution POM_LICENCE_DIST
73+
}
74+
}
75+
76+
developers {
77+
developer {
78+
id POM_DEVELOPER_ID
79+
name POM_DEVELOPER_NAME
80+
}
81+
}
82+
}
83+
}
84+
}
85+
}
86+
87+
signing {
88+
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
89+
sign configurations.archives
90+
}
91+
92+
task apklib(type: Zip) {
93+
94+
appendix = extension = 'apklib'
95+
96+
from 'AndroidManifest.xml'
97+
into('res') {
98+
from 'res'
99+
}
100+
into('src') {
101+
from 'src'
102+
}
103+
}
104+
105+
task androidJavadocs(type: Javadoc) {
106+
source = android.sourceSets.main.java.srcDirs
107+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
108+
}
109+
110+
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
111+
classifier = 'javadoc'
112+
from androidJavadocs.destinationDir
113+
}
114+
115+
task androidSourcesJar(type: Jar) {
116+
classifier = 'sources'
117+
from android.sourceSets.main.java.srcDirs
118+
}
119+
120+
artifacts {
121+
archives androidSourcesJar
122+
archives androidJavadocsJar
123+
archives apklib
124+
}
125+
}

core/gradle.properties

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
VERSION_NAME=1.0.42
2+
3+
ANDROID_BUILD_MIN_SDK_VERSION=8
4+
ANDROID_BUILD_TARGET_SDK_VERSION=16
5+
ANDROID_BUILD_SDK_VERSION=19
6+
ANDROID_BUILD_TOOLS_VERSION=20.0.0
7+
8+
POM_GROUP=in.srain.cube
9+
POM_ARTIFACT_ID=cube-sdk
10+
POM_PACKAGING=aar
11+
12+
POM_NAME=Cube SDK
13+
POM_DESCRIPTION=Cube SDK, library for Android development
14+
15+
POM_URL=https://github.com/etao-open-source/cube-sdk
16+
POM_SCM_URL=https://github.com/etao-open-source/cube-sdk
17+
POM_SCM_CONNECTION=scm:https://github.com/etao-open-source/cube-sdk.git
18+
POM_SCM_DEV_CONNECTION=scm:https://github.com/etao-open-source/cube-sdk.git
19+
20+
POM_LICENCE_NAME=Apache 2
21+
POM_LICENCE_URL=
22+
POM_LICENCE_DIST=repo
23+
POM_DEVELOPER_ID=liaohuqiu
24+
POM_DEVELOPER_NAME=liaohuqiu

0 commit comments

Comments
 (0)