• 亲自己主动手从源代码 构建 Groovy 2.3.8 公布包



    今天为了学习 怎样使用 Groovy 写 Groovy 的測试代码, 所以到 http://groovy.codehaus.org/Download 下载了 Groovy 2.3.8 的源码包.

    Groovy 是採用 Gradle 作为 构建工具的. 先看我本地的 Gradle 的相关环境:


    >gradle -v
    
    ------------------------------------------------------------
    Gradle 2.2
    ------------------------------------------------------------
    
    Build time: 2014-11-10 13:31:44 UTC
    Build number: none
    Revision: aab8521f1fd9a3484cac18123a72bcfdeb7006ec
    
    Groovy: 2.3.6
    Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
    JVM: 1.8.0_25 (Oracle Corporation 25.25-b02)
    OS: Windows 7 6.1 amd64

    然后我在加压缩之后的源代码根文件夹下输入  gradle tasks  ,  

    gradle 開始从 jcenter 下载须要的 jar 包, 

    然后開始编译,

    最后出现这个错误:

    Detected development environment
    Deployment environment set to Bintray
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Script 'H:TDDownloadgroovy-src-2.3.8groovy-2.3.8gradlepomconfigurer.gradle' line: 10
    
    * What went wrong:
    A problem occurred evaluating script.
    > Could not find property 'groovy' on configuration container.
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    
    BUILD FAILED
    
    Total time: 5 mins 7.403 secs

    我接着用 gradle tasks --info  命令再跑一遍, 还是出现以下的错误:

    Detected development environment
    Deployment environment set to Bintray
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Script 'H:TDDownloadgroovy-src-2.3.8groovy-2.3.8gradlepomconfigurer.gradle' line: 10
    
    * What went wrong:
    A problem occurred evaluating script.
    > Could not find property 'groovy' on configuration container.
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
    
    BUILD FAILED
    
    Total time: 7.911 secs
    Stopped 0 compiler daemon(s).
    Received result DaemonCommandResult[type=CommandFailure, value=org.gradle.launcher.exec.ReportedException: org.gradle.internal.exceptions.LocationAwareException
    : Script 'H:TDDownloadgroovy-src-2.3.8groovy-2.3.8gradlepomconfigurer.gradle' line: 10
    A problem occurred evaluating script.] from daemon DaemonInfo{pid=7252, address=[65f71eaa-6377-4a8a-9370-d90fced0f265 port:50883, addresses:[/127.0.0.1, /0:0:0:
    0:0:0:0:1]], idle=false, context=DefaultDaemonContext[uid=581b3403-93ac-4a93-bcd9-d5374bbb9a86,javaHome=H:ProgramFilesJavajdk1.8.0_25,daemonRegistryDir=C:Us
    erschenjo.gradledaemon,pid=7252,idleTimeout=120000,daemonOpts=-XX:MaxPermSize=196m,-XX:+CMSClassUnloadingEnabled,-XX:+CMSPermGenSweepingEnabled,-Xmx640m,-Dfi
    le.encoding=GBK,-Duser.country=CN,-Duser.language=zh,-Duser.variant]}.

    如何绕过这个错误呢?  难道是我的 Gradle 的版本号问题?


    于是我打开文件  H:TDDownloadgroovy-src-2.3.8groovy-2.3.8README.adoc ,

    发现里面说到:

    To build everything using Gradle (the command below will download Gradle automatically, you do not need to download it first).
    
        ./gradlew clean dist

    于是我就打开 命令行 窗体 到 源代码文件夹下,  键入:  gradlew clean dist

    我发现这个命令会首先下载一个 gradle-1.12 -all 到本地

    C:Userschenjo.gradlewrapperdistsgradle-1.12-all

    然后加压缩, 然后在以该版本号下载 jar 包 以及进行 编译, 汇总.... 尽管中间有一些警告, 或是下载 jar 包时网络受阻, 我就中断命令又一次运行几次, 最后 build 成功.

    Applying Javadoc fix tool (see http://www.kb.cert.org/vuls/id/225657) into H:TDDownloadgroovy-src-2.3.8groovy-2.3.8	argetalljavadoc
    :doc
    :distDoc
    :distSrc
    :groovydoc
    :javadoc
    Applying Javadoc fix tool (see http://www.kb.cert.org/vuls/id/225657) into H:TDDownloadgroovy-src-2.3.8groovy-2.3.8	argetdocsjavadoc
    :syncDoc
    :dist
    
    BUILD SUCCESSFUL
    
    Total time: 18 mins 2.66 secs

    然后我看到 生成的 target 目录 竟然有 500 多 M 字节.

    在 项目文件夹 argetdistributions 下, 有例如以下生成的公布文件:

    groovy-binary-2.3.8.zip

    groovy-docs-2.3.8.zip

    groovy-sdk-2.3.8.zip

    groovy-src-2.3.8.zip


  • 相关阅读:
    C#检查数组是否重复——HashSet
    C#动态生成控件,并添加事件处理,获取控件值并保存
    .net接口交互
    SQL Server 表建Trigger
    SQL Server 表建Trigger
    SQL语句修改not in 变为not exists
    奋战杭电ACM(DAY11)1017
    奋战杭电ACM(DAY11)1016
    奋战杭电ACM(DAY10)1015
    奋战杭电ACM(DAY9)1014
  • 原文地址:https://www.cnblogs.com/brucemengbm/p/7350366.html
Copyright © 2020-2023  润新知