美文网首页
JAR包的制作

JAR包的制作

作者: 账房先生2016 | 来源:发表于2018-09-17 15:16 被阅读0次

    1.安装Gradle

    https://gradle.org/install/

    $ brew install gradle
    

    将Gradle Path加入~/.bash_profile

    $ export PATH=$PATH:/opt/gradle/gradle-4.10/bin
    

    检查Gradle是否安装成功

    $ gradle -v
    
    ------------------------------------------------------------
    Gradle 4.10
    ------------------------------------------------------------
    

    2.Create a library project

    $ mkdir building-java-libraries
    $ cd building-java-libraries
    $ gradle init --type java-library
    

    3.Build

    $ ./gradlew build
    > Task :compileJava
    > Task :processResources NO-SOURCE
    > Task :classes
    > Task :jar
    > Task :assemble
    > Task :compileTestJava
    > Task :processTestResources NO-SOURCE
    > Task :testClasses
    
    > Task :test
    Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
    
    > Task :check
    > Task :build
    
    BUILD SUCCESSFUL in 12s
    4 actionable tasks: 4 executed
    

    PS: Jar project can not import aar dependency.

    相关文章

      网友评论

          本文标题:JAR包的制作

          本文链接:https://www.haomeiwen.com/subject/acofgftx.html