forked from Meituan-Dianping/walle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ae513aa
Showing
73 changed files
with
8,274 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
### Java template | ||
*.class | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.ear | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
### Gradle template | ||
.gradle | ||
build/ | ||
|
||
# Ignore Gradle GUI config | ||
gradle-app.setting | ||
|
||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) | ||
!gradle-wrapper.jar | ||
|
||
# Cache of project | ||
.gradletasknamecache | ||
|
||
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 | ||
# gradle/wrapper/gradle-wrapper.properties | ||
### Android template | ||
# Built application files | ||
*.apk | ||
*.ap_ | ||
|
||
# Files for the ART/Dalvik VM | ||
*.dex | ||
|
||
# Java class files | ||
*.class | ||
|
||
# Generated files | ||
bin/ | ||
gen/ | ||
out/ | ||
|
||
# Gradle files | ||
.gradle/ | ||
build/ | ||
|
||
# Local configuration file (sdk path, etc) | ||
local.properties | ||
|
||
# Proguard folder generated by Eclipse | ||
proguard/ | ||
|
||
# Log Files | ||
*.log | ||
|
||
# Android Studio Navigation editor temp files | ||
.navigation/ | ||
|
||
# Android Studio captures folder | ||
captures/ | ||
|
||
# Intellij | ||
*.iml | ||
.idea/workspace.xml | ||
.idea | ||
|
||
# Keystore files | ||
*.jks | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
## Walle | ||
[![license](http://img.shields.io/badge/license-BSD3-brightgreen.svg?style=flat)](https://github.com/Tencent/tinker/blob/master/LICENSE) | ||
|
||
支持Android Signature V2 Scheme的渠道包打包神器 | ||
|
||
![walle.png](assets/walle.png) | ||
|
||
## 使用说明 | ||
在位于项目的根目录 `build.gradle` 文件中添加walle plugin的依赖 | ||
Add tinker-gradle-plugin as a dependency in your main in the root of your project: | ||
|
||
```gradle | ||
buildscript { | ||
dependencies { | ||
classpath ('com.meituan.android.walle:plugin:0.0.1') | ||
} | ||
} | ||
``` | ||
|
||
Then you need to "apply" the plugin and add dependencies by adding the following lines to your `app/build.gradle`. | ||
|
||
```gradle | ||
dependencies { | ||
//optional, help to generate the final application | ||
compile('com.tencent.tinker:tinker-android-anno:1.6.0') | ||
//tinker's main Android lib | ||
compile('com.tencent.tinker:tinker-android-lib:1.6.0') | ||
} | ||
... | ||
... | ||
apply plugin: 'com.tencent.tinker.patch' | ||
``` | ||
|
||
If your app has a class that subclasses android.app.Application, then you need to modify that class, and move all its implements to [SampleApplicationLike](https://github.com/Tencent/tinker/blob/master/tinker-sample-android/app/src/main/java/tinker/sample/android/app/SampleApplicationLike.java) rather than Application: | ||
|
||
```java | ||
-public class YourApplication extends Application { | ||
+public class SampleApplicationLike extends DefaultApplicationLike { | ||
``` | ||
|
||
Now you should change your `Application` class, make it a subclass of [TinkerApplication](https://github.com/Tencent/tinker/blob/master/tinker-android/tinker-android-loader/src/main/java/com/tencent/tinker/loader/app/TinkerApplication.java). As you can see from its API, it is an abstract class that does not have a default constructor, so you must define a no-arg constructor: | ||
|
||
```java | ||
public class SampleApplication extends TinkerApplication { | ||
public SampleApplication() { | ||
super( | ||
//tinkerFlags, which types is supported | ||
//dex only, library only, all support | ||
ShareConstants.TINKER_ENABLE_ALL, | ||
// This is passed as a string so the shell application does not | ||
// have a binary dependency on your ApplicationLifeCycle class. | ||
"tinker.sample.android.SampleApplicationLike"); | ||
} | ||
} | ||
``` | ||
|
||
Use `tinker-android-anno` to generate your `Application` is recommended, you just need to add an annotation for your [SampleApplicationLike](https://github.com/Tencent/tinker/blob/master/tinker-sample-android/app/src/main/java/tinker/sample/android/app/SampleApplicationLike.java) class | ||
|
||
```java | ||
@DefaultLifeCycle( | ||
application = "tinker.sample.android.app.SampleApplication", //application name to generate | ||
flags = ShareConstants.TINKER_ENABLE_ALL) //tinkerFlags above | ||
public class SampleApplicationLike extends DefaultApplicationLike | ||
``` | ||
|
||
How to install tinker? learn more at the sample [SampleApplicationLike](https://github.com/Tencent/tinker/blob/master/tinker-sample-android/app/src/main/java/tinker/sample/android/app/SampleApplicationLike.java). | ||
|
||
For proguard, we have already made the proguard config automatic, and tinker will also generate the multiDex keep proguard file for you. | ||
|
||
For more tinker configurations, learn more at the sample [app/build.gradle](https://github.com/Tencent/tinker/blob/master/tinker-sample-android/app/build.gradle). | ||
|
||
## Support | ||
Any problem? | ||
|
||
1. Learn more from [tinker-sample-android](https://github.com/Tencent/tinker/tree/master/tinker-sample-android). | ||
2. Read the [source code](https://github.com/Tencent/tinker/tree/master). | ||
3. Read the [wiki](https://github.com/Tencent/tinker/wiki) or [FAQ](https://github.com/Tencent/tinker/wiki/Tinker-%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98) for help. | ||
4. Contact us for help. | ||
|
||
## Contributing | ||
|
||
|
||
## License | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:2.2.0' | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
mavenLocal() | ||
jcenter() | ||
} | ||
|
||
tasks.withType(Javadoc).all { | ||
enabled = false | ||
options.encoding = 'UTF-8' | ||
} | ||
|
||
tasks.withType(JavaCompile) { | ||
options.encoding = "UTF-8" | ||
} | ||
} | ||
|
||
ext { | ||
minSdkVersion = 15 | ||
compileSdkVersion = 24 | ||
targetSdkVersion = compileSdkVersion | ||
buildToolsVersion = '24.0.1' | ||
javaVersion = JavaVersion.VERSION_1_7 | ||
|
||
GROUP = 'com.meituan.android.walle' | ||
VERSION_NAME = "${VERSION_NAME_PREFIX}${VERSION_NAME_SUFFIX}" | ||
|
||
POM_PACKAGING = "pom" | ||
POM_DESCRIPTION = "walle" | ||
POM_DESCRIPTION = 'Android Gradle Plugin For Multi -Channel' | ||
POM_URL = '' | ||
POM_SCM_URL = '' | ||
POM_SCM_CONNECTION = '' | ||
POM_SCM_DEV_CONNECTION = '' | ||
POM_LICENCE_NAME = '' | ||
POM_LICENCE_URL = '' | ||
POM_LICENCE_DIST = 'repo' | ||
POM_DEVELOPER_ID = 'achellies' | ||
POM_DEVELOPER_NAME = 'achellies' | ||
POM_DEVELOPER_EMAIL = 'achellies @163.com' | ||
RELEASE_REPOSITORY_URL = 'http://nexus:8081/nexus/content/repositories/releases/' | ||
SNAPSHOT_REPOSITORY_URL = 'http://nexus:8081/nexus/content/repositories/snapshots/' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Project-wide Gradle settings. | ||
|
||
# IDE (e.g. Android Studio) users: | ||
# Gradle settings configured through the IDE *will override* | ||
# any settings specified in this file. | ||
|
||
# For more details on how to configure your build environment visit | ||
# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
|
||
# Specifies the JVM arguments used for the daemon process. | ||
# The setting is particularly useful for tweaking memory settings. | ||
# Default value: -Xmx10248m -XX:MaxPermSize=256m | ||
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
||
# When configured, Gradle will run in incubating parallel mode. | ||
# This option should only be used with decoupled projects. More details, visit | ||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
# org.gradle.parallel=true | ||
|
||
VERSION_NAME_PREFIX=0.0.1-SNAPSHOT | ||
VERSION_NAME_SUFFIX= |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip |
Oops, something went wrong.