Skip to content

Instantly share code, notes, and snippets.

@VeiZhang
VeiZhang / proguard-rules.pro
Created March 6, 2023 03:30
Android 常用的混淆
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
@VeiZhang
VeiZhang / github_package_publish.gradle
Last active July 16, 2021 02:40
GitHubPackage发布脚本
/**
* Maven Publish Helper
*
* Requires Android Gradle plugin 3.6.0 or higher (available since Android Studio 3.6).
* See also: https://developer.android.com/studio/build/maven-publish-plugin
* https://gist.github.com/Robyer/a6578e60127418b380ca133a1291f017#gistcomment-3716173
* https://petrakeas.medium.com/publish-a-multi-module-java-android-library-to-maven-central-github-ci-automation-at-2021-4f98a311df2a
* https://dzone.com/articles/publishing-multi-module-android-libraries
*
* @Author Robert Pösel -> 改进了
@VeiZhang
VeiZhang / library.gradle
Last active May 18, 2022 08:41
AndroidLibrary通用脚本
/********************* 备注 *****************************/
/**
* 只需要在根目录下的build.gradle中引入apply from: 'config.gradle',其他子module则不需要引入config.gradle,否则可能会出现一些异常:如上传Bintray时报错
* 或者在根目录下远程引入apply from: "https://github.com/VeiZhang/build.gradle/blob/master/config.gradle?raw=true"
*/
/*********************library通用配置*********************/
def plugins = rootProject.ext.plugins
def cfg = rootProject.ext.android
def libs = rootProject.ext.dependencies
@VeiZhang
VeiZhang / config.gradle
Last active May 17, 2023 06:40
AndroidStudio常用配置脚本
import java.text.SimpleDateFormat
import java.util.regex.Matcher
import java.util.regex.Pattern
ext {
// 上传bintray的配置
bintray = [
groupId : "com.excellence",
publishVersion: "1.0.0",
website : "https://github.com/VeiZhang",
@VeiZhang
VeiZhang / application.gradle
Last active May 18, 2022 08:42
AndroidApplication通用脚本
/********************* 备注 *****************************/
/**
* 只需要在根目录下的build.gradle中引入apply from: 'config.gradle',其他子module则不需要引入config.gradle
* 或者在根目录下远程引入apply from: "https://github.com/VeiZhang/build.gradle/blob/master/config.gradle?raw=true"
*/
/*********************application通用配置*********************/
def plugins = rootProject.ext.plugins
def cfg = rootProject.ext.android
def libs = rootProject.ext.dependencies
@VeiZhang
VeiZhang / bintray.gradle
Last active May 11, 2021 01:35
AndroidLibrary上传Bintray脚本
def bintray = rootProject.ext.bintray
/*********************上传jCenter依赖*********************/
apply plugin: 'com.novoda.bintray-release'
/**避免中文注释:编码GBK的不可映射字符**/
tasks.withType(Javadoc) {
options {
encoding "UTF-8"
charSet 'UTF-8'
links "http://docs.oracle.com/javase/7/docs/api"