How Android Studio packs a Jar pack

Source: Internet
Author: User

The following is a batch processing to hit the jar package.

First, copy the following code and then create a new txt text on the desktop, rename the file to a. bat suffix, edit it, paste the code into the Save, and double-click to run the batch file.

@echo Offecho "Please enter the module path (right-click on module and select Copy Path to get the path):" Set/p Modulepath=echo%modulepath%set classespath=% Modulepath%\build\intermediates\classes\debugset jarpath=%modulepath%\libsmd%jarPath%echo "Classes path is:" Echo% Classespath%echo "Start packing, please wait ... "JAR-CVF%jarpath%my.jar%classespath%comecho" package complete, the jar package in the Libs directory of the module:-) "Pause

Code Analysis:

@echo Offecho "Please enter the module path (right-click on module and select Copy Path to get the path):" set/p modulepath=                                       1. Enter the module path, and assigned to Modulepath2. Use the module path to get the class path and assign the value to Classespath\debugset jarpath=%modulepath%\libs\                          3. Path of packaged jar MD%jarpath%                                             4. Create jar Path echo "Classes's path is:" Echo%classespath%echo "start packing, please wait ... "JAR-CVF%jarpath%my.jar%classespath%com                5. Execute the Package command (make sure the class folder name under the Classespath path is com echo "package complete, jar package in the Libs directory of the module:-)" Pause

Classes Path:

Hit the jar package:

How Android Studio packs a Jar pack

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.