Code Monkey home page Code Monkey logo

andresguarddemo's Introduction

微信资源压缩打包

本工程为新建工程,未修改java代码和资源文件,直接打包后进行微信资源压缩的

介绍可参考之前写的一个博客

安装7z

Ubuntu:

	$sudo apt-get install p7zip-full

windows: 下载地址:http://www.7-zip.org/

在win下7Z的安装后如果没有7za.exe的话,可以把7z.exe复制一份改成7za.exe,并配置环境变量 图

修改local.properties文件

增加一行:out.apk=/home/zou/app 指定最后apk输出的目录 可不写,主要用于在copyApk方法中

修改settings.gradle

def initGradleEnvironment() {
    Properties properties=new Properties();
    File file=new File(rootDir.getAbsolutePath()+"/local.properties")
    properties.load(file.newDataInputStream())
    gradle.ext.sdkDir=properties.getProperty("sdk.dir")
    gradle.ext.outApk=properties.getProperty("out.apk")
}
initGradleEnvironment()

读取local.properties文件,并把路径加入到gradle属性中,便于在build.gradle中调用

build.gradle文件

编写一个用于压缩的task,通过gradlew compressApp调用,Linux中./gradlew compressApp调用,注意,zipalign工具,在build-tools目录下,可根据自己拥有的版本进行修改

调用压缩任务

log

andresguarddemo's People

Watchers

TengYang  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.